[MERGE] forward port of branch 8.0 up to 746cda7
This commit is contained in:
@@ -433,7 +433,7 @@ class purchase_order(osv.osv):
|
||||
'payment_term_id': False,
|
||||
}}
|
||||
|
||||
company_id = self.pool.get('res.users')._get_company(cr, uid, context=context)
|
||||
company_id = context.get('company_id') or self.pool.get('res.users')._get_company(cr, uid, context=context)
|
||||
if not company_id:
|
||||
raise osv.except_osv(_('Error!'), _('There is no default company for the current user!'))
|
||||
fp = self.pool['account.fiscal.position'].get_fiscal_position(cr, uid, company_id, partner_id, context=context)
|
||||
@@ -1476,7 +1476,7 @@ class procurement_order(osv.osv):
|
||||
taxes_ids = procurement.product_id.supplier_taxes_id
|
||||
taxes_ids = taxes_ids.filtered(lambda x: x.company_id.id == procurement.company_id.id)
|
||||
# It is necessary to have the appropriate fiscal position to get the right tax mapping
|
||||
fp = acc_pos_obj.get_fiscal_position(cr, uid, None, partner.id, context=context)
|
||||
fp = acc_pos_obj.get_fiscal_position(cr, uid, None, partner.id, context=dict(context, company_id=procurement.company_id.id))
|
||||
if fp:
|
||||
fp = acc_pos_obj.browse(cr, uid, fp, context=context)
|
||||
taxes = acc_pos_obj.map_tax(cr, uid, fp, taxes_ids, context=context)
|
||||
@@ -1680,7 +1680,7 @@ class procurement_order(osv.osv):
|
||||
name = seq_obj.next_by_code(cr, uid, 'purchase.order', context=context) or _('PO: %s') % procurement.name
|
||||
gpo = procurement.rule_id.group_propagation_option
|
||||
group = (gpo == 'fixed' and procurement.rule_id.group_id.id) or (gpo == 'propagate' and procurement.group_id.id) or False
|
||||
fp = acc_pos_obj.get_fiscal_position(cr, uid, None, partner.id, context=context)
|
||||
fp = acc_pos_obj.get_fiscal_position(cr, uid, None, partner.id, context=dict(context or {}, company_id=procurement.company_id.id))
|
||||
po_vals = {
|
||||
'name': name,
|
||||
'origin': procurement.origin,
|
||||
|
||||
Reference in New Issue
Block a user