1优化功能刀具组装单的刀具物料过滤条件,取消功能刀具列表的自动计算库存的方法
This commit is contained in:
@@ -25,7 +25,7 @@ class FunctionalCuttingToolEntity(models.Model):
|
||||
tool_loading_length = fields.Float(string='装刀长(mm)', readonly=True)
|
||||
functional_tool_length = fields.Float(string='伸出长(mm)', readonly=True)
|
||||
effective_length = fields.Float(string='有效长(mm)', readonly=True)
|
||||
tool_room_num = fields.Integer(string='刀具房数量', readonly=True, compute='_compute_location_num')
|
||||
tool_room_num = fields.Integer(string='刀具房数量', readonly=True)
|
||||
line_edge_knife_library_num = fields.Integer(string='线边刀库数量', readonly=True)
|
||||
machine_knife_library_num = fields.Integer(string='机内刀库数量', readonly=True)
|
||||
max_lifetime_value = fields.Integer(string='最大寿命值(min)', readonly=True)
|
||||
@@ -36,16 +36,16 @@ class FunctionalCuttingToolEntity(models.Model):
|
||||
current_location_id = fields.Many2one('stock.location', string='当前位置', readonly=True)
|
||||
image = fields.Binary('图片', readonly=True)
|
||||
|
||||
@api.depends('current_location_id')
|
||||
def _compute_location_num(self):
|
||||
"""
|
||||
计算库存位置数量
|
||||
"""
|
||||
for obj in self:
|
||||
if obj.current_location_id.name in ('组装后', '刀具房'):
|
||||
obj.tool_room_num = 1
|
||||
obj.line_edge_knife_library_num = 0
|
||||
obj.machine_knife_library_num = 0
|
||||
# @api.depends('current_location_id')
|
||||
# def _compute_location_num(self):
|
||||
# """
|
||||
# 计算库存位置数量
|
||||
# """
|
||||
# for obj in self:
|
||||
# if obj.current_location_id.name in ('组装后', '刀具房'):
|
||||
# obj.tool_room_num = 1
|
||||
# obj.line_edge_knife_library_num = 0
|
||||
# obj.machine_knife_library_num = 0
|
||||
|
||||
@api.model
|
||||
def _read_group_mrs_cutting_tool_type_id(self, categories, domain, order):
|
||||
@@ -491,7 +491,7 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
||||
|
||||
class FunctionalToolAssembly(models.Model):
|
||||
_name = 'sf.functional.tool.assembly'
|
||||
_description = '功能刀具组装单'
|
||||
_description = '功能刀具组装'
|
||||
_order = 'use_tool_time asc'
|
||||
|
||||
@api.depends('functional_tool_name')
|
||||
|
||||
Reference in New Issue
Block a user