diff options
| author | P. Christeas <p_christ@hol.gr> | 2009-01-28 15:50:50 +0200 |
|---|---|---|
| committer | P. Christeas <p_christ@hol.gr> | 2009-01-28 15:50:50 +0200 |
| commit | caa5ca5ae2433b0e90cebe4ace6aa7477ce01f9e (patch) | |
| tree | d4038792f08744837c183b7e73c0b279e15d5097 /bin/addons/base/module/module.py | |
| parent | 3c8938fdc39b16fac8ae00ef8c7d40d34985b538 (diff) | |
| parent | 4fff87ad618b808d7f34e473b01905dd3d4479e3 (diff) | |
Merge branch 'master' of openobject-server into mdv-gpl3-py26
Conflicts:
bin/tools/translate.py
bzr revid: p_christ@hol.gr-20090128135050-bb1ueo5ovziijg00
Diffstat (limited to 'bin/addons/base/module/module.py')
| -rw-r--r-- | bin/addons/base/module/module.py | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/bin/addons/base/module/module.py b/bin/addons/base/module/module.py index a4f822a5e16..9eb5e46e575 100644 --- a/bin/addons/base/module/module.py +++ b/bin/addons/base/module/module.py @@ -43,12 +43,12 @@ class module_repository(osv.osv): _description = "Module Repository" _columns = { 'name': fields.char('Name', size=128), - 'url': fields.char('Url', size=256, required=True), + 'url': fields.char('URL', size=256, required=True), 'sequence': fields.integer('Sequence', required=True), 'filter': fields.char('Filter', size=128, required=True, help='Regexp to search module on the repository webpage:\n' '- The first parenthesis must match the name of the module.\n' - '- The second parenthesis must match all the version number.\n' + '- The second parenthesis must match the whole version number.\n' '- The last parenthesis must match the extension of the module.'), 'active': fields.boolean('Active'), } @@ -76,8 +76,8 @@ class module_category(osv.osv): _columns = { 'name': fields.char("Name", size=128, required=True), 'parent_id': fields.many2one('ir.module.category', 'Parent Category', select=True), - 'child_ids': fields.one2many('ir.module.category', 'parent_id', 'Parent Category'), - 'module_nr': fields.function(_module_nbr, method=True, string='# of Modules', type='integer') + 'child_ids': fields.one2many('ir.module.category', 'parent_id', 'Child Categories'), + 'module_nr': fields.function(_module_nbr, method=True, string='Number of Modules', type='integer') } _order = 'name' module_category() @@ -140,7 +140,7 @@ class module(osv.osv): _columns = { 'name': fields.char("Name", size=128, readonly=True, required=True), 'category_id': fields.many2one('ir.module.category', 'Category', readonly=True), - 'shortdesc': fields.char('Short description', size=256, readonly=True, translate=True), + 'shortdesc': fields.char('Short Description', size=256, readonly=True, translate=True), 'description': fields.text("Description", readonly=True, translate=True), 'author': fields.char("Author", size=128, readonly=True), 'website': fields.char("Website", size=256, readonly=True), @@ -487,6 +487,17 @@ class module(osv.osv): logger.notifyChannel('init', netsvc.LOG_CRITICAL, 'module %s: invalid quality certificate: %s' % (mod.name, mod.certificate)) raise osv.except_osv(_('Error'), _('Module %s: Invalid Quality Certificate') % (mod.name,)) + + def create(self, cr, uid, data, context={}): + id = super(module, self).create(cr, uid, data, context) + if data.get('name'): + self.pool.get('ir.model.data').create(cr, uid, { + 'name': 'module_name_translation', + 'model': 'ir.module.module', + 'res_id': id, + 'module': data['name'] + }) + return id module() class module_dependency(osv.osv): |
