[FIX] purchase_mrp: fix count MO in case of MTO
task-2241471
This commit is contained in:
committed by
Simon Lejeune
parent
182f1b8e26
commit
421d2d21aa
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user