增加自动化产线的零件供货路线初始化为自动化产线加工
This commit is contained in:
@@ -22,6 +22,9 @@ class SaleOrder(models.Model):
|
||||
|
||||
def confirm_to_supply_method(self):
|
||||
self.state = 'supply method'
|
||||
for line in self.order_line:
|
||||
if line.product_id.auto_machining:
|
||||
line.supply_method = 'automation'
|
||||
|
||||
def action_confirm(self):
|
||||
if self._get_forbidden_state_confirm() & set(self.mapped('state')):
|
||||
@@ -192,14 +195,12 @@ class SaleOrderLine(models.Model):
|
||||
return super(SaleOrderLine, self).write(vals)
|
||||
|
||||
cancel_auto_machining = fields.Boolean('是否取消自动化加工', compute='_compute_cancel_auto_machining', store=True)
|
||||
cancel_auto_machining_reason = fields.Char('非自动化加工原因')
|
||||
cancel_auto_machining_reason = fields.Char('更改供货原因')
|
||||
|
||||
@api.depends('product_id', 'supply_method')
|
||||
def _compute_cancel_auto_machining(self):
|
||||
for line in self:
|
||||
line.cancel_auto_machining = True if line.product_id.auto_machining \
|
||||
and line.supply_method != 'automation' else False
|
||||
|
||||
@api.onchange('product_id')
|
||||
def _onchange_product_id_set_supply_method(self):
|
||||
if self.product_id.auto_machining:
|
||||
self.supply_method = 'automation'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user