summaryrefslogtreecommitdiff
path: root/addons/purchase_mrp
diff options
context:
space:
mode:
authorRémy Voet (ryv) <ryv@odoo.com>2020-05-08 15:13:21 +0200
committerSimon Lejeune <sle@openerp.com>2020-06-15 16:59:41 +0200
commit421d2d21aa8be0cfa6e8e0b0c7596811796d2e31 (patch)
treea308cbbb9e63d0cc2da4b840de9c8ec63fc0e710 /addons/purchase_mrp
parent182f1b8e26a8c41d8fef2bedca781356d1362dfc (diff)
[FIX] purchase_mrp: fix count MO in case of MTO
task-2241471
Diffstat (limited to 'addons/purchase_mrp')
-rw-r--r--addons/purchase_mrp/models/purchase.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/purchase_mrp/models/purchase.py b/addons/purchase_mrp/models/purchase.py
index cba94b72a07..e2fe9c41951 100644
--- a/addons/purchase_mrp/models/purchase.py
+++ b/addons/purchase_mrp/models/purchase.py
@@ -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',