diff options
| author | AZER <ezer1989@gmail.com> | 2017-03-26 08:32:34 +0100 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2017-03-29 16:08:09 +0200 |
| commit | c00a131309f00aaf33abd77f105d5b13c5e60061 (patch) | |
| tree | feb815c32e472792e2ce551fa022d00e0f305766 | |
| parent | 74f46a39804c98f7c4dcdc26349d27956ada1087 (diff) | |
[FIX] point_of_sale: add missing sudo
Main journal is not accessible for user from different company,
a security error is raised during the default get
A pos manager could not create a new pos configuration without create rights on
ir.sequence (only admin has by default)
Closes #16063
| -rw-r--r-- | addons/point_of_sale/models/pos_config.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/point_of_sale/models/pos_config.py b/addons/point_of_sale/models/pos_config.py index 07bd2f84051..8ee15eaeeaa 100644 --- a/addons/point_of_sale/models/pos_config.py +++ b/addons/point_of_sale/models/pos_config.py @@ -31,7 +31,7 @@ class PosConfig(models.Model): def _default_sale_journal(self): journal = self.env.ref('point_of_sale.pos_sale_journal', raise_if_not_found=False) - if journal and journal.company_id == self.env.user.company_id: + if journal and journal.sudo().company_id == self.env.user.company_id: return journal return self._default_invoice_journal() @@ -207,7 +207,7 @@ class PosConfig(models.Model): @api.model def create(self, values): - IrSequence = self.env['ir.sequence'] + IrSequence = self.env['ir.sequence'].sudo() val = { 'name': _('POS Order %s') % values['name'], 'padding': 4, |
