Skip to content
Snippets Groups Projects
Commit c2f15d3f authored by Goffin Simon's avatar Goffin Simon
Browse files

[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: default avatarSimon Goffin (sig) <sig@openerp.com>
parent 7bf25cc3
Branches
Tags
No related merge requests found
......@@ -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',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment