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_scrap_move_count

Inputs Method Outputs
  • id
data = self.env['stock.scrap']._read_group([('production_id', 'in', self.ids)], ['production_id'], ['__count'])
count_data = {production.id: count for production, count in data}
for production in self:
            production.scrap_count = count_data.get(production.id, 0)

Back to entity