[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
This commit is contained in:
Goffin Simon
2015-11-25 14:31:22 +01:00
parent 83f56a30a6
commit b2939537d9
+2 -1
View File
@@ -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,