diff --git a/addons/sale/sale.py b/addons/sale/sale.py index da75b51eba4..a0ccaf86361 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -1078,7 +1078,7 @@ class sale_order_line(osv.osv): date_order=order['date_order'], fiscal_position=order['fiscal_position'][0] if order['fiscal_position'] else False, flag=False, # Force name update - context=context + context=dict(context, company_id=values.get('company_id')) )['value'] if defaults.get('tax_id'): defaults['tax_id'] = [[6, 0, defaults['tax_id']]] @@ -1134,8 +1134,9 @@ class sale_order_line(osv.osv): # The superuser is used by website_sale in order to create a sale order. We need to make # sure we only select the taxes related to the company of the partner. This should only # apply if the partner is linked to a company. - if uid == SUPERUSER_ID and partner.company_id: - taxes = product_obj.taxes_id.filtered(lambda r: r.company_id == partner.company_id) + if uid == SUPERUSER_ID and context.get('company_id'): + print 'company_id found', context['company_id'] + taxes = product_obj.taxes_id.filtered(lambda r: r.company_id.id == context['company_id']) else: taxes = product_obj.taxes_id result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes) diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index 7a0925e990a..93df0e5f714 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -123,17 +123,17 @@