return super(ir_property, self).create(cr, uid, self._update_values(cr, uid, None, values), context=context)
def get_by_record(self, cr, uid, record, context=None):
- print 'record type', record.type
if record.type in ('char', 'text'):
return record.value_text
elif record.type == 'float':
return False
def get(self, cr, uid, name, model, res_id=False, context={}):
- print 'Property Get', name, model
domain = self._get_domain(cr, uid, name, model, context=context)
if domain is not None:
domain = [('res_id', '=', res_id)] + domain
nid = self.search(cr, uid, domain, context=context)
- print 'DOMAIN', domain, nid
if not nid: return False
record = self.browse(cr, uid, nid[0], context=context)
- print 'RECORD', record
- res = self.get_by_record(cr, uid, record, context=context)
- print 'Result', res
- return res
+ return self.get_by_record(cr, uid, record, context=context)
return False
def _get_domain_default(self, cr, uid, prop_name, model, context=None):
prop = obj.pool.get('ir.property')
domain = [('fields_id.model', '=', obj._name), ('fields_id.name','in',prop_name), ('res_id','=',False)]
ids = prop.search(cr, uid, domain, context=context)
- print 'GOT IDS', ids, 'FOR', prop_name
replaces = {}
default_value = {}.fromkeys(prop_name, False)
for prop_rec in prop.browse(cr, uid, ids, context=context):