[REV] mrp: create productivity line before modifying workorder
Reverts https://github.com/odoo/odoo/pull/110666 because of breaking behaviour introduced in https://github.com/odoo/enterprise/pull/35696 - Install quality_mrp_workorder - Manufacturing > Config > Create 2 workcenters: WC1 and WC2 - Products > New Product > Name: P, type: Storable, Routes: Manufacture - Manufacturing > BoMs > Create > Product: P, Operations Tab, add 2 lines: - 1. operation: OP1, Work Center: WC1, Save - 2. operation: OP2, Work center: WC2, Save - Manual Save BoM, don't exit - Components Tab, unlock column Consumend in Operation, add 2 lines: - 1. Product: P1, Create and edit > type: Storable - 2. Product: P2, Create and edit > type: Storable - Both lines, quantity: 2. - Each line, Consumed in operations: OP1 and OP2 - Save and exit - Operations > Manufacturing orders > New > Product: P, Quantity: 2 > Confirm - Workorder Tab > open first line tablet view: Quantity = 2.00/2.00 Units > Validate - open second line tablet view: Quantity = 0.00/2.00 Units (!) closes odoo/odoo#113574 Issue: The recommended quantity should also be 2.00/2.00 X-original-commit: 67774c967b587a660be032712b7a2369ed7abc3a Related: odoo/enterprise#37500 Signed-off-by: Tiffany Chang <tic@odoo.com> Signed-off-by: Stefan-Calin Crainiciuc (stcc) <stcc@odoo.com>
This commit is contained in:
@@ -615,16 +615,16 @@ class MrpWorkorder(models.Model):
|
||||
if self.state in ('done', 'cancel'):
|
||||
return True
|
||||
|
||||
if self._should_start_timer():
|
||||
self.env['mrp.workcenter.productivity'].create(
|
||||
self._prepare_timeline_vals(self.duration, datetime.now())
|
||||
)
|
||||
|
||||
if self.product_tracking == 'serial':
|
||||
self.qty_producing = 1.0
|
||||
elif self.qty_producing == 0:
|
||||
self.qty_producing = self.qty_remaining
|
||||
|
||||
if self._should_start_timer():
|
||||
self.env['mrp.workcenter.productivity'].create(
|
||||
self._prepare_timeline_vals(self.duration, datetime.now())
|
||||
)
|
||||
|
||||
if self.production_id.state != 'progress':
|
||||
self.production_id.write({
|
||||
'date_start': datetime.now(),
|
||||
|
||||
Reference in New Issue
Block a user