update odoo customize

This commit is contained in:
ivan deng
2020-07-02 14:50:45 +08:00
parent ca2b4a8847
commit 6fa29cb97c
2 changed files with 9 additions and 8 deletions

View File

@@ -36,8 +36,9 @@ class IrModule(models.Model):
def _get_latest_version(self):
default_version = modules.adapt_version('1.0')
for module in self:
module.local_updatable = False
module.installed_version = self.get_module_info(module.name).get('version', default_version)
if module.installed_version and module.latest_version and operator.gt(module.installed_version, module.latest_version):
module.local_updatable = True
else:
module.local_updatable = False

View File

@@ -45,12 +45,12 @@
<field name="inherit_id" ref="base.module_view_kanban"/>
<field name="arch" type="xml">
<!--点击模块看详情-->
<xpath expr="//div[@class='oe_module_vignette']" position="attributes" groups="app_odoo_customize.group_show_quick_upgrade">
<xpath expr="//div[hasclass('oe_module_vignette')]" position="attributes" groups="app_odoo_customize.group_show_quick_upgrade">
<attribute name="class">oe_module_vignette oe_kanban_global_click</attribute>
</xpath>
<!--让模块名更显眼-->
<xpath expr="//div[@class='oe_module_desc']//code" position="replace"/>
<xpath expr="//div[@class='oe_module_desc']//h4" position="after">
<xpath expr="//div[hasclass('oe_module_desc')]//code" position="replace"/>
<xpath expr="//div[hasclass('oe_module_desc')]//h4" position="after">
<code><field name="name"/></code>
</xpath>
<!--显示快速升级-->
@@ -62,11 +62,11 @@
<xpath expr="//div[hasclass('dropdown-menu')]" position="inside">
<a t-if="installed" name="%(app_odoo_customize.action_server_module_multi_get_po)d" type="action" role="menuitem" class="dropdown-item">Export Translation</a>
</xpath>
<xpath expr="//div[@class='oe_module_action']/a[@target='_blank']" position="replace" groups="app_odoo_customize.group_show_quick_upgrade"/>
<xpath expr="//div[hasclass('oe_module_action')]/a[@target='_blank']" position="replace" groups="app_odoo_customize.group_show_quick_upgrade"/>
</field>
</record>
<!--默认打开可更新模块-->
<record id="base.open_module_tree" model="ir.actions.act_window">
<field name="context">{'search_default_is_local_updatable':1}</field>
</record>
<!--<record id="base.open_module_tree" model="ir.actions.act_window">-->
<!--<field name="context">{'search_default_is_local_updatable':1}</field>-->
<!--</record>-->
</odoo>