update grn menu

This commit is contained in:
ivan deng
2020-03-19 15:13:00 +08:00
parent 2b8439c2e5
commit d910aba991
2 changed files with 9 additions and 7 deletions

View File

@@ -23,7 +23,7 @@
{ {
'name': 'Customize odoo OEM (Boost, My Odoo)', 'name': 'Customize odoo OEM (Boost, My Odoo)',
'version': '13.20.03.15', 'version': '13.20.03.19',
'author': 'Sunpop.cn', 'author': 'Sunpop.cn',
'category': 'Productivity', 'category': 'Productivity',
'website': 'https://www.sunpop.cn', 'website': 'https://www.sunpop.cn',

View File

@@ -14,7 +14,8 @@ class IrModule(models.Model):
# installed_version = fields.Char('Latest Version', compute='_get_latest_version') # installed_version = fields.Char('Latest Version', compute='_get_latest_version')
# latest_version = fields.Char('Installed Version', readonly=True) # latest_version = fields.Char('Installed Version', readonly=True)
local_updatable = fields.Boolean('Local updatable', compute='_get_latest_version', default=False, store=True) local_updatable = fields.Boolean('Local updatable', compute='_get_latest_version',
compute_sudo=True, default=False, store=True)
def module_multi_uninstall(self): def module_multi_uninstall(self):
""" Perform the various steps required to uninstall a module completely """ Perform the various steps required to uninstall a module completely
@@ -34,8 +35,9 @@ class IrModule(models.Model):
@api.depends('name') @api.depends('name')
def _get_latest_version(self): def _get_latest_version(self):
super(IrModule, self)._get_latest_version() default_version = modules.adapt_version('1.0')
for rec in self: for module in self:
rec.local_updatable = False module.installed_version = self.get_module_info(module.name).get('version', default_version)
if rec.installed_version and rec.latest_version and operator.gt(rec.installed_version, rec.latest_version): if module.installed_version and module.latest_version and operator.gt(module.installed_version, module.latest_version):
rec.local_updatable = True module.local_updatable = True