diff --git a/addons/l10n_in/models/account_invoice.py b/addons/l10n_in/models/account_invoice.py index a62d470fd36..d2f1354ae83 100644 --- a/addons/l10n_in/models/account_invoice.py +++ b/addons/l10n_in/models/account_invoice.py @@ -62,6 +62,14 @@ class AccountMove(models.Model): else: move.l10n_in_state_id = False + def _get_name_invoice_report(self): + if self.country_code == 'IN': + # TODO: remove the view mode check in master, only for stable releases + in_invoice_view = self.env.ref('l10n_in.l10n_in_report_invoice_document_inherit', raise_if_not_found=False) + if (in_invoice_view and in_invoice_view.mode == "primary"): + return 'l10n_in.l10n_in_report_invoice_document_inherit' + return super()._get_name_invoice_report() + def _post(self, soft=True): """Use journal type to define document type because not miss state in any entry including POS entry""" posted = super()._post(soft) diff --git a/addons/l10n_in/views/report_invoice.xml b/addons/l10n_in/views/report_invoice.xml index 8615f3fdadb..3f7847b1ae3 100644 --- a/addons/l10n_in/views/report_invoice.xml +++ b/addons/l10n_in/views/report_invoice.xml @@ -1,6 +1,6 @@ -