[IMP] l10n_in: auto set GST Treatment only for Indian invoice/bill

After this commit GST treatment will be only assigned to Indian invoices/bills.

closes odoo/odoo#111738

X-original-commit: 6ede766eab05b621bfee6e6af259c7d2d0bfbd94
Signed-off-by: Josse Colpaert <jco@odoo.com>
This commit is contained in:
Nishant Jain (niai)
2023-02-03 10:35:44 +01:00
parent da51ddc790
commit 68057e7161
+3 -1
View File
@@ -34,7 +34,8 @@ class AccountMove(models.Model):
@api.depends('partner_id')
def _compute_l10n_in_gst_treatment(self):
for record in self:
indian_invoice = self.filtered(lambda m: m.country_code == 'IN')
for record in indian_invoice:
gst_treatment = record.partner_id.l10n_in_gst_treatment
if not gst_treatment:
gst_treatment = 'unregistered'
@@ -43,6 +44,7 @@ class AccountMove(models.Model):
elif record.partner_id.country_id and record.partner_id.country_id.code != 'IN':
gst_treatment = 'overseas'
record.l10n_in_gst_treatment = gst_treatment
(self - indian_invoice).l10n_in_gst_treatment = False
@api.depends('partner_id', 'company_id')
def _compute_l10n_in_state_id(self):