From 68057e716129db773ce4cab116541eb895dae866 Mon Sep 17 00:00:00 2001 From: "Nishant Jain (niai)" Date: Thu, 2 Feb 2023 10:44:11 +0000 Subject: [PATCH] [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 --- addons/l10n_in/models/account_invoice.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/l10n_in/models/account_invoice.py b/addons/l10n_in/models/account_invoice.py index fbd3ca1203f..e1cc07d18d3 100644 --- a/addons/l10n_in/models/account_invoice.py +++ b/addons/l10n_in/models/account_invoice.py @@ -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):