From 0b18fa884b73101bc6dcd1713c37f9f8674488cd Mon Sep 17 00:00:00 2001 From: Antoine Boonen Date: Wed, 19 Jul 2023 13:08:03 +0000 Subject: [PATCH] [FIX] l10n_in: Fix python compute taxes. Problem --------- During the conversion from XML to CSV, some python taxes were broken. Objective --------- The task consist in checking all python taxes and ensures it's working. Solution --------- Problem appears to be that the migration script from XML to CSV, removed the '\n' in the python compute code, making things like `result=base_amount * 0.21tax=quantity * 4.17` appear. The solution consists in separating the operations using semi-colons and a ternary operator to execute the if statement. The goal was to keep the operations in a single line to avoid added escape caracters. task-3319164 closes odoo/odoo#130792 X-original-commit: 2beea5f14a3886c5da9e81ccb8797141e7d7a186 Signed-off-by: Quentin De Paoli Signed-off-by: Antoine Boonen (aboo) --- addons/l10n_in/data/template/account.tax-in.csv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/l10n_in/data/template/account.tax-in.csv b/addons/l10n_in/data/template/account.tax-in.csv index 5db168ef477..e8c0c6cae19 100644 --- a/addons/l10n_in/data/template/account.tax-in.csv +++ b/addons/l10n_in/data/template/account.tax-in.csv @@ -360,7 +360,7 @@ "","","","","","","","","","","","","","","","","","base","refund","","l10n_in.tax_tag_base_cess" "","","","","","","","","","","","","","","","","","tax","refund","p10055","l10n_in.tax_tag_cess" "cess_5_plus_1591_sale","5%+1.591 CESS S","CESS 5%+1.591","CESS 5%+1.591","sale","group","0.0","","","cess_group","","","cess_sale_5,cess_sale_1591","","","","","","","","" -"cess_21_4170_higer_sale","21% or 4.170 CESS S","CESS 21% or 4.170","CESS 21% or 4.170","sale","code","0.0","","","cess_group","","","","result=base_amount * 0.21tax=quantity * 4.17if tax > result:result=tax","","","","base","invoice","","l10n_in.tax_tag_base_cess" +"cess_21_4170_higer_sale","21% or 4.170 CESS S","CESS 21% or 4.170","CESS 21% or 4.170","sale","code","0.0","","","cess_group","","","","result=base_amount * 0.21; tax=quantity * 4.17; result = tax if (tax > result) else result;","","","","base","invoice","","l10n_in.tax_tag_base_cess" "","","","","","","","","","","","","","","","","","tax","invoice","p11235","l10n_in.tax_tag_cess" "","","","","","","","","","","","","","","","","","base","refund","","l10n_in.tax_tag_base_cess" "","","","","","","","","","","","","","","","","","tax","refund","p10055","l10n_in.tax_tag_cess" @@ -467,7 +467,7 @@ "","","","","","","","","","","","","","","","","","base","refund","","l10n_in.tax_tag_base_cess" "","","","","","","","","","","","","","","","","","tax","refund","p11235","l10n_in.tax_tag_cess" "cess_5_plus_1591_purchase","5%+1.591 CESS P","CESS 5%+1.591","CESS 5%+1.591","purchase","group","0.0","","","cess_group","","","cess_purchase_5,cess_purchase_1591","","","","","","","","" -"cess_21_4170_higer_purchase","21% or 4.170 CESS P","CESS 21% or 4.170","CESS 21% or 4.170","purchase","code","0.0","","","cess_group","","","","result=base_amount * 0.21tax=quantity * 4.17if tax > result:result=tax","","","","base","invoice","","l10n_in.tax_tag_base_cess" +"cess_21_4170_higer_purchase","21% or 4.170 CESS P","CESS 21% or 4.170","CESS 21% or 4.170","purchase","code","0.0","","","cess_group","","","","result=base_amount * 0.21; tax=quantity * 4.17; result = tax if (tax > result) else result;","","","","base","invoice","","l10n_in.tax_tag_base_cess" "","","","","","","","","","","","","","","","","","tax","invoice","p10055","l10n_in.tax_tag_cess" "","","","","","","","","","","","","","","","","","base","refund","","l10n_in.tax_tag_base_cess" "","","","","","","","","","","","","","","","","","tax","refund","p11235","l10n_in.tax_tag_cess" @@ -574,7 +574,7 @@ "","","","","","","","","","","","","","","","","","tax","refund","p10057","" "","","","","","","","","","","","","","","","","-100","tax","refund","p10055","l10n_in.tax_tag_cess_rc" "cess_5_plus_1591_purchase_rc","5%+1.591 CESS RC","CESS 5%+1.591","CESS 5%+1.591","purchase","group","0.0","","","cess_group","","","cess_purchase_5_rc,cess_purchase_1591_rc","","","True","","","","","" -"cess_21_4170_higer_purchase_rc","21% or 4.170 CESS RC","CESS 21% or 4.170","CESS 21% or 4.170","purchase","code","0.0","","","cess_group","","","","result=base_amount * 0.21tax=quantity * 4.17if tax > result:result=tax","","True","","base","invoice","","l10n_in.tax_tag_base_cess_rc" +"cess_21_4170_higer_purchase_rc","21% or 4.170 CESS RC","CESS 21% or 4.170","CESS 21% or 4.170","purchase","code","0.0","","","cess_group","","","","result=base_amount * 0.21; tax=quantity * 4.17; result = tax if (tax > result) else result;","","True","","base","invoice","","l10n_in.tax_tag_base_cess_rc" "","","","","","","","","","","","","","","","","","tax","invoice","p10057","" "","","","","","","","","","","","","","","","","-100","tax","invoice","p11235","l10n_in.tax_tag_cess_rc" "","","","","","","","","","","","","","","","","","base","refund","","l10n_in.tax_tag_base_cess_rc"