From 4497fb04c1fd5ed28818f615e2029190e304be51 Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Tue, 18 Jun 2024 17:19:41 +0800
Subject: [PATCH 1/7] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96=20=E6=89=98?=
=?UTF-8?q?=E7=9B=98=E7=BB=91=E5=AE=9A=E5=B7=A5=E5=8D=95=E9=80=BB=E8=BE=91?=
=?UTF-8?q?=E4=BC=98=E5=8C=96=20=EF=BC=9B2=20=E5=AE=8C=E6=88=90=20?=
=?UTF-8?q?=E6=95=B4=E4=BD=93=E5=BC=8F=E5=88=80=E5=85=B7=E6=89=B9=E6=AC=A1?=
=?UTF-8?q?/=E5=BA=8F=E5=88=97=E5=8F=B7=E7=94=9F=E6=88=90=E7=9A=84?=
=?UTF-8?q?=E4=BC=98=E5=8C=96=E9=9C=80=E6=B1=82=EF=BC=9B=203=E3=80=81?=
=?UTF-8?q?=E5=AE=8C=E6=88=90=20=E5=9D=AF=E6=96=99=E5=BA=8F=E5=88=97?=
=?UTF-8?q?=E5=8F=B7=E7=94=9F=E6=88=90=E8=A7=84=E5=88=99=E4=BC=98=E5=8C=96?=
=?UTF-8?q?=E9=9C=80=E6=B1=821=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../views/WorkCenterBarcodes.xml | 3 +++
sf_manufacturing/models/mrp_workorder.py | 25 +++++++++++--------
sf_manufacturing/models/stock.py | 15 ++++++++---
sf_manufacturing/views/mrp_workorder_view.xml | 3 ++-
4 files changed, 31 insertions(+), 15 deletions(-)
diff --git a/sf_machine_connect/views/WorkCenterBarcodes.xml b/sf_machine_connect/views/WorkCenterBarcodes.xml
index d44c8a82..aea9731b 100644
--- a/sf_machine_connect/views/WorkCenterBarcodes.xml
+++ b/sf_machine_connect/views/WorkCenterBarcodes.xml
@@ -25,6 +25,9 @@
+
+
+
\ No newline at end of file
diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py
index 002c83aa..d2e92266 100644
--- a/sf_manufacturing/models/mrp_workorder.py
+++ b/sf_manufacturing/models/mrp_workorder.py
@@ -21,6 +21,8 @@ class ResMrpWorkOrder(models.Model):
_inherit = 'mrp.workorder'
_order = 'sequence asc,create_date desc'
+ product_tmpl_name = fields.Char('坯料产品名称', related='production_bom_id.bom_line_ids.product_id.name')
+
product_tmpl_id_length = fields.Float(related='production_id.product_tmpl_id.length', readonly=True, store=True,
string="坯料长度(mm)")
product_tmpl_id_width = fields.Float(related='production_id.product_tmpl_id.width', readonly=True, store=True,
@@ -48,6 +50,7 @@ class ResMrpWorkOrder(models.Model):
manual_quotation = fields.Boolean('人工编程', default=False, readonly=True)
+
@api.onchange('users_ids')
def get_user_permissions(self):
uid = self.env.uid
@@ -849,12 +852,12 @@ class ResMrpWorkOrder(models.Model):
limit=1, order='id asc')
if not cnc_workorder.cnc_ids:
raise UserError(_('该制造订单还未下发CNC程序,请稍后再试'))
- else:
- for item in cnc_workorder.cnc_ids:
- functional_cutting_tool = self.env['sf.functional.cutting.tool.entity'].search(
- [('tool_name_id.name', '=', item.cutting_tool_name)])
- if not functional_cutting_tool:
- raise UserError(_('该制造订单的CNC程序为%s没有对应的功能刀具' % item.cutting_tool_name))
+ # else:
+ # for item in cnc_workorder.cnc_ids:
+ # functional_cutting_tool = self.env['sf.functional.cutting.tool.entity'].search(
+ # [('tool_name_id.name', '=', item.cutting_tool_name)])
+ # if not functional_cutting_tool:
+ # raise UserError(_('该制造订单的CNC程序为%s没有对应的功能刀具' % item.cutting_tool_name))
if self.routing_type == '解除装夹':
'''
记录开始时间
@@ -1011,8 +1014,9 @@ class ResMrpWorkOrder(models.Model):
is_production_id = False
if is_production_id is True and record.routing_type in ['解除装夹', '表面工艺']:
for workorder in record.production_id.workorder_ids:
- workorder.rfid_code_old = workorder.rfid_code
- workorder.rfid_code = None
+ if workorder.processing_panel == record.processing_panel:
+ workorder.rfid_code_old = workorder.rfid_code
+ workorder.rfid_code = None
for move_raw_id in record.production_id.move_raw_ids:
move_raw_id.quantity_done = move_raw_id.product_uom_qty
record.process_state = '已完工'
@@ -1254,11 +1258,12 @@ class SfWorkOrderBarcodes(models.Model):
workorder.write(val)
self.write(val)
workorder_rfid = self.env['mrp.workorder'].search(
- [('production_id', '=', workorder.production_id.id)])
+ [('production_id', '=', workorder.production_id.id),
+ ('processing_panel', '=', workorder.processing_panel)])
if workorder_rfid:
for item in workorder_rfid:
item.write({'rfid_code': barcode})
- logging.info("Rfid绑定成功!!!")
+ logging.info("Rfid[%s]绑定成功!!!" % barcode)
else:
raise UserError('该Rfid【%s】绑定的是【%s】, 不是托盘!!!' % (barcode, lot.product_id.name))
self.process_state = '待检测'
diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py
index 95d877b3..dbca7e20 100644
--- a/sf_manufacturing/models/stock.py
+++ b/sf_manufacturing/models/stock.py
@@ -675,6 +675,7 @@ class ReStockMove(models.Model):
self.next_serial = self._get_tool_next_serial(self.company_id, self.product_id, self.origin)
else:
self.next_serial = self.env['stock.lot']._get_next_serial(self.company_id, self.product_id)
+ # self.action_assign_serial_show_details()
elif self.product_id.tracking == "lot":
self._put_tool_lot(self.company_id, self.product_id, self.origin)
@@ -704,10 +705,16 @@ class ReStockMove(models.Model):
def _put_tool_lot(self, company, product, origin):
if product.tracking == "lot" and self.product_id.categ_id.name == '刀具':
if not self.move_line_nosuggest_ids:
- lot_names = self.env['stock.lot'].generate_lot_names(
- '%s-%s-%s' % ('%s-T-DJWL-%s' % (
- product.cutting_tool_model_id.code.split('-')[0], product.cutting_tool_material_id.code),
- datetime.now().strftime("%Y%m%d"), origin), 1)
+ lot_code = '%s-%s-%s' % ('%s-T-DJWL-%s' % (
+ product.cutting_tool_model_id.code.split('-')[0], product.cutting_tool_material_id.code),
+ datetime.now().strftime("%Y%m%d"), origin)
+ move_line_ids = self.env['stock.move.line'].sudo().search([('lot_name', 'like', lot_code)], limit=1,
+ order='id desc')
+ if not move_line_ids:
+ lot_code = '%s-001' % lot_code
+ else:
+ lot_code = '%s-%03d' % (lot_code, int(move_line_ids.lot_name[-3:]) + 1)
+ lot_names = self.env['stock.lot'].generate_lot_names(lot_code, 1)
move_lines_commands = self._generate_serial_move_line_commands_tool_lot(lot_names)
self.write({'move_line_nosuggest_ids': move_lines_commands})
for item in self.move_line_nosuggest_ids:
diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml
index 11219363..b56405b9 100644
--- a/sf_manufacturing/views/mrp_workorder_view.xml
+++ b/sf_manufacturing/views/mrp_workorder_view.xml
@@ -19,6 +19,7 @@
+
@@ -214,7 +215,7 @@
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
-
From 6dae144d762f8145b71b5490faf466c05e47109a Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Wed, 19 Jun 2024 11:19:47 +0800
Subject: [PATCH 2/7] =?UTF-8?q?1=E3=80=81=E5=8A=9F=E8=83=BD=E5=88=80?=
=?UTF-8?q?=E5=85=B7=E6=8B=86=E8=A7=A3=E5=8D=95=E4=BC=98=E5=8C=96=EF=BC=9B?=
=?UTF-8?q?2=E3=80=81=E5=AE=8C=E6=88=90=20=E9=9C=80=E6=B1=82=E5=9D=AF?=
=?UTF-8?q?=E6=96=99=E5=BA=8F=E5=88=97=E5=8F=B7=E7=94=9F=E6=88=90=E8=A7=84?=
=?UTF-8?q?=E5=88=99=E4=BC=98=E5=8C=962=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_manufacturing/models/stock.py | 18 +++++++++++++++-
sf_manufacturing/views/stock_lot_views.xml | 4 ++--
sf_sale/models/sale_order.py | 10 +++++++++
sf_tool_management/models/base.py | 25 ++++++++++++----------
sf_tool_management/wizard/wizard.py | 4 ++--
sf_warehouse/models/model.py | 5 ++++-
6 files changed, 49 insertions(+), 17 deletions(-)
diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py
index dbca7e20..49f00140 100644
--- a/sf_manufacturing/models/stock.py
+++ b/sf_manufacturing/models/stock.py
@@ -675,7 +675,6 @@ class ReStockMove(models.Model):
self.next_serial = self._get_tool_next_serial(self.company_id, self.product_id, self.origin)
else:
self.next_serial = self.env['stock.lot']._get_next_serial(self.company_id, self.product_id)
- # self.action_assign_serial_show_details()
elif self.product_id.tracking == "lot":
self._put_tool_lot(self.company_id, self.product_id, self.origin)
@@ -702,6 +701,23 @@ class ReStockMove(models.Model):
),
}
+ def put_move_line(self):
+ """
+ 确认订单时,自动分配序列号
+ """
+ if self.product_id.tracking == "serial":
+ if self.product_id.categ_id.name == '刀具':
+ self.next_serial = self._get_tool_next_serial(self.company_id, self.product_id, self.origin)
+ else:
+ self.next_serial = self.env['stock.lot']._get_next_serial(self.company_id, self.product_id)
+ self._generate_serial_numbers()
+ for item in self.move_line_nosuggest_ids:
+ if item.lot_name:
+ lot_name = item.lot_name
+ if item.product_id.categ_id.name == '坯料':
+ lot_name = lot_name.split('[', 1)[0]
+ item.lot_qr_code = self.compute_lot_qr_code(lot_name)
+
def _put_tool_lot(self, company, product, origin):
if product.tracking == "lot" and self.product_id.categ_id.name == '刀具':
if not self.move_line_nosuggest_ids:
diff --git a/sf_manufacturing/views/stock_lot_views.xml b/sf_manufacturing/views/stock_lot_views.xml
index 2aed0d2c..4b6cce72 100644
--- a/sf_manufacturing/views/stock_lot_views.xml
+++ b/sf_manufacturing/views/stock_lot_views.xml
@@ -41,8 +41,8 @@
stock.lot
-
-
+
+
diff --git a/sf_sale/models/sale_order.py b/sf_sale/models/sale_order.py
index 9486f73c..d53ea6a0 100644
--- a/sf_sale/models/sale_order.py
+++ b/sf_sale/models/sale_order.py
@@ -215,6 +215,16 @@ class RePurchaseOrder(models.Model):
if len(product_id) != len(line):
raise ValidationError('【%s】已存在,请勿重复添加' % product[-1].name)
+ def button_confirm(self):
+ result = super(RePurchaseOrder, self).button_confirm()
+ for item in self:
+ if item.picking_ids:
+ for picking_id in item.picking_ids:
+ if picking_id.move_ids:
+ for move_id in picking_id.move_ids:
+ move_id.put_move_line()
+ return result
+
class ResPartnerToSale(models.Model):
_inherit = 'res.partner'
diff --git a/sf_tool_management/models/base.py b/sf_tool_management/models/base.py
index bbcf9927..8daf1488 100644
--- a/sf_tool_management/models/base.py
+++ b/sf_tool_management/models/base.py
@@ -926,7 +926,7 @@ class FunctionalToolDismantle(models.Model):
location = self.env['stock.location'].search([('name', '=', '刀具组装位置')])
location_dest = self.env['stock.location'].search([('name', '=', '刀具房')])
# =================刀柄是否[报废]拆解=======
- location_dest_scrap = self.env['stock.location'].search([('name', '=', 'Scrap')])
+ location_dest_scrap_ids = self.env['stock.location'].search([('name', 'in', ('Scrap', '报废'))])
if self.handle_rfid:
lot = self.env['stock.lot'].sudo().search([('rfid', '=', self.handle_rfid)])
if not lot:
@@ -934,30 +934,33 @@ class FunctionalToolDismantle(models.Model):
functional_tool_assembly = self.functional_tool_id.functional_tool_name_id
if self.scrap_boolean:
# 刀柄报废 入库到Scrap
- lot.create_stock_quant(location, location_dest_scrap, functional_tool_assembly.id, code,
+ lot.create_stock_quant(location, location_dest_scrap_ids[-1], functional_tool_assembly.id, code,
functional_tool_assembly, functional_tool_assembly.tool_groups_id)
+ lot.tool_material_status = '报废'
else:
# 刀柄不报废 入库到刀具房
lot.create_stock_quant(location, location_dest, functional_tool_assembly.id, code,
functional_tool_assembly, functional_tool_assembly.tool_groups_id)
+ lot.tool_material_status = '可用'
+
# ==============功能刀具[报废]拆解================
if self.dismantle_cause in ['寿命到期报废', '崩刀报废']:
# 除刀柄外物料报废 入库到Scrap
if self.integral_product_id:
self.integral_product_id.dismantle_stock_moves(False, self.integral_lot_id, location,
- location_dest_scrap, code)
+ location_dest_scrap_ids[-1], code)
elif self.blade_product_id:
- self.blade_product_id.dismantle_stock_moves(False, self.blade_lot_id, location, location_dest_scrap,
- code)
+ self.blade_product_id.dismantle_stock_moves(False, self.blade_lot_id, location,
+ location_dest_scrap_ids[-1], code)
if self.bar_product_id:
- self.bar_product_id.dismantle_stock_moves(False, self.bar_lot_id, location, location_dest_scrap,
- code)
+ self.bar_product_id.dismantle_stock_moves(False, self.bar_lot_id, location,
+ location_dest_scrap_ids[-1], code)
elif self.pad_product_id:
- self.pad_product_id.dismantle_stock_moves(False, self.pad_lot_id, location, location_dest_scrap,
- code)
+ self.pad_product_id.dismantle_stock_moves(False, self.pad_lot_id, location,
+ location_dest_scrap_ids[-1], code)
if self.chuck_product_id:
- self.chuck_product_id.dismantle_stock_moves(False, self.chuck_lot_id, location, location_dest_scrap,
- code)
+ self.chuck_product_id.dismantle_stock_moves(False, self.chuck_lot_id, location,
+ location_dest_scrap_ids[-1], code)
# ===========功能刀具[磨削]拆解==============
# elif self.dismantle_cause in ['刀具需磨削']:
# location_dest = self.env['stock.location'].search([('name', '=', '磨削房')])
diff --git a/sf_tool_management/wizard/wizard.py b/sf_tool_management/wizard/wizard.py
index 6aec47e9..af772016 100644
--- a/sf_tool_management/wizard/wizard.py
+++ b/sf_tool_management/wizard/wizard.py
@@ -854,10 +854,10 @@ class ProductProduct(models.Model):
'company_id': self.env.company.id
})
# 获取位置对象
- location_inventory_id = self.env['stock.location'].search([('name', '=', 'Production')])
+ location_inventory_ids = self.env['stock.location'].search([('name', 'in', ('Production', '生产'))])
stock_location_id = self.env['stock.location'].search([('name', '=', '组装后')])
# 创建功能刀具该批次/序列号 库存移动和移动历史
- stock_lot.create_stock_quant(location_inventory_id, stock_location_id, functional_tool_assembly.id,
+ stock_lot.create_stock_quant(location_inventory_ids[-1], stock_location_id, functional_tool_assembly.id,
obj.assembly_order_code, obj, obj.after_tool_groups_id)
return stock_lot
diff --git a/sf_warehouse/models/model.py b/sf_warehouse/models/model.py
index 62a7836b..34fa57fe 100644
--- a/sf_warehouse/models/model.py
+++ b/sf_warehouse/models/model.py
@@ -1143,7 +1143,10 @@ class CustomStockMove(models.Model):
move_lines = self.move_line_ids # 获取当前 stock.move 对应的所有 stock.move.line 记录
for line in move_lines:
if line.lot_name: # 确保 lot_name 存在
- qr_data = self.compute_lot_qr_code(line.lot_name)
+ lot_name = line.lot_name
+ if line.product_id.categ_id.name == '坯料':
+ lot_name = lot_name.split('[', 1)[0]
+ qr_data = self.compute_lot_qr_code(lot_name)
# 假设 stock.move.line 模型中有一个字段叫做 lot_qr_code 用于存储二维码数据
line.lot_qr_code = qr_data
return result
From c0b673bfd00f9450a6c2dd7182ad5a7500acdaec Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Wed, 19 Jun 2024 11:23:25 +0800
Subject: [PATCH 3/7] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_sale/models/sale_order.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/sf_sale/models/sale_order.py b/sf_sale/models/sale_order.py
index d53ea6a0..6508132d 100644
--- a/sf_sale/models/sale_order.py
+++ b/sf_sale/models/sale_order.py
@@ -218,6 +218,7 @@ class RePurchaseOrder(models.Model):
def button_confirm(self):
result = super(RePurchaseOrder, self).button_confirm()
for item in self:
+ # 确认订单时,自动分配序列号
if item.picking_ids:
for picking_id in item.picking_ids:
if picking_id.move_ids:
From 1f32aafc9b779cb526a0ebbf324084e87cd392fe Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Wed, 19 Jun 2024 16:38:30 +0800
Subject: [PATCH 4/7] =?UTF-8?q?1=E3=80=81=E5=AE=8C=E6=88=90=20=20=E5=B7=A5?=
=?UTF-8?q?=E4=BB=B6=E8=A3=85=E5=A4=B9=E9=A2=84=E8=B0=83=E5=B7=A5=E5=8D=95?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96=E9=9C=80=E6=B1=82-3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_manufacturing/views/mrp_workorder_view.xml | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml
index a5d902bf..d93df718 100644
--- a/sf_manufacturing/views/mrp_workorder_view.xml
+++ b/sf_manufacturing/views/mrp_workorder_view.xml
@@ -285,20 +285,26 @@
+
+
+
+
+
+
-
-
-
+
+
+
From 21f2a704dbe65ed30677460c6749b1e417ee95f8 Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Wed, 19 Jun 2024 17:03:44 +0800
Subject: [PATCH 5/7] =?UTF-8?q?1=E3=80=81=E5=AF=B9=E5=88=80=E4=BB=AA?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=8E=B7=E5=8F=96=E7=9A=84=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E5=88=80=E5=85=B7=E5=8D=8A=E5=BE=84=E5=80=BC=E4=B9=98=E4=BA=8C?=
=?UTF-8?q?=E5=90=8E=E5=86=8D=E8=B5=8B=E5=80=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_tool_management/controllers/controllers.py | 2 +-
sf_tool_management/models/maintenance_equipment.py | 3 ---
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/sf_tool_management/controllers/controllers.py b/sf_tool_management/controllers/controllers.py
index b6adb6b7..4b0909dc 100644
--- a/sf_tool_management/controllers/controllers.py
+++ b/sf_tool_management/controllers/controllers.py
@@ -121,7 +121,7 @@ class Manufacturing_Connect(http.Controller):
{'Succeed': False, 'ErrorCode': 201, 'code': data_list[0], 'Error': '没有找到正在组装的组装单!'})
tool_assembly.write({
'after_assembly_tool_loading_length': float(data_list[1] or "0"), # 高度(总长度)
- 'after_assembly_functional_tool_diameter': float(data_list[2] or "0"), # 直径
+ 'after_assembly_functional_tool_diameter': float(data_list[2] or "0") * 2, # 直径
'after_assembly_knife_tip_r_angle': float(data_list[3] or "0") # R角
})
except Exception as e:
diff --git a/sf_tool_management/models/maintenance_equipment.py b/sf_tool_management/models/maintenance_equipment.py
index 32c153d7..d308f1f1 100644
--- a/sf_tool_management/models/maintenance_equipment.py
+++ b/sf_tool_management/models/maintenance_equipment.py
@@ -142,9 +142,6 @@ class StockLot(models.Model):
record.tool_material_status = '报废'
else:
record.tool_material_status = '未入库'
- if record.fixture_material_search_id:
- # 注册夹具物料状态到cloud平台
- record.enroll_fixture_material_stock()
@api.model
def name_search(self, name='', args=None, operator='ilike', limit=100):
From 60560fe19566809ad2b381ba1ebeca2cb53349fe Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Wed, 19 Jun 2024 17:40:49 +0800
Subject: [PATCH 6/7] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96=E5=B7=A5?=
=?UTF-8?q?=E5=8D=95=E8=A7=A3=E7=BB=91Rfid?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_manufacturing/models/mrp_workorder.py | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py
index d2e92266..ba7bc2c5 100644
--- a/sf_manufacturing/models/mrp_workorder.py
+++ b/sf_manufacturing/models/mrp_workorder.py
@@ -50,7 +50,6 @@ class ResMrpWorkOrder(models.Model):
manual_quotation = fields.Boolean('人工编程', default=False, readonly=True)
-
@api.onchange('users_ids')
def get_user_permissions(self):
uid = self.env.uid
@@ -1012,11 +1011,15 @@ class ResMrpWorkOrder(models.Model):
for workorder in record.production_id.workorder_ids:
if workorder.state != 'done':
is_production_id = False
- if is_production_id is True and record.routing_type in ['解除装夹', '表面工艺']:
+ if record.routing_type == '解除装夹':
for workorder in record.production_id.workorder_ids:
if workorder.processing_panel == record.processing_panel:
- workorder.rfid_code_old = workorder.rfid_code
- workorder.rfid_code = None
+ rfid_code = workorder.rfid_code
+ workorder.write({'rfid_code_old': rfid_code,
+ 'rfid_code': ''})
+ workorder.rfid_code_old = rfid_code
+ workorder.rfid_code = ''
+ if is_production_id is True and record.routing_type in ['解除装夹', '表面工艺']:
for move_raw_id in record.production_id.move_raw_ids:
move_raw_id.quantity_done = move_raw_id.product_uom_qty
record.process_state = '已完工'
From f8c1d75b63bee22ea286de9a4d09115172d11a9d Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Thu, 20 Jun 2024 17:30:23 +0800
Subject: [PATCH 7/7] =?UTF-8?q?1=E3=80=81=E5=88=80=E5=85=B7=E8=BF=87?=
=?UTF-8?q?=E6=BB=A4=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_tool_management/models/functional_tool.py | 4 ++--
sf_tool_management/views/functional_tool_views.xml | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/sf_tool_management/models/functional_tool.py b/sf_tool_management/models/functional_tool.py
index 34f26ff6..45f52f4f 100644
--- a/sf_tool_management/models/functional_tool.py
+++ b/sf_tool_management/models/functional_tool.py
@@ -404,8 +404,8 @@ class RealTimeDistributionOfFunctionalTools(models.Model):
side_shelf_num = fields.Integer(string='线边刀库数量', compute='_compute_stock_num', store=True)
on_tool_stock_num = fields.Integer(string='机内刀库数量', compute='_compute_stock_num', store=True)
tool_stock_total = fields.Integer(string='当前库存量', compute='_compute_tool_stock_total', store=True)
- min_stock_num = fields.Integer('最低库存量')
- max_stock_num = fields.Integer('最高库存量')
+ min_stock_num = fields.Integer('最低库存量', tracking=True)
+ max_stock_num = fields.Integer('最高库存量', tracking=True)
batch_replenishment_num = fields.Integer('批次补货量', readonly=True, compute='_compute_batch_replenishment_num',
store=True)
unit = fields.Char('单位', default="件")
diff --git a/sf_tool_management/views/functional_tool_views.xml b/sf_tool_management/views/functional_tool_views.xml
index 283eb2cc..6d812368 100644
--- a/sf_tool_management/views/functional_tool_views.xml
+++ b/sf_tool_management/views/functional_tool_views.xml
@@ -531,7 +531,7 @@
ref="sf_tool_management.sf_inbound_and_outbound_records_of_functional_tools_view_tree"/>
- [('functional_tool_name', '!=', False)]
+ [('rfid', '!=', ''),('functional_tool_name', '!=', '')]