From c2f15d3f1ab87516fc2b928a2136a74b34890a02 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 16 Apr 2019 09:34:56 +0000 Subject: [PATCH] [FIX] sale: Keep fiscal position from SO Steps to reproduce the bug: - Create two fiscal postions fp1 and fp2 - Create a customer C with fp1 - Create a SO for C and set fp2 - Create an invoice for the SO BUG: The fiscal position of the SO was set to False. Now the fiscal position of the SO is kept when creating an invoice from a SO. opw:1963910 closes odoo/odoo#32713 Signed-off-by: Simon Goffin (sig) --- addons/sale/models/sale.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 9a6b63a7d13..f6539a34173 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -587,7 +587,9 @@ class SaleOrder(models.Model): invoice.compute_taxes() # Idem for partner so_payment_term_id = invoice.payment_term_id.id + fp_invoice = invoice.fiscal_position_id invoice._onchange_partner_id() + invoice.fiscal_position_id = fp_invoice # To keep the payment terms set on the SO invoice.payment_term_id = so_payment_term_id invoice.message_post_with_view('mail.message_origin_link',