[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 <flg@odoo.com>
This commit is contained in:
Jigar Vaghela
2022-04-12 15:49:02 +02:00
parent 02395d7e86
commit 7ed50439bc
@@ -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"],