17 lines
607 B
Python
17 lines
607 B
Python
from odoo import fields, models, api
|
|
from odoo.exceptions import UserError, ValidationError
|
|
from datetime import datetime, date, time, timedelta
|
|
|
|
|
|
class RoleGroupWizard(models.Model):
|
|
_name = "role.group.wizard"
|
|
_description = "角色组弹窗"
|
|
|
|
role_group_id = fields.Many2one('soong.user.role.group', string='角色组')
|
|
user_role_ids = fields.Many2many('soong.user.role', string='包含角色', index=True, store=True)
|
|
|
|
def confirm(self):
|
|
if self.role_group_id and self.user_role_ids:
|
|
self.role_group_id.write({'user_role_ids': [(6, 0, self.user_role_ids.ids)]})
|
|
|