Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Manufacturing

Entity: mrp.production

Compute Method: _compute_confirm_cancel

Inputs Method Outputs
""" 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

Back to entity