18 lines
550 B
Python
18 lines
550 B
Python
# Part of BrowseInfo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import api, fields, models, _
|
|
|
|
|
|
class ResUsers(models.Model):
|
|
_inherit = 'res.users'
|
|
|
|
branch_ids = fields.Many2many('res.branch',string="Allowed Branch")
|
|
branch_id = fields.Many2one('res.branch', string= 'Branch')
|
|
|
|
def write(self, values):
|
|
if 'branch_id' in values or 'branch_ids' in values:
|
|
self.env['ir.model.access'].call_cache_clearing_methods()
|
|
|
|
user = super(ResUsers, self).write(values)
|
|
return user
|