From 7ed50439bc1b2de9e1bdfa4dfa589255367f9b6f Mon Sep 17 00:00:00 2001 From: Jigar Vaghela Date: Mon, 11 Apr 2022 13:31:07 +0000 Subject: [PATCH] [FIX] l10n_in_edi: fix compare of multi tags before this commit: =================== if there is multi tag on one tax line then condition is not working as expected see below test code ``` tags account.account.tag(33, 34) >>> self.env['account.account.tag'].browse([33]) in tags True >>> self.env['account.account.tag'].browse([33, 34]) in tags False ``` after this commit: ================== if there is multi tag on one tax line then condition working as expected see below test code ```tags account.account.tag(33, 34) >>> any(tag in tags for tag in self.env['account.account.tag'].browse([33])) True >>> any(tag in tags for tag in self.env['account.account.tag'].browse([33,34])) True ``` introduced from here https://github.com/odoo/odoo/commit/aa43799ed9e03d473f48c34ee470330e027ae462 closes odoo/odoo#88513 X-original-commit: 7cd2b25a7595cecd3b5c6a9d410f4ac31b76e8ac Signed-off-by: Florian Gilbert --- addons/l10n_in_edi/models/account_edi_format.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/l10n_in_edi/models/account_edi_format.py b/addons/l10n_in_edi/models/account_edi_format.py index ea2fb8e8445..67460028525 100644 --- a/addons/l10n_in_edi/models/account_edi_format.py +++ b/addons/l10n_in_edi/models/account_edi_format.py @@ -413,19 +413,19 @@ class AccountEdiFormat(models.Model): base_line = tax_values["base_line_id"] tax_line = tax_values["tax_line_id"] line_code = "other" - if tax_line.tax_tag_ids in self.env.ref("l10n_in.tax_report_line_cess").sudo().tag_ids: + if any(tag in tax_line.tax_tag_ids for tag in self.env.ref("l10n_in.tax_report_line_cess").sudo().tag_ids): if tax_line.tax_line_id.amount_type != "percent": line_code = "cess_non_advol" else: line_code = "cess" - elif tax_line.tax_tag_ids in self.env.ref("l10n_in.tax_report_line_state_cess").sudo().tag_ids: + elif any(tag in tax_line.tax_tag_ids for tag in self.env.ref("l10n_in.tax_report_line_state_cess").sudo().tag_ids): if tax_line.tax_line_id.amount_type != "percent": line_code = "state_cess_non_advol" else: line_code = "state_cess" else: for gst in ["cgst", "sgst", "igst"]: - if tax_line.tax_tag_ids in self.env.ref("l10n_in.tax_report_line_%s"%(gst)).sudo().tag_ids: + if any(tag in tax_line.tax_tag_ids for tag in self.env.ref("l10n_in.tax_report_line_%s"%(gst)).sudo().tag_ids): line_code = gst return { "tax": tax_values["tax_id"],