From c04119fc4f32b0f5173a5e4023ad5e77600cb669 Mon Sep 17 00:00:00 2001 From: Arnold Moyaux Date: Tue, 10 Apr 2018 14:25:20 +0200 Subject: [PATCH] [FIX] purchase : be able to use it with MPS Since procurement group is passed by the optional values in the procurement proccess it should be considered as optional MPS do not use procurement group because they will add the planification in an existing RFQ it will fail because purchase search for the key 'group_id' in values opw-1833060 --- addons/purchase/models/purchase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index dc8fdb862b9..6c1700c177c 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -1016,7 +1016,7 @@ class ProcurementRule(models.Model): gpo = self.group_propagation_option group = (gpo == 'fixed' and self.group_id.id) or \ - (gpo == 'propagate' and values['group_id'].id) or False + (gpo == 'propagate' and 'group_id' in values and values['group_id'].id) or False return { 'partner_id': partner.id, @@ -1041,7 +1041,7 @@ class ProcurementRule(models.Model): domain = super(ProcurementRule, self)._make_po_get_domain(values, partner) gpo = self.group_propagation_option group = (gpo == 'fixed' and self.group_id) or \ - (gpo == 'propagate' and values['group_id']) or False + (gpo == 'propagate' and 'group_id' in values and values['group_id']) or False domain += ( ('partner_id', '=', partner.id),