1、优化功能刀具拆解单拆解原因为更换其他刀具时的扫码录入刀具物料货位信息功能;2、优化功能刀具拆解单确认拆解后的刀具物料拆解流程,及其刀具物料功能刀具的数量统计等;3、功能刀具拆解、功能刀具模块添加动作过滤已拆解状态的记录,并添加筛选方法;4、功能刀具组装流程添加刀具物料货位数量校验;

This commit is contained in:
yuxianghui
2024-04-23 14:15:45 +08:00
parent 080a3d7175
commit 8bc23f5136
8 changed files with 114 additions and 60 deletions

View File

@@ -45,7 +45,7 @@ class FunctionalCuttingToolEntity(models.Model):
active = fields.Boolean(string='已归档', default=True)
@api.depends('barcode_id.quant_ids')
@api.depends('barcode_id.quant_ids', 'functional_tool_status')
def _compute_current_location_id(self):
for record in self:
if record.barcode_id.quant_ids:
@@ -61,6 +61,12 @@ class FunctionalCuttingToolEntity(models.Model):
else:
record.current_location_id = False
record.current_location = False
if record.functional_tool_status == '已拆除':
record.current_location_id = False
record.current_location = False
record.tool_room_num = 0
record.line_edge_knife_library_num = 0
record.machine_knife_library_num = 0
def get_location_num(self):
"""
@@ -185,7 +191,8 @@ class FunctionalCuttingToolEntity(models.Model):
stock_location_id = self.env['stock.location'].search([('name', '=', '制造前')])
# 创建功能刀具该批次/序列号 库存移动和移动历史
self.barcode_id.create_stock_quant(location_inventory_id, stock_location_id,
self.functional_tool_name_id.id, '机床装刀', self.functional_tool_name_id)
self.functional_tool_name_id.id, '机床装刀', self.functional_tool_name_id,
self.functional_tool_name_id.tool_groups_id)
# ==========刀具组接口==========
# def _register_functional_tool_groups(self, obj):