[FIX] multicompany security

the rma module had company_id fields on rma.order and rma.order.line but not on rma.operation,
and no global multicompany record rules.

-> we fix this and avoid a mess with people allowed to see an operation in the drop down list
but unable to use it because if points to a warehouse of another company
This commit is contained in:
Alexandre Fayolle
2019-06-19 00:10:34 +02:00
committed by Florian da Costa
parent fb16399812
commit 0c8bcee67d
5 changed files with 26 additions and 1 deletions

View File

@@ -75,3 +75,7 @@ class RmaOperation(models.Model):
comodel_name='rma.order.line', inverse_name='operation_id',
string='RMA lines',
)
company_id = fields.Many2one(
comodel_name='res.company', string='Company', required=True,
default=lambda self: self.env.user.company_id
)