Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/优化制造功能

This commit is contained in:
mgw
2024-08-27 08:56:13 +08:00
2 changed files with 12 additions and 2 deletions

View File

@@ -123,7 +123,12 @@ class MrpProduction(models.Model):
# 上传零件图纸 # 上传零件图纸
part_drawing = fields.Binary('零件图纸') part_drawing = fields.Binary('零件图纸')
manual_quotation = fields.Boolean('人工编程', default=False, readonly=True) @api.depends('product_id.manual_quotation')
def _compute_manual_quotation(self):
for item in self:
item.manual_quotation = item.product_id.manual_quotation
manual_quotation = fields.Boolean('人工编程', default=False, compute=_compute_manual_quotation)
is_scrap = fields.Boolean('是否报废', default=False) is_scrap = fields.Boolean('是否报废', default=False)
is_remanufacture = fields.Boolean('是否重新制造', default=False) is_remanufacture = fields.Boolean('是否重新制造', default=False)

View File

@@ -60,7 +60,12 @@ class ResMrpWorkOrder(models.Model):
default='pending', copy=False, readonly=True, recursive=True, index=True, tracking=True) default='pending', copy=False, readonly=True, recursive=True, index=True, tracking=True)
# state = fields.Selection(selection_add=[('to be detected', "待检测"), ('rework', '返工')], tracking=True) # state = fields.Selection(selection_add=[('to be detected', "待检测"), ('rework', '返工')], tracking=True)
manual_quotation = fields.Boolean('人工编程', default=False, readonly=True) @api.depends('production_id.manual_quotation')
def _compute_manual_quotation(self):
for item in self:
item.manual_quotation = item.production_id.manual_quotation
manual_quotation = fields.Boolean('人工编程', default=False, compute=_compute_manual_quotation)
def _compute_working_users(self): def _compute_working_users(self):
super()._compute_working_users() super()._compute_working_users()