From 5ba579dbcbc933b2e55e34894d92b0b64cf337c4 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 28 Apr 2021 12:55:25 +0000 Subject: [PATCH] [FIX] account_check_printing: Only administrator can print checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce the bug: - Let's consider a user U not in group group_system - Log with U - Create a vendor payment with payment method Checks - Print it Bug: An access error was raised because U didn't have the rights to write on model ir.sequence opw:2513014 closes odoo/odoo#70062 X-original-commit: 11376c88e0068a0bece0b0b56ffd4a9f296ffb87 Signed-off-by: William André (wan) Signed-off-by: Simon Goffin (sig) --- addons/account_check_printing/models/account_payment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_check_printing/models/account_payment.py b/addons/account_check_printing/models/account_payment.py index 28d48cb7b58..42894ea1a6b 100644 --- a/addons/account_check_printing/models/account_payment.py +++ b/addons/account_check_printing/models/account_payment.py @@ -85,7 +85,7 @@ class AccountPayment(models.Model): def _inverse_check_number(self): for payment in self: if payment.check_number: - sequence = payment.journal_id.check_sequence_id + sequence = payment.journal_id.check_sequence_id.sudo() sequence.padding = len(payment.check_number) @api.depends('payment_type', 'journal_id', 'partner_id')