23 lines
714 B
Python
23 lines
714 B
Python
from odoo import fields, models, api
|
|
from odoo import api, fields, models
|
|
|
|
class IrModelFields(models.Model):
|
|
_inherit = 'ir.model.fields'
|
|
|
|
@api.model
|
|
def _is_manual_name(self, name):
|
|
return name.startswith('x_') or name.endswith('_pinyin')
|
|
|
|
|
|
class UsersHomeBatchWizard(models.TransientModel):
|
|
_name = "users.home.batch.wizard"
|
|
_description = "Batch Update User Home"
|
|
|
|
|
|
user_ids = fields.Many2many("res.users", string="选中员工", default=lambda self: self.env.context.get("active_ids", []))
|
|
action_id = fields.Many2one('ir.actions.actions', string="动作")
|
|
|
|
def confirm(self):
|
|
for user in self.user_ids:
|
|
user.write({'action_id': self.action_id.id})
|