[FIX] Typo
bzr revid: stephane@tinyerp.com-20090106162421-w79hcim4hrlpp80a
This commit is contained in:
@@ -176,7 +176,7 @@ class module(osv.osv):
|
||||
'menus_by_module': fields.function(_get_views, method=True, string='Menus', type='text', multi="meta", store=True),
|
||||
'reports_by_module': fields.function(_get_views, method=True, string='Reports', type='text', multi="meta", store=True),
|
||||
'views_by_module': fields.function(_get_views, method=True, string='Views', type='text', multi="meta", store=True),
|
||||
'certificat' : fields.char('Certificat', size=64, readonly=True),
|
||||
'certificate' : fields.char('Certificate', size=64, readonly=True),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
@@ -188,28 +188,28 @@ class module(osv.osv):
|
||||
|
||||
_sql_constraints = [
|
||||
('name_uniq', 'unique (name)', 'The name of the module must be unique !'),
|
||||
('certificat_uniq', 'unique (certificat)', 'The certificat ID of the module must be unique !')
|
||||
('certificate_uniq', 'unique (certificate)', 'The certificate ID of the module must be unique !')
|
||||
]
|
||||
|
||||
def _check_certificat(self, cr, uid, ids):
|
||||
def _check_certificate(self, cr, uid, ids):
|
||||
if not ids:
|
||||
return True
|
||||
|
||||
logger = netsvc.Logger()
|
||||
for mod in self.browse(cr, uid, ids):
|
||||
if not mod.certificat:
|
||||
logger.notifyChannel('', netsvc.LOG_WARNING, 'module %s: no certificat' % mod.name)
|
||||
if not mod.certificate:
|
||||
logger.notifyChannel('', netsvc.LOG_WARNING, 'module %s: no certificate' % mod.name)
|
||||
else:
|
||||
try:
|
||||
val = long(mod.certificat) % 97 == 29
|
||||
val = long(mod.certificate) % 97 == 29
|
||||
if not val:
|
||||
raise Exception('Invalid Certificat')
|
||||
raise Exception('Invalid Certificate')
|
||||
except Exception, ex:
|
||||
return False
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
(_check_certificat, "Your certificat is wrong !", ['certificat']),
|
||||
(_check_certificate, "Your certificate is wrong !", ['certificate']),
|
||||
]
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
@@ -332,7 +332,7 @@ class module(osv.osv):
|
||||
'author': terp.get('author', 'Unknown'),
|
||||
'website': terp.get('website', ''),
|
||||
'license': terp.get('license', 'GPL-2'),
|
||||
'certificat': terp.get('certificat', ''),
|
||||
'certificate': terp.get('certificate', ''),
|
||||
})
|
||||
cr.execute('DELETE FROM ir_module_module_dependency WHERE module_id = %s', (id,))
|
||||
self._update_dependencies(cr, uid, ids[0], terp.get('depends', []))
|
||||
@@ -352,7 +352,7 @@ class module(osv.osv):
|
||||
'author': terp.get('author', 'Unknown'),
|
||||
'website': terp.get('website', ''),
|
||||
'license': terp.get('license', 'GPL-2'),
|
||||
'certificat': terp.get('certificat', ''),
|
||||
'certificate': terp.get('certificate', ''),
|
||||
})
|
||||
res[1] += 1
|
||||
self._update_dependencies(cr, uid, id, terp.get('depends', []))
|
||||
@@ -433,7 +433,7 @@ class module(osv.osv):
|
||||
'author': terp.get('author', 'Unknown'),
|
||||
'website': terp.get('website', ''),
|
||||
'license': terp.get('license', 'GPL-2'),
|
||||
'certificat': terp.get('certificat', ''),
|
||||
'certificate': terp.get('certificate', ''),
|
||||
})
|
||||
cr.execute('DELETE FROM ir_module_module_dependency ' \
|
||||
'WHERE module_id = %s', (mod.id,))
|
||||
|
||||
Reference in New Issue
Block a user