From ff63a123af35f5d4a6171e74b46fd39bd92e72cc Mon Sep 17 00:00:00 2001 From: Arnold Moyaux Date: Tue, 5 Mar 2019 08:56:25 +0000 Subject: [PATCH] [FIX] stock, purchase_stock: useless parent method commit c914df5a369eb49e4e72a698c0811200b5825f22 introduced procurement refactoring and a function _make_po_get_domain that is responsible to forge a domain in order to find an existing PO that could append the po line created by the procurement. However the function is defined in stock and overriden in purchase_stock, purchase_requisition_stock, mrp_mps(oe). All the module depends of purchase_stock and the method in stock only return an empty tuple. So the method in stock could be removed and the method in purchase_stock could become the new parent. closes odoo/odoo#31580 Signed-off-by: "Simon Lejeune (sle)" --- addons/purchase_stock/models/stock_rule.py | 3 +-- addons/stock/models/stock_rule.py | 3 --- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/addons/purchase_stock/models/stock_rule.py b/addons/purchase_stock/models/stock_rule.py index 5059aa2cf24..64a72467b11 100644 --- a/addons/purchase_stock/models/stock_rule.py +++ b/addons/purchase_stock/models/stock_rule.py @@ -276,12 +276,11 @@ class StockRule(models.Model): } def _make_po_get_domain(self, company_id, values, partner): - domain = super(StockRule, self)._make_po_get_domain(company_id, values, partner) gpo = self.group_propagation_option group = (gpo == 'fixed' and self.group_id) or \ (gpo == 'propagate' and 'group_id' in values and values['group_id']) or False - domain += ( + domain = ( ('partner_id', '=', partner.id), ('state', '=', 'draft'), ('picking_type_id', '=', self.picking_type_id.id), diff --git a/addons/stock/models/stock_rule.py b/addons/stock/models/stock_rule.py index 0571cc88ef4..96374d4830a 100644 --- a/addons/stock/models/stock_rule.py +++ b/addons/stock/models/stock_rule.py @@ -253,9 +253,6 @@ class StockRule(models.Model): 'res_model_id': self.env.ref('product.model_product_template').id, }) - def _make_po_get_domain(self, company_id, values, partner): - return () - class ProcurementGroup(models.Model): """