Add module update/install/cancel buttons to tree view

issue1750
review187002
This commit is contained in:
Udo Spallek
2012-01-13 07:24:57 +01:00
parent 7d457f46c4
commit c483ca6001
2 changed files with 47 additions and 0 deletions
+8
View File
@@ -68,6 +68,14 @@ this repository contains the full copyright notices and license terms. -->
<field name="website"/>
<field name="state"/>
<field name="description" tree_invisible="1"/>
<button string="Mark for Upgrade" name="button_upgrade"
type="object"/>
<button string="Mark for Installation"
name="button_install" type="object"/>
<button string="Cancel Installation"
name="button_install_cancel" type="object"/>
<button string="Cancel Upgrade"
name="button_upgrade_cancel" type="object"/>
</tree>
]]>
</field>
+39
View File
@@ -654,6 +654,45 @@ this repository contains the full copyright notices and license terms. -->
]]>
</field>
</record>
<record model="ir.ui.view" id="module_view_tree">
<field name="model">ir.module.module</field>
<field name="inherit" ref="ir.module_view_tree"/>
<field name="arch" type="xml">
<![CDATA[
<data>
<xpath
expr="/tree/button[@name=&quot;button_install&quot;]"
position="replace">
<button string="Mark for Installation"
name="button_install" type="object"
states="{'invisible': Not(Equal(Eval('state'), 'uninstalled')), 'readonly': Not(In(%(res.group_admin)d, Eval('groups', [])))}"/>
</xpath>
<xpath
expr="/tree/button[@name=&quot;button_install_cancel&quot;]"
position="replace">
<button string="Cancel Installation"
name="button_install_cancel" type="object"
states="{'invisible': Not(Equal(Eval('state'), 'to install')), 'readonly': Not(In(%(res.group_admin)d, Eval('groups', [])))}"/>
</xpath>
<xpath
expr="/tree/button[@name=&quot;button_upgrade&quot;]"
position="replace">
<button string="Mark for Upgrade"
name="button_upgrade" type="object"
states="{'invisible': Not(Equal(Eval('state'), 'installed')), 'readonly': Not(In(%(res.group_admin)d, Eval('groups', [])))}"/>
</xpath>
<xpath
expr="/tree/button[@name=&quot;button_upgrade_cancel&quot;]"
position="replace">
<button string="Cancel Upgrade"
name="button_upgrade_cancel" type="object"
states="{'invisible': Not(Equal(Eval('state'), 'to upgrade')), 'readonly': Not(In(%(res.group_admin)d, Eval('groups', [])))}"/>
</xpath>
</data>
]]>
</field>
</record>
<record model="res.request.link" id="request_link_cron">
<field name="name">Scheduler</field>
<field name="model">ir.cron</field>