From 304af5b84496f1cd6750c5dde08e9992d69ff2d8 Mon Sep 17 00:00:00 2001 From: Khushi Vakil Date: Tue, 16 May 2023 11:17:16 +0000 Subject: [PATCH] [FIX] l10n_in_edi_ewaybill: nil rated outside a state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit: 1.Create an Invoice in the demo company "E-Waybill Company" outside of the state (state other than set in the company) 2.Set the tax as nil rated and send e-way bill E-Way Bill will not send. Error message: [236]Tax rates for Inter state transaction is blank After this commit: E-Way Bill can be sent with nil rated tax for demo company 'E-Waybill Company' outside of the state(state other than set in the company)  task id:3304875 closes odoo/odoo#123616 X-original-commit: 2dc0bd3c7415e55c77c83f98e4c7088e0eaf82fc Signed-off-by: Josse Colpaert --- addons/l10n_in_edi_ewaybill/models/account_edi_format.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/l10n_in_edi_ewaybill/models/account_edi_format.py b/addons/l10n_in_edi_ewaybill/models/account_edi_format.py index 821038fe76f..f8771c713b0 100755 --- a/addons/l10n_in_edi_ewaybill/models/account_edi_format.py +++ b/addons/l10n_in_edi_ewaybill/models/account_edi_format.py @@ -477,8 +477,8 @@ class AccountEdiFormat(models.Model): "qtyUnit": line.product_id.uom_id.l10n_in_code and line.product_id.uom_id.l10n_in_code.split("-")[0] or "OTH", "taxableAmount": self._l10n_in_round_value(line.balance * sign), } - if tax_details_by_code.get("igst_rate"): - line_details.update({"igstRate": self._l10n_in_round_value(tax_details_by_code["igst_rate"])}) + if tax_details_by_code.get("igst_rate") or (line.move_id.l10n_in_state_id.l10n_in_tin != line.company_id.state_id.l10n_in_tin): + line_details.update({"igstRate": self._l10n_in_round_value(tax_details_by_code.get("igst_rate", 0.00))}) else: line_details.update({ "cgstRate": self._l10n_in_round_value(tax_details_by_code.get("cgst_rate", 0.00)),