From 1f87ad1cac6b3ee1f7245e79a71cfb3412886dac Mon Sep 17 00:00:00 2001 From: Zeel Patel Date: Tue, 4 Apr 2023 12:56:52 +0000 Subject: [PATCH] [IMP] l10n_in_edi_ewaybill: transporter id must have GST number MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In this commit, when user has created a transporter from the invoice view and if it's forget to enter GSTIN Then we throws error to set GSTIN in transporter transporter always have GSTIN, without having GSTIN any one is not allowed to transport goods in India. task - 3262215 closes odoo/odoo#120183 X-original-commit: d09c9358f721add6f585735670085d16bcf2766c Signed-off-by: Quentin De Paoli Signed-off-by: Xavier Dollé (xdo) --- addons/l10n_in_edi_ewaybill/i18n/l10n_in_edi_ewaybill.pot | 6 ++++++ addons/l10n_in_edi_ewaybill/models/account_edi_format.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/addons/l10n_in_edi_ewaybill/i18n/l10n_in_edi_ewaybill.pot b/addons/l10n_in_edi_ewaybill/i18n/l10n_in_edi_ewaybill.pot index 770e03b57d7..67c734f41b9 100644 --- a/addons/l10n_in_edi_ewaybill/i18n/l10n_in_edi_ewaybill.pot +++ b/addons/l10n_in_edi_ewaybill/i18n/l10n_in_edi_ewaybill.pot @@ -33,6 +33,12 @@ msgstr "" msgid "- Document Type" msgstr "" +#. module: l10n_in_edi_ewaybill +#: code:addons/l10n_in_edi_ewaybill/models/account_edi_format.py:0 +#, python-format +msgid "- Selected Transporter is missing GSTIN" +msgstr "" + #. module: l10n_in_edi_ewaybill #: code:addons/l10n_in_edi_ewaybill/models/account_edi_format.py:0 #, python-format 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 572d17c6baa..14ffa9af31c 100755 --- a/addons/l10n_in_edi_ewaybill/models/account_edi_format.py +++ b/addons/l10n_in_edi_ewaybill/models/account_edi_format.py @@ -87,6 +87,8 @@ class AccountEdiFormat(models.Model): error_message.append(_("- Transportation Mode")) elif move.l10n_in_mode == "0" and not move.l10n_in_transporter_id: error_message.append(_("- Transporter is required when E-waybill is managed by transporter")) + elif move.l10n_in_mode == "0" and move.l10n_in_transporter_id and not move.l10n_in_transporter_id.vat: + error_message.append(_("- Selected Transporter is missing GSTIN")) elif move.l10n_in_mode == "1": if not move.l10n_in_vehicle_no and move.l10n_in_vehicle_type: error_message.append(_("- Vehicle Number and Type is required when Transportation Mode is By Road"))