Skip to content
Snippets Groups Projects
Commit 5f1233b7 authored by Pedram (pebr)'s avatar Pedram (pebr)
Browse files

[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#153325

X-original-commit: 27ad4379
Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
parent 570090dd
Branches
Tags
No related merge requests found
......@@ -71,7 +71,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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment