Skip to content
Snippets Groups Projects
Commit 20c6e067 authored by Benjamin - Le Filament's avatar Benjamin - Le Filament
Browse files

[FIX] error access rights

parent dcf1a5b7
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,7 @@ class ScopContributionReport(models.Model): ...@@ -20,7 +20,7 @@ class ScopContributionReport(models.Model):
# exclude contribution before 2021 from RIGA # exclude contribution before 2021 from RIGA
if contribution.year > '2020': if contribution.year > '2020':
if contribution.type_contribution_id == contrib_cg: if contribution.type_contribution_id == contrib_cg:
bordereau = self.env['scop.bordereau'].search([ bordereau = self.env['scop.bordereau'].sudo().search([
('partner_id', '=', self.partner_id.id), ('partner_id', '=', self.partner_id.id),
('year', '=', self.year), ('year', '=', self.year),
]) ])
...@@ -37,13 +37,13 @@ class ScopContributionReport(models.Model): ...@@ -37,13 +37,13 @@ class ScopContributionReport(models.Model):
# Button # Button
# ------------------------------------------------------ # ------------------------------------------------------
def print_report_with_payment(self): def print_report_with_payment(self):
bordereau = self.env['scop.bordereau'].search([ bordereau = self.env['scop.bordereau'].sudo().search([
('partner_id', '=', self.partner_id.id), ('partner_id', '=', self.partner_id.id),
('year', '=', self.year), ('year', '=', self.year),
]) ])
if len(bordereau) == 1: if len(bordereau) == 1:
return self.env.ref( return self.env.ref(
'cgscop_cotisation_cg.cgscop_bordereau_report_with_payments' 'cgscop_cotisation_cg.cgscop_bordereau_report_with_payments'
).report_action(bordereau) ).sudo().report_action(bordereau.sudo())
else: else:
raise UserError('Pas de bordereau rattaché à cette cotisation.') raise UserError('Pas de bordereau rattaché à cette cotisation.')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment