Skip to content
Extraits de code Groupes Projets
Valider 20c6e067 rédigé par Benjamin - Le Filament's avatar Benjamin - Le Filament
Parcourir les fichiers

[FIX] error access rights

parent dcf1a5b7
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -20,7 +20,7 @@ class ScopContributionReport(models.Model):
# exclude contribution before 2021 from RIGA
if contribution.year > '2020':
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),
('year', '=', self.year),
])
......@@ -37,13 +37,13 @@ class ScopContributionReport(models.Model):
# Button
# ------------------------------------------------------
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),
('year', '=', self.year),
])
if len(bordereau) == 1:
return self.env.ref(
'cgscop_cotisation_cg.cgscop_bordereau_report_with_payments'
).report_action(bordereau)
).sudo().report_action(bordereau.sudo())
else:
raise UserError('Pas de bordereau rattaché à cette cotisation.')
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter