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