[FIX] website_sale: apply tax position on checkout signup
bzr revid: chm@openerp.com-20140505092300-l29tc4pum31nqd1h
This commit is contained in:
parent
1a9f3165ce
commit
9e176a977e
|
@ -644,6 +644,7 @@ class sale_order(osv.osv):
|
|||
if line[2].get('product_id'):
|
||||
taxes_id = product_obj.browse(cr, uid, line[2]['product_id'], context=context).taxes_id
|
||||
elif line[1]:
|
||||
# don't change taxes if they are no product defined
|
||||
taxes_id = line_obj.browse(cr, uid, line[1], context=context).product_id.taxes_id
|
||||
if taxes_id:
|
||||
line[2]['tax_id'] = [[6, 0, fiscal_obj.map_tax(cr, uid, fpos, taxes_id)]]
|
||||
|
|
|
@ -177,6 +177,10 @@ class website(orm.Model):
|
|||
fiscal_position = sale_order.fiscal_position and sale_order.fiscal_position.id or False
|
||||
|
||||
values = sale_order_obj.onchange_partner_id(cr, SUPERUSER_ID, [sale_order_id], partner.id, context=context)['value']
|
||||
order_lines = map(int,sale_order.order_line)
|
||||
values.update(sale_order_obj.onchange_fiscal_position(cr, SUPERUSER_ID, [],
|
||||
values['fiscal_position'], [[6, 0, order_lines]], context=context)['value'])
|
||||
|
||||
values['partner_id'] = partner.id
|
||||
sale_order_obj.write(cr, SUPERUSER_ID, [sale_order_id], values, context=context)
|
||||
|
||||
|
|
Loading…
Reference in New Issue