[FIX] l10n_in: allow non-admin users to generate invoices
Before this commit, users without admin access rights were unable to generate invoices. opw-3701291 closes odoo/odoo#153350 X-original-commit: 27ad4379364b481276a6597bb9fab9778f07fd5f Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
@@ -67,7 +67,7 @@ class AccountMove(models.Model):
|
||||
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"):
|
||||
if (in_invoice_view and in_invoice_view.sudo().mode == "primary"):
|
||||
return 'l10n_in.l10n_in_report_invoice_document_inherit'
|
||||
return super()._get_name_invoice_report()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user