[IMP] l10n_in: auto set GST Treatment in invoice/bill

Before this commit
==================
GST Treatment will not be assigned to those invoices/bills
whose partners don't have GST Treatment.

After this commit
=================
GST Treatment will be assigned to those invoices/bills whose
partners don't have GST Treatment.

closes odoo/odoo#111528

X-original-commit: de944b54715db0a0b6898fb9b049449c5ced29c9
Related: odoo/enterprise#36555
Signed-off-by: Josse Colpaert <jco@odoo.com>
This commit is contained in:
Nishant Jain (niai)
2023-02-03 05:09:28 +01:00
parent 8b5a01b36a
commit fcd6c6d400
+8 -1
View File
@@ -35,7 +35,14 @@ class AccountMove(models.Model):
@api.depends('partner_id')
def _compute_l10n_in_gst_treatment(self):
for record in self:
record.l10n_in_gst_treatment = record.partner_id.l10n_in_gst_treatment
gst_treatment = record.partner_id.l10n_in_gst_treatment
if not gst_treatment:
gst_treatment = 'unregistered'
if record.partner_id.country_id.code == 'IN' and record.partner_id.vat:
gst_treatment = 'regular'
elif record.partner_id.country_id and record.partner_id.country_id.code != 'IN':
gst_treatment = 'overseas'
record.l10n_in_gst_treatment = gst_treatment
@api.depends('partner_id', 'company_id')
def _compute_l10n_in_state_id(self):