[IMP] base: remove activate module server action

before this commit, from list view users can install
module using the button in list view and from the
action button.

initially the Install button was not available in the
list view and only option to install multiple apps was
from the action button.

but with the introduction of the button in list header
there is no need for an another server action to
perform the same.

after this commit, the activate modules server action
will be removed from the code and its related test
and also newly added Install button will be renamed
to "Activate" to align with the button in kanban and
form.

closes odoo/odoo#133544

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
This commit is contained in:
niyasraphy
2023-09-04 05:49:50 +00:00
parent e7de3de58c
commit 251e558ff2
5 changed files with 1 additions and 24 deletions
-1
View File
@@ -58,7 +58,6 @@ The kernel of Odoo, needed for all installation.
'wizard/base_module_uninstall_views.xml',
'wizard/base_export_language_views.xml',
'wizard/base_partner_merge_views.xml',
'data/ir_actions_data.xml',
'data/ir_demo_failure_data.xml',
'views/ir_profile_views.xml',
'views/res_company_views.xml',
-12
View File
@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<record id="action_server_module_immediate_install" model="ir.actions.server">
<field name="name">Activate Modules</field>
<field name="model_id" ref="model_ir_module_module" />
<field name="binding_model_id" ref="model_ir_module_module" />
<field name="state">code</field>
<field name="code">records.button_immediate_install()</field>
</record>
</data>
</odoo>
-9
View File
@@ -148,15 +148,6 @@ class Module(models.Model):
_description = "Module"
_order = 'application desc,sequence,name'
@api.model
def get_views(self, views, options=None):
res = super().get_views(views, options)
if res['views'].get('form', {}).get('toolbar'):
install_id = self.env.ref('base.action_server_module_immediate_install').id
action = [rec for rec in res['views']['form']['toolbar']['action'] if rec.get('id', False) != install_id]
res['views']['form']['toolbar'] = {'action': action}
return res
@classmethod
def get_module_info(cls, name):
try:
-1
View File
@@ -2850,7 +2850,6 @@ class TestViews(ViewCase):
self.assertInvalid(arch % 'base.random_xmlid', 'Invalid xmlid base.random_xmlid for button of type action')
self.assertInvalid('<form><button type="action"/></form>', 'Button must have a name')
self.assertInvalid('<form><button special="dummy"/></form>', "Invalid special 'dummy' in button")
self.assertValid(arch % 'base.action_server_module_immediate_install')
self.assertInvalid(arch % 'base.partner_root', "base.partner_root is of type res.partner, expected a subclass of ir.actions.actions")
@mute_logger('odoo.addons.base.models.ir_ui_view')
+1 -1
View File
@@ -134,7 +134,7 @@
<field name="arch" type="xml">
<tree create="false" string="Apps" decoration-info="state == 'uninstalled'" decoration-muted="state == 'uninstallable'">
<header>
<button name="button_immediate_install" type="object" string="Install" groups="base.group_system"/>
<button name="button_immediate_install" type="object" string="Activate" groups="base.group_system"/>
<button name="button_immediate_upgrade" type="object" string="Upgrade" groups="base.group_system"/>
</header>
<field name="shortdesc"/>