From b1dfc270bd15d6df6f3c59103dcd3256ccbeab5b Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Thu, 22 Jan 2015 12:03:12 +0100 Subject: [PATCH] do not discard the owner in chained move This addresses odoo/odoo#4839, and makes the related fix in the core work with this module as well. --- sale_owner_stock_sourcing/model/procurement.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sale_owner_stock_sourcing/model/procurement.py b/sale_owner_stock_sourcing/model/procurement.py index bd6d8e54be7..4dc1c59838a 100644 --- a/sale_owner_stock_sourcing/model/procurement.py +++ b/sale_owner_stock_sourcing/model/procurement.py @@ -29,5 +29,7 @@ def _run_move_create(self, procurement): """ res = super(Procurement, self)._run_move_create(procurement) - res['restrict_partner_id'] = procurement.sale_line_id.stock_owner_id.id + sale_line = procurement.sale_line_id + if sale_line: + res['restrict_partner_id'] = sale_line.stock_owner_id.id return res