diff options
| author | Nicolas Seinlet <nse@odoo.com> | 2019-12-17 11:10:30 +0000 |
|---|---|---|
| committer | Nicolas Seinlet <nse@odoo.com> | 2019-12-17 11:10:30 +0000 |
| commit | 6b751f12f394ef0325d606080f184fbedc5f9f3a (patch) | |
| tree | e2807ff2d9757908c14a971780da7bbcb2c6a419 | |
| parent | 00a341f467eb31b774d1defbef3f4b2a4b5dc9cb (diff) | |
[FIX] point_of_sale: permit accountant to change lock date
Accountant who change the lock date is not always a pos user, and then
cannot read pos sessions.
closes odoo/odoo#42156
X-original-commit: 8c6aa24525eca434b6f85b56c10c45b33cc05a43
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
| -rw-r--r-- | addons/point_of_sale/models/res_company.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/point_of_sale/models/res_company.py b/addons/point_of_sale/models/res_company.py index ea778a88d15..2b4b5917d82 100644 --- a/addons/point_of_sale/models/res_company.py +++ b/addons/point_of_sale/models/res_company.py @@ -19,7 +19,7 @@ class ResCompany(models.Model): would trigger an error message saying that the period has been locked when trying to close them. """ - pos_session_model = self.env['pos.session'] + pos_session_model = self.env['pos.session'].sudo() for record in self: sessions_in_period = pos_session_model.search([('state', '!=', 'closed'), '|', ('start_at', '<=', record.period_lock_date), ('start_at', '<=', record.fiscalyear_lock_date)]) if sessions_in_period: |
