[FIX] mrp: fix start workorder
Commit https://github.com/odoo/odoo/pull/110550/commits/b347675c36cc5c3f54bf64f2e295d0afe9196be8 merges mo/wo scheduled & effective dates. Later commit https://github.com/odoo/odoo/pull/128043/commits/62590fa7d742267421a42cbf654352cd5b7e048c for 15.0 fixes the mo start date. Unfortunately, forward ports breaks 16.4 & later: starting a workorder unplan the subsequent ones. closes odoo/odoo#157373 X-original-commit: 36e4a0c5f6b572f27fbfee5c3aa5fe291a6e76c3 Signed-off-by: William Henrotin (whe) <whe@odoo.com> Signed-off-by: Jean-Francois Aubert (ajf) <ajf@odoo.com>
This commit is contained in:
@@ -592,11 +592,6 @@ class MrpWorkorder(models.Model):
|
||||
if wo.state in ('done', 'cancel'):
|
||||
continue
|
||||
|
||||
if wo.production_id.state != 'progress':
|
||||
wo.production_id.write({
|
||||
'date_start': fields.Datetime.now()
|
||||
})
|
||||
|
||||
if wo.product_tracking == 'serial' and wo.qty_producing == 0:
|
||||
wo.qty_producing = 1.0
|
||||
elif wo.qty_producing == 0:
|
||||
@@ -607,6 +602,11 @@ class MrpWorkorder(models.Model):
|
||||
wo._prepare_timeline_vals(wo.duration, fields.Datetime.now())
|
||||
)
|
||||
|
||||
if wo.production_id.state != 'progress':
|
||||
wo.production_id.write({
|
||||
'date_start': fields.Datetime.now()
|
||||
})
|
||||
|
||||
if wo.state == 'progress':
|
||||
continue
|
||||
date_start = fields.Datetime.now()
|
||||
|
||||
Reference in New Issue
Block a user