1优化功能刀具组装单的刀具物料过滤条件,取消功能刀具列表的自动计算库存的方法
This commit is contained in:
@@ -25,7 +25,7 @@ class FunctionalCuttingToolEntity(models.Model):
|
|||||||
tool_loading_length = fields.Float(string='装刀长(mm)', readonly=True)
|
tool_loading_length = fields.Float(string='装刀长(mm)', readonly=True)
|
||||||
functional_tool_length = fields.Float(string='伸出长(mm)', readonly=True)
|
functional_tool_length = fields.Float(string='伸出长(mm)', readonly=True)
|
||||||
effective_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)
|
line_edge_knife_library_num = fields.Integer(string='线边刀库数量', readonly=True)
|
||||||
machine_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)
|
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)
|
current_location_id = fields.Many2one('stock.location', string='当前位置', readonly=True)
|
||||||
image = fields.Binary('图片', readonly=True)
|
image = fields.Binary('图片', readonly=True)
|
||||||
|
|
||||||
@api.depends('current_location_id')
|
# @api.depends('current_location_id')
|
||||||
def _compute_location_num(self):
|
# def _compute_location_num(self):
|
||||||
"""
|
# """
|
||||||
计算库存位置数量
|
# 计算库存位置数量
|
||||||
"""
|
# """
|
||||||
for obj in self:
|
# for obj in self:
|
||||||
if obj.current_location_id.name in ('组装后', '刀具房'):
|
# if obj.current_location_id.name in ('组装后', '刀具房'):
|
||||||
obj.tool_room_num = 1
|
# obj.tool_room_num = 1
|
||||||
obj.line_edge_knife_library_num = 0
|
# obj.line_edge_knife_library_num = 0
|
||||||
obj.machine_knife_library_num = 0
|
# obj.machine_knife_library_num = 0
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _read_group_mrs_cutting_tool_type_id(self, categories, domain, order):
|
def _read_group_mrs_cutting_tool_type_id(self, categories, domain, order):
|
||||||
@@ -491,7 +491,7 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
|||||||
|
|
||||||
class FunctionalToolAssembly(models.Model):
|
class FunctionalToolAssembly(models.Model):
|
||||||
_name = 'sf.functional.tool.assembly'
|
_name = 'sf.functional.tool.assembly'
|
||||||
_description = '功能刀具组装单'
|
_description = '功能刀具组装'
|
||||||
_order = 'use_tool_time asc'
|
_order = 'use_tool_time asc'
|
||||||
|
|
||||||
@api.depends('functional_tool_name')
|
@api.depends('functional_tool_name')
|
||||||
|
|||||||
@@ -183,7 +183,8 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
# 整体式刀具型号
|
# 整体式刀具型号
|
||||||
integral_code_id = fields.Many2one('stock.lot', string='整体式刀具序列号',
|
integral_code_id = fields.Many2one('stock.lot', string='整体式刀具序列号',
|
||||||
domain=[('product_id.cutting_tool_material_id.name', '=', '整体式刀具'),
|
domain=[('product_id.cutting_tool_material_id.name', '=', '整体式刀具'),
|
||||||
('quant_ids.location_id.name', 'in', ['刀具房'])])
|
('quant_ids.location_id.name', 'in', ['刀具房']),
|
||||||
|
('quant_ids.quantity', '>', 0)])
|
||||||
cutting_tool_integral_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='整体式刀具型号',
|
cutting_tool_integral_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='整体式刀具型号',
|
||||||
readonly=True)
|
readonly=True)
|
||||||
integral_name = fields.Char('整体式刀具名称', readonly=True)
|
integral_name = fields.Char('整体式刀具名称', readonly=True)
|
||||||
@@ -192,7 +193,8 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
# 刀片型号
|
# 刀片型号
|
||||||
blade_code_id = fields.Many2one('stock.lot', '刀片序列号',
|
blade_code_id = fields.Many2one('stock.lot', '刀片序列号',
|
||||||
domain=[('product_id.cutting_tool_material_id.name', '=', '刀片'),
|
domain=[('product_id.cutting_tool_material_id.name', '=', '刀片'),
|
||||||
('quant_ids.location_id.name', 'in', ['刀具房'])])
|
('quant_ids.location_id.name', 'in', ['刀具房']),
|
||||||
|
('quant_ids.quantity', '>', 0)])
|
||||||
cutting_tool_blade_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀片型号', readonly=True)
|
cutting_tool_blade_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀片型号', readonly=True)
|
||||||
blade_name = fields.Char('刀片名称', readonly=True)
|
blade_name = fields.Char('刀片名称', readonly=True)
|
||||||
sf_tool_brand_id_2 = fields.Many2one('sf.machine.brand', '刀片品牌', readonly=True)
|
sf_tool_brand_id_2 = fields.Many2one('sf.machine.brand', '刀片品牌', readonly=True)
|
||||||
@@ -200,7 +202,8 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
# 刀杆型号
|
# 刀杆型号
|
||||||
bar_code_id = fields.Many2one('stock.lot', '刀杆序列号',
|
bar_code_id = fields.Many2one('stock.lot', '刀杆序列号',
|
||||||
domain=[('product_id.cutting_tool_material_id.name', '=', '刀杆'),
|
domain=[('product_id.cutting_tool_material_id.name', '=', '刀杆'),
|
||||||
('quant_ids.location_id.name', 'in', ['刀具房'])])
|
('quant_ids.location_id.name', 'in', ['刀具房']),
|
||||||
|
('quant_ids.quantity', '>', 0)])
|
||||||
cutting_tool_cutterbar_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀杆型号',
|
cutting_tool_cutterbar_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀杆型号',
|
||||||
readonly=True)
|
readonly=True)
|
||||||
bar_name = fields.Char('刀杆名称', readonly=True)
|
bar_name = fields.Char('刀杆名称', readonly=True)
|
||||||
@@ -209,7 +212,8 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
# 刀盘型号
|
# 刀盘型号
|
||||||
pad_code_id = fields.Many2one('stock.lot', '刀盘序列号',
|
pad_code_id = fields.Many2one('stock.lot', '刀盘序列号',
|
||||||
domain=[('product_id.cutting_tool_material_id.name', '=', '刀盘'),
|
domain=[('product_id.cutting_tool_material_id.name', '=', '刀盘'),
|
||||||
('quant_ids.location_id.name', 'in', ['刀具房'])])
|
('quant_ids.location_id.name', 'in', ['刀具房']),
|
||||||
|
('quant_ids.quantity', '>', 0)])
|
||||||
cutting_tool_cutterpad_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀盘型号',
|
cutting_tool_cutterpad_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀盘型号',
|
||||||
readonly=True)
|
readonly=True)
|
||||||
pad_name = fields.Char('刀盘名称', readonly=True)
|
pad_name = fields.Char('刀盘名称', readonly=True)
|
||||||
@@ -218,7 +222,8 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
# 刀柄型号
|
# 刀柄型号
|
||||||
handle_code_id = fields.Many2one('stock.lot', '刀柄序列号', required=True,
|
handle_code_id = fields.Many2one('stock.lot', '刀柄序列号', required=True,
|
||||||
domain=[('product_id.cutting_tool_material_id.name', '=', '刀柄'),
|
domain=[('product_id.cutting_tool_material_id.name', '=', '刀柄'),
|
||||||
('quant_ids.location_id.name', 'in', ['刀具房'])])
|
('quant_ids.location_id.name', 'in', ['刀具房']),
|
||||||
|
('quant_ids.quantity', '>', 0)])
|
||||||
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀柄型号',
|
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀柄型号',
|
||||||
readonly=True)
|
readonly=True)
|
||||||
handle_name = fields.Char('刀柄名称', readonly=True)
|
handle_name = fields.Char('刀柄名称', readonly=True)
|
||||||
@@ -227,7 +232,8 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
# 夹头型号
|
# 夹头型号
|
||||||
chuck_code_id = fields.Many2one('stock.lot', '夹头序列号', required=True,
|
chuck_code_id = fields.Many2one('stock.lot', '夹头序列号', required=True,
|
||||||
domain=[('product_id.cutting_tool_material_id.name', '=', '夹头'),
|
domain=[('product_id.cutting_tool_material_id.name', '=', '夹头'),
|
||||||
('quant_ids.location_id.name', 'in', ['刀具房'])])
|
('quant_ids.location_id.name', 'in', ['刀具房']),
|
||||||
|
('quant_ids.quantity', '>', 0)])
|
||||||
cutting_tool_cutterhead_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='夹头型号',
|
cutting_tool_cutterhead_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='夹头型号',
|
||||||
readonly=True)
|
readonly=True)
|
||||||
chuck_name = fields.Char('夹头名称', readonly=True, compute='_compute_auto_fill')
|
chuck_name = fields.Char('夹头名称', readonly=True, compute='_compute_auto_fill')
|
||||||
|
|||||||
Reference in New Issue
Block a user