summaryrefslogtreecommitdiff
path: root/addons/account_check_printing
diff options
context:
space:
mode:
authorGoffin Simon <sig@odoo.com>2021-04-28 12:55:25 +0000
committerGoffin Simon <sig@odoo.com>2021-04-28 12:55:25 +0000
commit11376c88e0068a0bece0b0b56ffd4a9f296ffb87 (patch)
treecff5ae3167d66f5ea81d3c789878fc4dc9d47238 /addons/account_check_printing
parent5994c4dfb229f3023a89e920a97efee38828f034 (diff)
[FIX] account_check_printing: Only administrator can print checks
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#70013 Signed-off-by: William André (wan) <wan@odoo.com>
Diffstat (limited to 'addons/account_check_printing')
-rw-r--r--addons/account_check_printing/models/account_payment.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account_check_printing/models/account_payment.py b/addons/account_check_printing/models/account_payment.py
index 1e00af888ce..e9c6a152248 100644
--- a/addons/account_check_printing/models/account_payment.py
+++ b/addons/account_check_printing/models/account_payment.py
@@ -84,7 +84,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')