[REF] base: Remove some fields on ir.actions.todo
All our ir.actions.todo records are automatic.
This commit is contained in:
@@ -147,7 +147,7 @@ class AccountChartTemplate(models.Model):
|
||||
todo = self.env['ir.actions.todo']
|
||||
action_rec = self.env['ir.model.data'].xmlid_to_object('account.action_wizard_multi_chart')
|
||||
if action_rec:
|
||||
todo.create({'action_id': action_rec.id, 'name': _('Choose Accounting Template'), 'type': 'automatic'})
|
||||
todo.create({'action_id': action_rec.id, 'name': _('Choose Accounting Template')})
|
||||
return True
|
||||
|
||||
@api.model
|
||||
|
||||
@@ -52,6 +52,5 @@
|
||||
|
||||
<record id="open_l10n_eu_service" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_eu_service"/>
|
||||
<field name="type">automatic</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -100,7 +100,6 @@
|
||||
</record>
|
||||
<record id="base.open_menu" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_open_channels"/>
|
||||
<field name="type">automatic</field>
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
@@ -68,7 +68,6 @@ action = {
|
||||
</record>
|
||||
<record id="theme_install_todo" model="ir.actions.todo">
|
||||
<field name="action_id" ref="theme_install_todo_action"/>
|
||||
<field name="type">automatic</field>
|
||||
</record>
|
||||
|
||||
<!-- Add link to theme install in default customize modal -->
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
</record>
|
||||
<record id="open_menu" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_client_base_menu"/>
|
||||
<field name="type">automatic</field>
|
||||
<field name="sequence">100</field>
|
||||
<field name="state">done</field>
|
||||
</record>
|
||||
|
||||
@@ -571,14 +571,6 @@ class IrActionsTodo(models.Model):
|
||||
sequence = fields.Integer(default=10)
|
||||
state = fields.Selection([('open', 'To Do'), ('done', 'Done')], string='Status', default='open', required=True)
|
||||
name = fields.Char()
|
||||
type = fields.Selection([('manual', 'Launch Manually'),
|
||||
('once', 'Launch Manually Once'),
|
||||
('automatic', 'Launch Automatically')], default='manual', required=True,
|
||||
help="""Manual: Launched manually.
|
||||
Automatic: Runs whenever the system is reconfigured.
|
||||
Launch Manually Once: after having been launched manually, it sets automatically to Done.""")
|
||||
groups_id = fields.Many2many('res.groups', 'res_groups_action_rel', 'uid', 'gid', string='Groups')
|
||||
note = fields.Text(string='Text', translate=True)
|
||||
|
||||
@api.multi
|
||||
def name_get(self):
|
||||
@@ -610,8 +602,8 @@ class IrActionsTodo(models.Model):
|
||||
def action_launch(self, context=None):
|
||||
""" Launch Action of Wizard"""
|
||||
self.ensure_one()
|
||||
if self.type in ('automatic', 'once'):
|
||||
self.write({'state': 'done'})
|
||||
|
||||
self.write({'state': 'done'})
|
||||
|
||||
# Load action
|
||||
action = self.env[self.action_id.type].browse(self.action_id.id)
|
||||
@@ -627,8 +619,8 @@ class IrActionsTodo(models.Model):
|
||||
result['res_id'] = ctx.pop('res_id')
|
||||
|
||||
# disable log for automatic wizards
|
||||
if self.type == 'automatic':
|
||||
ctx['disable_log'] = True
|
||||
ctx['disable_log'] = True
|
||||
|
||||
result['context'] = ctx
|
||||
|
||||
return result
|
||||
|
||||
@@ -390,7 +390,6 @@ env["res.partner"].create({"name": partner_name})
|
||||
<tree string="Config Wizard Steps">
|
||||
<field name="sequence"/>
|
||||
<field name="action_id"/>
|
||||
<field name="type"/>
|
||||
<field name="state" readonly="1"/>
|
||||
<button name="action_launch" states="open" string="Launch" type="object" icon="fa-cogs" help="Launch Configuration Wizard"/>
|
||||
<button name="action_open" states="done"
|
||||
@@ -417,12 +416,8 @@ env["res.partner"].create({"name": partner_name})
|
||||
<sheet>
|
||||
<group col="4">
|
||||
<field name="action_id"/>
|
||||
<field name="type"/>
|
||||
<field name="sequence"/>
|
||||
</group>
|
||||
<group string="Groups">
|
||||
<field name="groups_id" nolabel="1" colspan="4"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -57,12 +57,9 @@ class ResConfigConfigurable(models.TransientModel):
|
||||
Todos = self.env['ir.actions.todo']
|
||||
_logger.info('getting next %s', Todos)
|
||||
|
||||
active_todos = Todos.search(['&', ('type', '=', 'automatic'), ('state', '=', 'open')])
|
||||
user_groups = self.env.user.groups_id
|
||||
|
||||
for todo in active_todos:
|
||||
if not todo.groups_id or (todo.groups_id & user_groups):
|
||||
return todo
|
||||
active_todo = Todos.search([('state', '=', 'open')], limit=1)
|
||||
if active_todo:
|
||||
return active_todo
|
||||
|
||||
def _next(self):
|
||||
_logger.info('getting next operation')
|
||||
|
||||
Reference in New Issue
Block a user