From a94b78de1676c0189cc66ea4f76d61a9d7157b31 Mon Sep 17 00:00:00 2001 From: Jigar Vaghela Date: Wed, 4 Aug 2021 13:37:59 +0000 Subject: [PATCH] [FIX] l10n_in: quantity in tax and base grouping key create an issue We need quantity in tax line and we added from this PR https://github.com/odoo/odoo/pull/73402 but after it creates a problem in tax amount because in tax line, the unit price is set base on quantity and by default is 1 but after PR 73402 it's the same as invoice line so rounding issue is there and this rounded amount is multiplay by quantity so this creates a big difference before PR 73402: Name | unit price | quantity | taxable amount | ===================================================== Product A | 5.55 | 8000 | 44400 | (invoice line) Tax 5.0% | 1 | 8000 | 2220 | ``` After PR 73402: Name | unit price | quantity | taxable amount | ===================================================== Product A | 5.55 | 8000 | 44400 | (invoice line) Tax 5.0% | 0.27 | 8000 | 2160 | So in this PR we remove quantity from grouping key closes odoo/odoo#74818 X-original-commit: aa160f4c0a04500bd91eea8da2cec165a15270a6 Signed-off-by: Josse Colpaert --- addons/l10n_in/models/account_invoice.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/addons/l10n_in/models/account_invoice.py b/addons/l10n_in/models/account_invoice.py index 398d027c7ee..90f3115458a 100644 --- a/addons/l10n_in/models/account_invoice.py +++ b/addons/l10n_in/models/account_invoice.py @@ -58,7 +58,6 @@ class AccountMove(models.Model): if tax_line.move_id.journal_id.company_id.account_fiscal_country_id.code == 'IN': res['product_id'] = tax_line.product_id.id res['product_uom_id'] = tax_line.product_uom_id.id - res['quantity'] = tax_line.quantity return res @api.model @@ -68,8 +67,6 @@ class AccountMove(models.Model): if base_line.move_id.journal_id.company_id.account_fiscal_country_id.code == 'IN': res['product_id'] = base_line.product_id.id res['product_uom_id'] = base_line.product_uom_id.id - res['quantity'] = base_line.quantity - res['id'] = base_line.id return res @api.model @@ -80,8 +77,6 @@ class AccountMove(models.Model): tax_key += [ line.product_id.id, line.product_uom_id.id, - line.quantity, - line.id, ] return tax_key