diff --git a/mass_sorting/README.rst b/mass_sorting/README.rst index 87238ee44..10f3af74d 100644 --- a/mass_sorting/README.rst +++ b/mass_sorting/README.rst @@ -38,7 +38,9 @@ Usage .. image:: /mass_sorting/static/description/4_before.png -* click on the button 'Action' and then select the according action +* click on the button 'Action' and then select the according action. + If you just created your action, please refresh the page + to see the new action appear. .. image:: /mass_sorting/static/description/2_button.png diff --git a/mass_sorting/demo/function.xml b/mass_sorting/demo/function.xml index 2c99f6d86..aeefe564c 100644 --- a/mass_sorting/demo/function.xml +++ b/mass_sorting/demo/function.xml @@ -5,7 +5,7 @@ Copyright (C) 2016-Today GRAP (http://www.grap.coop) License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> - + diff --git a/mass_sorting/i18n/fr.po b/mass_sorting/i18n/fr.po index b0efd0d24..5e23963a4 100644 --- a/mass_sorting/i18n/fr.po +++ b/mass_sorting/i18n/fr.po @@ -189,12 +189,12 @@ msgid "Sequence" msgstr "Séquence" #. module: mass_sorting -#: model:ir.model.fields,field_description:mass_sorting.field_mass_sort_config_ref_ir_act_window +#: model:ir.model.fields,field_description:mass_sorting.field_mass_sort_config_action_id msgid "Sidebar Action" msgstr "Action" #. module: mass_sorting -#: model:ir.model.fields,field_description:mass_sorting.field_mass_sort_config_ref_ir_value +#: model:ir.model.fields,field_description:mass_sorting.field_mass_sort_config_value_id msgid "Sidebar Button" msgstr "Bouton de la barre latérale" diff --git a/mass_sorting/models/mass_sort_config.py b/mass_sorting/models/mass_sort_config.py index 68e68f810..175d2492c 100644 --- a/mass_sorting/models/mass_sort_config.py +++ b/mass_sorting/models/mass_sort_config.py @@ -31,13 +31,13 @@ class MassSortConfig(models.Model): string='Model Name of the Field to Sort', hel="Technical field," "used in the model 'mass.sort.config.line'", store=True) - ref_ir_act_window = fields.Many2one( + action_id = fields.Many2one( comodel_name='ir.actions.act_window', string='Sidebar Action', - readonly=True, copy=False) + readonly=True, copy=False, oldname='ref_ir_act_window') - ref_ir_value = fields.Many2one( + value_id = fields.Many2one( comodel_name='ir.values', string='Sidebar Button', readonly=True, - copy=False) + copy=False, oldname='ref_ir_value') line_ids = fields.One2many( comodel_name='mass.sort.config.line', inverse_name='config_id', @@ -91,7 +91,7 @@ class MassSortConfig(models.Model): values_obj = self.env['ir.values'] for config in self: button_name = _('Mass Sort (%s)') % config.name - config.ref_ir_act_window = action_obj.create({ + config.action_id = action_obj.create({ 'name': button_name, 'type': 'ir.actions.act_window', 'res_model': 'mass.sort.wizard', @@ -101,18 +101,18 @@ class MassSortConfig(models.Model): 'view_mode': 'form,tree', 'target': 'new', }) - config.ref_ir_value = values_obj.create({ + config.value_id = values_obj.create({ 'name': button_name, 'model': config.model_id.model, 'key2': 'client_action_multi', 'value': ( - "ir.actions.act_window,%s" % config.ref_ir_act_window.id), + "ir.actions.act_window,%s" % config.action_id.id), }) @api.multi def unlink_action(self): for config in self: - if config.ref_ir_act_window: - config.ref_ir_act_window.unlink() - if config.ref_ir_value: - config.ref_ir_value.unlink() + if config.action_id: + config.action_id.unlink() + if config.value_id: + config.value_id.unlink() diff --git a/mass_sorting/models/mass_sort_wizard.py b/mass_sorting/models/mass_sort_wizard.py index 85e5ef704..1f1dd8b96 100644 --- a/mass_sorting/models/mass_sort_wizard.py +++ b/mass_sorting/models/mass_sort_wizard.py @@ -56,7 +56,7 @@ class MassSortWizard(models.TransientModel): ". \n\nThe sorting will be done by %(field_list)s.") % ({ 'field': wizard.config_id.one2many_field_id.field_description, - 'qty': len(self._context.get('active_ids', False)), + 'qty': len(self._context.get('active_ids', [])), 'model': wizard.config_id.model_id.name, 'field_list': ', '.join( [x.field_id.field_description diff --git a/mass_sorting/views/view_mass_sort_config.xml b/mass_sorting/views/view_mass_sort_config.xml index 1a2881f12..7ea016716 100644 --- a/mass_sorting/views/view_mass_sort_config.xml +++ b/mass_sorting/views/view_mass_sort_config.xml @@ -32,10 +32,10 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
@@ -45,8 +45,8 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - - + +