account_tax_obj = self.pool.get('account.tax')
cur_obj = self.pool.get('res.currency')
for line in self.browse(cr, uid, ids, context=context):
- taxes_ids = filter(lambda t: t.company_id.id == line.order_id.company_id.id, line.product_id.taxes_id)
+ taxes_ids = [ tax for tax in line.product_id.taxes_id if tax.company_id.id == line.order_id.company_id.id ]
price = line.price_unit * (1 - (line.discount or 0.0) / 100.0)
taxes = account_tax_obj.compute_all(cr, uid, taxes_ids, price, line.qty, product=line.product_id, partner=line.order_id.partner_id or False)
account_collected_id: account.iva
price_include: 0
-
- I assign this 5 percent tax on the PC2 product as a sale tax
+ I will create a second VAT tax of 5% but this time for a child company, to
+ ensure that only product taxes of the current session's company are considered
+ (this tax should be ignore when computing order's taxes in following tests)
+-
+ !record {model: account.tax, id: account_tax_05_incl_chicago}:
+ name: VAT 05 perc Excl (US)
+ type: percent
+ amount: 0.05
+ account_paid_id: account.iva
+ account_collected_id: account.iva
+ price_include: 0
+ company_id: stock.res_company_1
+-
+ I assign those 5 percent taxes on the PC2 product as a sale taxes
-
!record {model: product.product, id: product.product_product_pc2}:
- taxes_id: [account_tax_05_incl]
+ taxes_id: [account_tax_05_incl, account_tax_05_incl_chicago]
-
I create a PoS order with 2 units of PC1 at 450 EUR (Tax Incl) and 3 units of PC2 at 300 EUR. (Tax Excl)
-