Replace menu entry for upgrade module wizard by multiple button on module list

This commit is contained in:
Cédric Krier
2025-06-13 17:40:28 +02:00
parent 9058fc381d
commit b88d9004ef
3 changed files with 17 additions and 12 deletions
+6
View File
@@ -81,6 +81,7 @@ class Module(ModelSQL, ModelView):
['to activate', 'to remove', 'to upgrade']),
'depends': ['state'],
},
'apply': {},
})
@staticmethod
@@ -235,6 +236,11 @@ class Module(ModelSQL, ModelView):
def _cancel_upgrade(cls, modules):
cls.write(modules, {'state': 'activated'})
@classmethod
@ModelView.button_action('ir.act_module_activate_upgrade')
def apply(cls, modules):
pass
@classmethod
def update_list(cls):
"Update the list of available modules"
+10 -12
View File
@@ -82,6 +82,16 @@ this repository contains the full copyright notices and license terms. -->
<field name="group" ref="res.group_admin"/>
</record>
<record model="ir.model.button" id="module_apply_button">
<field name="model">ir.module</field>
<field name="name">apply</field>
<field name="string">Apply</field>
</record>
<record model="ir.model.button-res.group" id="module_apply_button_group_admin">
<field name="button" ref="module_apply_button"/>
<field name="group" ref="res.group_admin"/>
</record>
<record model="ir.model.access" id="access_module">
<field name="model">ir.module</field>
<field name="perm_read" eval="True"/>
@@ -170,12 +180,6 @@ this repository contains the full copyright notices and license terms. -->
<field name="group" ref="res.group_admin"/>
</record>
<record model="ir.action.keyword" id="act_module_activate_upgrade_keyword1">
<field name="action" ref="act_module_activate_upgrade"/>
<field name="keyword">form_action</field>
<field name="model">ir.module,-1</field>
</record>
<record model="ir.ui.view" id="module_activate_upgrade_start_view_form">
<field name="model">ir.module.activate_upgrade.start</field>
<field name="type">form</field>
@@ -188,12 +192,6 @@ this repository contains the full copyright notices and license terms. -->
<field name="name">module_activate_upgrade_done_form</field>
</record>
<menuitem
parent="menu_modules"
action="act_module_activate_upgrade"
sequence="90"
id="menu_module_activate_upgrade"/>
<record model="ir.action.wizard" id="act_module_config">
<field name="name">Configure Modules</field>
<field name="wiz_name">ir.module.config</field>
+1
View File
@@ -7,4 +7,5 @@ this repository contains the full copyright notices and license terms. -->
<field name="state"/>
<button name="activate"/>
<button name="cancel"/>
<button name="apply" multiple="1"/>
</tree>