[FIX] purchase: taxes_id in PO line
When a PO line is created from procurement, the supplier taxes set on the PO line must be visible in the company set on the procurement. opw:666875
This commit is contained in:
@@ -1449,6 +1449,8 @@ class procurement_order(osv.osv):
|
|||||||
names_dict[id] = name
|
names_dict[id] = name
|
||||||
for procurement in procurements:
|
for procurement in procurements:
|
||||||
taxes_ids = procurement.product_id.supplier_taxes_id
|
taxes_ids = procurement.product_id.supplier_taxes_id
|
||||||
|
companies = self.pool['res.company'].search(cr, uid, [('id', 'child_of', procurement.company_id.id)])
|
||||||
|
taxes_ids = taxes_ids.filtered(lambda x: x.company_id.id in companies)
|
||||||
# It is necessary to have the appropriate fiscal position to get the right tax mapping
|
# 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=context)
|
||||||
if fp:
|
if fp:
|
||||||
|
|||||||
Reference in New Issue
Block a user