diff options
| author | ced <> | 2007-04-21 13:32:18 +0000 |
|---|---|---|
| committer | ced <> | 2007-04-21 13:32:18 +0000 |
| commit | 2302e4492c84cff84e4e7731deebfe3330a1f194 (patch) | |
| tree | 80a5309fb928f10d8c38fe88e1deddd56b957b3b /bin/addons/base/module/wizard | |
| parent | d4d0e528ac7104e21eca7e9087c5e40dc6b37ecf (diff) | |
KERNEL,BASE: allow to create zip modules
bzr revid: ced-4e79fd05ccde4df82f91dece060db6fd1b0e46a3
Diffstat (limited to 'bin/addons/base/module/wizard')
| -rw-r--r-- | bin/addons/base/module/wizard/add_new.py | 14 | ||||
| -rw-r--r-- | bin/addons/base/module/wizard/wizard_update_module.py | 22 |
2 files changed, 19 insertions, 17 deletions
diff --git a/bin/addons/base/module/wizard/add_new.py b/bin/addons/base/module/wizard/add_new.py index 346da18bb11..c86b0812553 100644 --- a/bin/addons/base/module/wizard/add_new.py +++ b/bin/addons/base/module/wizard/add_new.py @@ -46,16 +46,6 @@ _info_arch = '''<?xml version="1.0"?> ''' _info_fields = {} -def get_module_info(name): - try: - f = file(os.path.join(tools.config['addons_path'], name, '__terp__.py'), 'r') - data = f.read() - info = eval(data) - f.close() - except: - return {} - return info - class wizard_install_module(wizard.interface): def watch_dir(self, cr, uid, data, context): mod_obj = pooler.get_pool(cr.dbname).get('ir.module.module') @@ -66,7 +56,7 @@ class wizard_install_module(wizard.interface): for module in modules: if module in known_modules: continue - terp = get_module_info(module) + terp = mod_obj.get_module_info(module) if not terp.get('installable', True): continue imp.load_module(module, *imp.find_module(module)) @@ -80,7 +70,7 @@ class wizard_install_module(wizard.interface): for d in dependencies: cr.execute('insert into ir_module_module_dependency (module_id,name) values (%s, %s)', (mod_id, d)) for module in known_modules: - terp = get_module_info(module) + terp = mod_obj.get_module_info(module) if terp.get('installable', True): for mod in all_mods: if mod['name'] == module and mod['state'] == 'uninstallable': diff --git a/bin/addons/base/module/wizard/wizard_update_module.py b/bin/addons/base/module/wizard/wizard_update_module.py index 5a2ec58912b..996815584a1 100644 --- a/bin/addons/base/module/wizard/wizard_update_module.py +++ b/bin/addons/base/module/wizard/wizard_update_module.py @@ -29,26 +29,38 @@ import wizard import netsvc +import pooler class wizard_update_module(wizard.interface): + + arch = '''<?xml version="1.0"?> +<form string="Scan for new modules"> + <label string="This function will check for new modules in the 'addons' path and on module repository." colspan="4" /> +</form> + ''' + fields = {} + def _update_module(self, cr, uid, data, context): - service = netsvc.LocalService("object_proxy") - service.execute(cr.dbname, uid, 'ir.module.module', 'update_list') + pooler.get_pool(cr.dbname).get('ir.module.module').update_list(cr, uid) return {} def _action_module_open(self, cr, uid, data, context): return { 'domain': "[]", 'name': 'Open Module List', - 'view_type': 'form', - 'view_mode': 'tree,form', - 'res_model': 'ir.module.module', + 'view_type': 'tree', + 'res_model': 'ir.module.category', + 'domain': "[('parent_id', '=', False)]", 'view_id': False, 'type': 'ir.actions.act_window' } states = { 'init': { + 'actions': [], + 'result': {'type': 'form', 'arch': arch, 'fields': fields, 'state': [('end', 'Cancel', 'gtk-cancel'), ('update', 'Check new modules', 'gtk-ok')]} + }, + 'update': { 'actions': [_update_module], 'result': {'type':'state', 'state':'open_window'} }, |
