[FIX] l10n_in: fixes warning issue & allow the user to confirm the vendor bill

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) <juvr@odoo.com>
Signed-off-by: Laurent Smet (las) <las@odoo.com>
This commit is contained in:
suth-odoo
2024-04-14 09:28:07 +00:00
parent 3275156773
commit bad8b1e837
+1 -1
View File
@@ -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: