* add colum which is used in the orm `group_name`

* add field in to the ir_model_fields `group_name`
* add method state_change in to the `ir.module.module`

bzr revid: mga@tinyerp.com-20080820190608-kne60tnsltzdnsfl
This commit is contained in:
mga@tinyerp.com 2008-08-21 00:36:08 +05:30
parent 5dec4f32d3
commit 73c21a4237
4 changed files with 21 additions and 2 deletions

View File

@ -43,7 +43,8 @@ CREATE TABLE ir_model_fields (
state varchar(64) default 'base',
view_load boolean,
relate boolean default False,
primary key(id)
primary key(id),
group_name varchar(128)
);

View File

@ -121,7 +121,7 @@ class ir_model_fields(osv.osv):
'groups': fields.many2many('res.groups', 'ir_model_fields_group_rel', 'field_id', 'group_id', 'Groups'),
'view_load': fields.boolean('View Auto-Load'),
'complete_name': fields.char('Complete Name', required=True, size=64, select=1),
'group_name': fields.char('Group Name', size=128),
}
_defaults = {
'relate': lambda *a: 0,

View File

@ -267,6 +267,23 @@ class module(osv.osv):
_('You try to remove a module that is installed or will be installed'))
return super(module, self).unlink(cr, uid, ids, context=context)
def state_change(self, cr, uid, ids, newstate, context={}, level=50):
if level<1:
raise Exception, _('Recursion error in modules dependencies !')
demo = True
for module in self.browse(cr, uid, ids):
mdemo = True
for dep in module.dependencies_id:
ids2 = self.search(cr, uid, [('name','=',dep.name)])
mdemo = self.state_change(cr, uid, ids2, newstate, context, level-1,)\
and mdemo
if not module.dependencies_id:
mdemo = module.demo
if module.state == 'uninstalled':
self.write(cr, uid, [module.id], {'state': newstate, 'demo':mdemo})
demo = demo and mdemo
return demo
def state_update(self, cr, uid, ids, newstate, states_to_update, context={}, level=50):
if level<1:
raise orm.except_orm(_('Error'), _('Recursion error in modules dependencies !'))

View File

@ -233,6 +233,7 @@ class xmlrpc(object):
class GenericXMLRPCRequestHandler:
def _dispatch(self, method, params):
print 'TERP-CALL : ',method, params
import traceback
try:
n = self.path.split("/")[-1]