From b2939537d97624122bddfecaadb2490d2f4c477c Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 25 Nov 2015 13:42:27 +0100 Subject: [PATCH] [FIX] website_quote: using a quotation template with a fiscal position When creating a SO with a quotation template, the lines created with the quotation template must take into account the fiscal position set on the SO to compute the right taxes. opw:657015 --- addons/website_quote/models/order.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/website_quote/models/order.py b/addons/website_quote/models/order.py index c21b930dceb..cda5d83e275 100644 --- a/addons/website_quote/models/order.py +++ b/addons/website_quote/models/order.py @@ -204,7 +204,8 @@ class sale_order(osv.osv): if 'tax_id' in data: data['tax_id'] = [(6, 0, data['tax_id'])] else: - taxes = line.product_id.product_tmpl_id.taxes_id.ids + fpos = (fiscal_position_id and self.pool['account.fiscal.position'].browse(cr, uid, fiscal_position_id)) or False + taxes = fpos.map_tax(line.product_id.product_tmpl_id.taxes_id).ids if fpos else line.product_id.product_tmpl_id.taxes_id.ids data['tax_id'] = [(6, 0, taxes)] data.update({ 'name': line.name,