diff --git a/trytond/trytond/ir/module.py b/trytond/trytond/ir/module.py
index 0131e594f3..3bc8d703c3 100644
--- a/trytond/trytond/ir/module.py
+++ b/trytond/trytond/ir/module.py
@@ -68,24 +68,17 @@ class Module(ModelSQL, ModelView):
'invisible': Eval('state') != 'not activated',
'depends': ['state'],
},
- 'activate_cancel': {
- 'invisible': Eval('state') != 'to activate',
- 'depends': ['state'],
- },
'deactivate': {
'invisible': Eval('state') != 'activated',
'depends': ['state'],
},
- 'deactivate_cancel': {
- 'invisible': Eval('state') != 'to remove',
- 'depends': ['state'],
- },
'upgrade': {
'invisible': Eval('state') != 'activated',
'depends': ['state'],
},
- 'upgrade_cancel': {
- 'invisible': Eval('state') != 'to upgrade',
+ 'cancel': {
+ 'invisible': ~Eval('state').in_(
+ ['to activate', 'to remove', 'to upgrade']),
'depends': ['state'],
},
})
@@ -194,14 +187,6 @@ class Module(ModelSQL, ModelView):
'state': 'to upgrade',
})
- @classmethod
- @ModelView.button
- @filter_state('to activate')
- def activate_cancel(cls, modules):
- cls.write(modules, {
- 'state': 'not activated',
- })
-
@classmethod
@ModelView.button
@filter_state('activated')
@@ -228,14 +213,26 @@ class Module(ModelSQL, ModelView):
@classmethod
@ModelView.button
+ def cancel(cls, modules):
+ cls._cancel_activate(modules)
+ cls._cancel_remove(modules)
+ cls._cancel_upgrade(modules)
+
+ @classmethod
+ @filter_state('to activate')
+ def _cancel_activate(cls, modules):
+ cls.write(modules, {
+ 'state': 'not activated',
+ })
+
+ @classmethod
@filter_state('to remove')
- def deactivate_cancel(cls, modules):
+ def _cancel_remove(cls, modules):
cls.write(modules, {'state': 'not activated'})
@classmethod
- @ModelView.button
@filter_state('to upgrade')
- def upgrade_cancel(cls, modules):
+ def _cancel_upgrade(cls, modules):
cls.write(modules, {'state': 'activated'})
@classmethod
diff --git a/trytond/trytond/ir/module.xml b/trytond/trytond/ir/module.xml
index d4bb1a84e4..cddac7fa89 100644
--- a/trytond/trytond/ir/module.xml
+++ b/trytond/trytond/ir/module.xml
@@ -45,60 +45,40 @@ this repository contains the full copyright notices and license terms. -->
ir.module
activate
- Mark for Activation
+ Activate
-
- ir.module
- activate_cancel
- Cancel Activation
-
-
-
-
-
-
ir.module
deactivate
- Mark for Deactivation (beta)
+ Deactivate (beta)
-
- ir.module
- deactivate_cancel
- Cancel Deactivation
-
-
-
-
-
-
ir.module
upgrade
- Mark for Upgrade
+ Upgrade
-
+
ir.module
- upgrade_cancel
- Cancel Upgrade
+ cancel
+ Cancel
-
-
+
+
diff --git a/trytond/trytond/ir/view/module_form.xml b/trytond/trytond/ir/view/module_form.xml
index 69b9743d50..246edfd9e0 100644
--- a/trytond/trytond/ir/view/module_form.xml
+++ b/trytond/trytond/ir/view/module_form.xml
@@ -10,11 +10,9 @@ this repository contains the full copyright notices and license terms. -->
-
-
-
-
-
-
+
+
+
+
diff --git a/trytond/trytond/ir/view/module_list.xml b/trytond/trytond/ir/view/module_list.xml
index 5009071f04..23e04f81d6 100644
--- a/trytond/trytond/ir/view/module_list.xml
+++ b/trytond/trytond/ir/view/module_list.xml
@@ -5,8 +5,6 @@ this repository contains the full copyright notices and license terms. -->
-
-
-
-
+
+