From bad8b1e83798e8db6b4c37094c0fcd83bcbe294f Mon Sep 17 00:00:00 2001 From: suth-odoo Date: Thu, 28 Dec 2023 07:18:02 +0000 Subject: [PATCH] [FIX] l10n_in: fixes warning issue & allow the user to confirm the vendor bill MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to Reproduce : - install indian Accounting module - click on invoice - go to vendor bills - create new Issue: - while creating new and confirming, it will throw a warning message, as this warning required only for eInvoice only (while confirming the invoice) not for vendor Bills. Cause: - while generating warning message there is no specific condition like that it is not for vendors Solution: - if we gave condition that this warning message is only for out_invoice then the issue will be solved. task-3657558 closes odoo/odoo#161333 X-original-commit: 6480dccfea696e759d0ed4225f4edc033adbfc0e Signed-off-by: Julien Van Roy (juvr) Signed-off-by: Laurent Smet (las) --- addons/l10n_in/models/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_in/models/account_invoice.py b/addons/l10n_in/models/account_invoice.py index 5303175595b..7823ce453df 100644 --- a/addons/l10n_in/models/account_invoice.py +++ b/addons/l10n_in/models/account_invoice.py @@ -79,7 +79,7 @@ class AccountMove(models.Model): posted = super()._post(soft) gst_treatment_name_mapping = {k: v for k, v in self._fields['l10n_in_gst_treatment']._description_selection(self.env)} - for move in posted.filtered(lambda m: m.country_code == 'IN'): + for move in posted.filtered(lambda m: m.country_code == 'IN' and m.is_sale_document()): if move.l10n_in_state_id and not move.l10n_in_state_id.l10n_in_tin: raise UserError(_("Please set a valid TIN Number on the Place of Supply %s", move.l10n_in_state_id.name)) if not move.company_id.state_id: