1、刀具物料刀柄、夹具物料托盘搜索模型的序列号对象字段的list列表添加Rfid字段;2、制造单搜索看板添加记数功能;3、刀具组装岗添加货位的读写权限;4、功能刀具组装单弹窗添加手动输入五种物料的货位编码时,对该货位进行多项校验;

This commit is contained in:
yuxianghui
2024-04-28 17:20:11 +08:00
parent 761efbceaa
commit 9d9b454ba5
8 changed files with 73 additions and 16 deletions

View File

@@ -4,7 +4,7 @@ csv_internal_sep = ,
data_dir = /var/lib/odoo data_dir = /var/lib/odoo
db_host = 172.17.0.2 db_host = 172.17.0.2
db_maxconn = 64 db_maxconn = 64
db_name = sf_t2cs_003 db_name = sf_t_0430
db_password = sf db_password = sf
db_port = 5432 db_port = 5432
db_sslmode = prefer db_sslmode = prefer

View File

@@ -380,7 +380,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//search" position="inside"> <xpath expr="//search" position="inside">
<searchpanel class="account_root"> <searchpanel class="account_root">
<field name="state" icon="fa-filter"/> <field name="state" icon="fa-filter" enable_counters="1"/>
</searchpanel> </searchpanel>
</xpath> </xpath>
<filter name='todo' position="replace"/> <filter name='todo' position="replace"/>

View File

@@ -345,7 +345,7 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
# 创建装刀请求 # 创建装刀请求
knife_plan.apply_for_tooling() knife_plan.apply_for_tooling()
else: else:
logging.info('功能刀具【%s】满足CNC用刀需求') logging.info('功能刀具【%s】满足CNC用刀需求' % cnc_processing.cutting_tool_name)
class FunctionalToolAssembly(models.Model): class FunctionalToolAssembly(models.Model):
@@ -811,6 +811,8 @@ class FunctionalToolDismantle(models.Model):
location_dest_scrap = self.env['stock.location'].search([('name', '=', 'Scrap')]) location_dest_scrap = self.env['stock.location'].search([('name', '=', 'Scrap')])
if self.handle_rfid: if self.handle_rfid:
lot = self.env['stock.lot'].sudo().search([('rfid', '=', self.handle_rfid)]) lot = self.env['stock.lot'].sudo().search([('rfid', '=', self.handle_rfid)])
if not lot:
raise ValidationError('Rfid为【%s】的功能刀具序列号不存在!' % self.handle_rfid)
functional_tool_assembly = self.functional_tool_id.functional_tool_name_id functional_tool_assembly = self.functional_tool_id.functional_tool_name_id
if self.scrap_boolean: if self.scrap_boolean:
# 刀柄报废 入库到Scrap # 刀柄报废 入库到Scrap

View File

@@ -61,6 +61,7 @@
<field name="barcode_ids"> <field name="barcode_ids">
<tree create="0"> <tree create="0">
<field name="name"/> <field name="name"/>
<field name="rfid"/>
<field name="tool_material_status"/> <field name="tool_material_status"/>
<!-- <button string="序列号注册" name="enroll_fixture_material_stock" type="object"--> <!-- <button string="序列号注册" name="enroll_fixture_material_stock" type="object"-->
<!-- class="btn-primary"/>--> <!-- class="btn-primary"/>-->

View File

@@ -944,7 +944,5 @@
<field name="search_view_id" ref="sf_functional_tool_dismantle_search"/> <field name="search_view_id" ref="sf_functional_tool_dismantle_search"/>
<field name="context">{'search_default_no_dismantle_state':1}</field> <field name="context">{'search_default_no_dismantle_state':1}</field>
</record> </record>
</data> </data>
</odoo> </odoo>

View File

@@ -61,6 +61,7 @@
<field name="barcode_ids"> <field name="barcode_ids">
<tree> <tree>
<field name="name"/> <field name="name"/>
<field name="rfid"/>
<field name="tool_material_status"/> <field name="tool_material_status"/>
<!-- <button name="enroll_tool_material_stock" string="序列号注册" type="object" class="btn-primary"/>--> <!-- <button name="enroll_tool_material_stock" string="序列号注册" type="object" class="btn-primary"/>-->
</tree> </tree>

View File

@@ -246,9 +246,20 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
if self.integral_freight_barcode: if self.integral_freight_barcode:
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.integral_freight_barcode)]) location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.integral_freight_barcode)])
if location: if location:
self.integral_product_id = location.product_id.id if not location.product_id:
raise ValidationError('编码为【%s】的货位为空货位!' % location.barcode)
else:
material_name_id = location.product_id.cutting_tool_material_id
if material_name_id and material_name_id.name == '整体式刀具':
if location.product_num == 0:
raise ValidationError('编码为【%s】的货位的产品库存数量为0,请重新选择!' % location.barcode)
self.integral_product_id = location.product_id.id
else:
raise ValidationError(
'编码为【%s】的货位存放的产品为【%s】,不是整体式刀具,请重新选择!' % (
location.barcode, location.product_id.name))
else: else:
self.integral_product_id = False raise ValidationError('编码为【%s】的货位不存在!' % self.integral_freight_barcode)
# ===============刀片型号==================== # ===============刀片型号====================
blade_freight_barcode = fields.Char('刀片货位') blade_freight_barcode = fields.Char('刀片货位')
@@ -265,9 +276,20 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
if self.blade_freight_barcode: if self.blade_freight_barcode:
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.blade_freight_barcode)]) location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.blade_freight_barcode)])
if location: if location:
self.blade_product_id = location.product_id.id if not location.product_id:
raise ValidationError('编码为【%s】的货位为空货位!' % location.barcode)
else:
material_name_id = location.product_id.cutting_tool_material_id
if material_name_id and material_name_id.name == '刀片':
if location.product_num == 0:
raise ValidationError('编码为【%s】的货位的产品库存数量为0,请重新选择!' % location.barcode)
self.blade_product_id = location.product_id.id
else:
raise ValidationError(
'编码为【%s】的货位存放的产品为【%s】,不是刀片,请重新选择!' % (
location.barcode, location.product_id.name))
else: else:
self.blade_product_id = False raise ValidationError('编码为【%s】的货位不存在!' % self.blade_freight_barcode)
# ====================刀杆型号================== # ====================刀杆型号==================
bar_freight_barcode = fields.Char('刀杆货位') bar_freight_barcode = fields.Char('刀杆货位')
@@ -284,9 +306,20 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
if self.bar_freight_barcode: if self.bar_freight_barcode:
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.bar_freight_barcode)]) location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.bar_freight_barcode)])
if location: if location:
self.bar_product_id = location.product_id.id if not location.product_id:
raise ValidationError('编码为【%s】的货位为空货位!' % location.barcode)
else:
material_name_id = location.product_id.cutting_tool_material_id
if material_name_id and material_name_id.name == '刀杆':
if location.product_num == 0:
raise ValidationError('编码为【%s】的货位的产品库存数量为0,请重新选择!' % location.barcode)
self.bar_product_id = location.product_id.id
else:
raise ValidationError(
'编码为【%s】的货位存放的产品为【%s】,不是刀杆,请重新选择!' % (
location.barcode, location.product_id.name))
else: else:
self.bar_product_id = False raise ValidationError('编码为【%s】的货位不存在!' % self.bar_freight_barcode)
# ===============刀盘型号=================== # ===============刀盘型号===================
pad_freight_barcode = fields.Char('刀盘货位') pad_freight_barcode = fields.Char('刀盘货位')
@@ -303,9 +336,20 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
if self.pad_freight_barcode: if self.pad_freight_barcode:
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.pad_freight_barcode)]) location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.pad_freight_barcode)])
if location: if location:
self.pad_product_id = location.product_id.id if not location.product_id:
raise ValidationError('编码为【%s】的货位为空货位!' % location.barcode)
else:
material_name_id = location.product_id.cutting_tool_material_id
if material_name_id and material_name_id.name == '刀盘':
if location.product_num == 0:
raise ValidationError('编码为【%s】的货位的产品库存数量为0,请重新选择!' % location.barcode)
self.pad_product_id = location.product_id.id
else:
raise ValidationError(
'编码为【%s】的货位存放的产品为【%s】,不是刀盘,请重新选择!' % (
location.barcode, location.product_id.name))
else: else:
self.pad_product_id = False raise ValidationError('编码为【%s】的货位不存在!' % self.pad_freight_barcode)
# ================刀柄型号=============== # ================刀柄型号===============
handle_freight_rfid = fields.Char('刀柄Rfid', compute='_compute_rfid') handle_freight_rfid = fields.Char('刀柄Rfid', compute='_compute_rfid')
@@ -342,12 +386,22 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
if self.chuck_freight_barcode: if self.chuck_freight_barcode:
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.chuck_freight_barcode)]) location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.chuck_freight_barcode)])
if location: if location:
self.chuck_product_id = location.product_id.id if not location.product_id:
raise ValidationError('编码为【%s】的货位为空货位!' % location.barcode)
else:
material_name_id = location.product_id.cutting_tool_material_id
if material_name_id and material_name_id.name == '夹头':
if location.product_num == 0:
raise ValidationError('编码为【%s】的货位的产品库存数量为0,请重新选择!' % location.barcode)
self.chuck_product_id = location.product_id.id
else:
raise ValidationError(
'编码为【%s】的货位存放的产品为【%s】,不是夹头,请重新选择!' % (
location.barcode, location.product_id.name))
else: else:
self.chuck_product_id = False raise ValidationError('编码为【%s】的货位不存在!' % self.chuck_freight_barcode)
# ======================================== # ========================================
def on_barcode_scanned(self, barcode): def on_barcode_scanned(self, barcode):
""" """
智能工厂组装单处扫码绑定刀具物料 智能工厂组装单处扫码绑定刀具物料

View File

@@ -136,6 +136,7 @@ access_sf_shelf_location_wizard_group_plan_dispatch,sf_shelf_location_wizard_gro
access_sf_shelf_location_wizard_group_sf_stock_user_group_sf_stock_user,sf_shelf_location_wizard_group_sf_stock_user_group_sf_stock_user,model_sf_shelf_location_wizard,sf_warehouse.group_sf_stock_user,1,0,0,0 access_sf_shelf_location_wizard_group_sf_stock_user_group_sf_stock_user,sf_shelf_location_wizard_group_sf_stock_user_group_sf_stock_user,model_sf_shelf_location_wizard,sf_warehouse.group_sf_stock_user,1,0,0,0
access_sf_shelf_location_wizard_group_sf_stock_manager,sf_shelf_location_wizard_group_sf_stock_manager,model_sf_shelf_location_wizard,sf_warehouse.group_sf_stock_manager,1,1,1,0 access_sf_shelf_location_wizard_group_sf_stock_manager,sf_shelf_location_wizard_group_sf_stock_manager,model_sf_shelf_location_wizard,sf_warehouse.group_sf_stock_manager,1,1,1,0
access_sf_shelf_location_group_sf_tool_user,sf.shelf.location.group_sf_tool_user,model_sf_shelf_location,sf_base.group_sf_tool_user,1,1,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
136
137
138
139
140
141
142