1、优化刀具采购入库,入库时自动生成批次号;2、优化货位看板
This commit is contained in:
@@ -105,18 +105,13 @@ class ResProductMo(models.Model):
|
||||
'压紧方式', domain=[('type', '=', '压紧方式')])
|
||||
|
||||
name = fields.Char('产品名称', compute='_compute_tool_name', store=True, required=False)
|
||||
default_code = fields.Char('内部参考', compute='_onchange_tool_default_code', store=True)
|
||||
|
||||
@api.depends('cutting_tool_model_id', 'specification_id')
|
||||
@api.depends('categ_id', 'cutting_tool_material_id', 'cutting_tool_model_id', 'specification_id')
|
||||
def _compute_tool_name(self):
|
||||
for item in self:
|
||||
if item.cutting_tool_model_id and item.specification_id:
|
||||
name = '%s%s' % (item.cutting_tool_model_id.name, item.specification_id.name)
|
||||
item.name = name
|
||||
|
||||
@api.depends('categ_id', 'cutting_tool_material_id', 'cutting_tool_model_id')
|
||||
def _onchange_tool_default_code(self):
|
||||
for item in self:
|
||||
if item.categ_id and item.cutting_tool_material_id and item.cutting_tool_model_id:
|
||||
if item.cutting_tool_model_id.code:
|
||||
default_code = '%s-T-DJWL-%s' % (
|
||||
|
||||
Reference in New Issue
Block a user