|
|
""" If the manufacturing order contains some done move (via an intermediate
post inventory), the user has to confirm the cancellation.
TODO remove in master: field still computed for poeple with the template not updated
"""
domain = [
('state', '=', 'done'),
'|',
('production_id', 'in', self.ids),
('raw_material_production_id', 'in', self.ids)
]
res = self.env['stock.move']._read_group(domain, ['production_id', 'raw_material_production_id'])
self.confirm_cancel = False
for production, raw_material_production in res:
production_record = production or raw_material_production
production_record.confirm_cancel = True
|
|