Skip to content
Snippets Groups Projects
Commit 421d2d21 authored by Rémy Voet (ryv)'s avatar Rémy Voet (ryv) Committed by Simon Lejeune
Browse files

[FIX] purchase_mrp: fix count MO in case of MTO

task-2241471
parent 182f1b8e
No related branches found
No related tags found
No related merge requests found
......@@ -15,11 +15,12 @@ class PurchaseOrder(models.Model):
@api.depends('order_line.move_dest_ids.group_id.mrp_production_ids')
def _compute_mrp_production_count(self):
for purchase in self:
purchase.mrp_production_count = len(purchase.order_line.move_dest_ids.group_id.mrp_production_ids)
purchase.mrp_production_count = len(purchase.order_line.move_dest_ids.group_id.mrp_production_ids |
purchase.order_line.move_ids.move_dest_ids.group_id.mrp_production_ids)
def action_view_mrp_productions(self):
self.ensure_one()
mrp_production_ids = self.order_line.move_dest_ids.group_id.mrp_production_ids.ids
mrp_production_ids = (self.order_line.move_dest_ids.group_id.mrp_production_ids | self.order_line.move_ids.move_dest_ids.group_id.mrp_production_ids).ids
action = {
'res_model': 'mrp.production',
'type': 'ir.actions.act_window',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment