You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
627 B
Python
20 lines
627 B
Python
|
|
from odoo import models
|
|
|
|
|
|
class ResUsers(models.Model):
|
|
_inherit = 'res.users'
|
|
|
|
def add_multi_company(self):
|
|
for user in self:
|
|
user.write({'groups_id': [(4, self.env.ref('base.group_multi_company').id)]})
|
|
return {
|
|
"type": "ir.actions.client",
|
|
"tag": "display_notification",
|
|
"params": {
|
|
"title": "多公司群组添加成功",
|
|
"type": "success",
|
|
"sticky": False,
|
|
"next": {"type": "ir.actions.act_window_close"},
|
|
},
|
|
} |