From 0c7989942e9d3e830bff30504de840702218677b Mon Sep 17 00:00:00 2001 From: Surabhi Varma Date: Thu, 15 Feb 2024 12:44:33 +0530 Subject: [PATCH] [FIX] l10n_in_edi_ewaybill: don't send ewaybill if all lines are service In this commit ============================================= Before if all the lines were of service the error was displayed in a banner after error in response was received, but now before sending request the lines are checked if at least one line is of product and error is raised. Issue in this: https://github.com/odoo/odoo/pull/153522/commits/c81595db6a7a135a3289751a9b881b2f947bc6d2 closes odoo/odoo#154290 X-original-commit: 831d318a2993e8c4ac92739bf3604ad04dec924f Signed-off-by: Josse Colpaert Signed-off-by: Surabhi Varma (suva) --- addons/l10n_in_edi_ewaybill/models/account_edi_format.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 92e839f13d5..8191a21f0bc 100755 --- a/addons/l10n_in_edi_ewaybill/models/account_edi_format.py +++ b/addons/l10n_in_edi_ewaybill/models/account_edi_format.py @@ -98,7 +98,7 @@ class AccountEdiFormat(models.Model): error_message.append(_("- Transport document number and date is required when Transportation Mode is Rail,Air or Ship")) if error_message: error_message.insert(0, _("The following information are missing on the invoice (see eWayBill tab):")) - goods_lines = move.invoice_line_ids.filtered(lambda line: not (line.display_type or line.is_rounding_line or line.product_id.type == "service")) + goods_lines = move.invoice_line_ids.filtered(lambda line: not (line.display_type in ('line_section', 'line_note', 'rounding') or line.product_id.type == "service")) if not goods_lines: error_message.append(_('You need at least one product having "Product Type" as stockable or consumable.')) if base == "irn":