bzr revid: fp@tinyerp.com-20090115174103-2ix4fhc5adviwtyc
This commit is contained in:
Fabien Pinckaers 2009-01-15 18:41:03 +01:00
parent a191ed2d14
commit 5305888c29
5 changed files with 11 additions and 10 deletions

View File

@ -285,7 +285,7 @@ class res_partner_address(osv.osv):
'street2': fields.char('Street2', size=128),
'zip': fields.char('Zip', change_default=True, size=24),
'city': fields.char('City', size=128),
'state_id': fields.many2one("res.country.state", 'State', change_default=True, domain="[('country_id','=',country_id)]"),
'state_id': fields.many2one("res.country.state", 'Fed. State', change_default=True, domain="[('country_id','=',country_id)]"),
'country_id': fields.many2one('res.country', 'Country', change_default=True),
'email': fields.char('E-Mail', size=240),
'phone': fields.char('Phone', size=64),

View File

@ -192,7 +192,9 @@ class expression(object):
self.__exp = self.__exp[:i] + dom + self.__exp[i+1:]
else:
if isinstance(right, basestring): # and not isinstance(field, fields.related):
res_ids = field_obj.name_search(cr, uid, right, [], operator, limit=None)
c = context.copy()
c['active_test'] = False
res_ids = field_obj.name_search(cr, uid, right, [], operator, limit=None, context=c)
right = map(lambda x: x[0], res_ids)
self.__exp[i] = (left, 'in', right)
else:

View File

@ -850,9 +850,6 @@ class orm_template(object):
for f in node.childNodes:
fields.update(self.__view_look_dom(cr, user, f, context))
if ('state' not in fields) and (('state' in self._columns) or ('state' in self._inherit_fields)):
fields['state'] = {}
return fields
def __view_look_dom_arch(self, cr, user, node, context=None):
@ -2313,8 +2310,9 @@ class orm(orm_template):
for f in self._columns.keys(): # + self._inherit_fields.keys():
if not f in vals:
default.append(f)
for f in self._inherit_fields.keys():
if (not f in vals) and (not self._inherit_fields[f][0] in avoid_table):
if (not f in vals) and (self._inherit_fields[f][0] not in avoid_table):
default.append(f)
if len(default):
@ -2333,7 +2331,7 @@ class orm(orm_template):
(table, col, col_detail) = self._inherit_fields[v]
tocreate[table][v] = vals[v]
del vals[v]
# Try-except added to filter the creation of those records whose filds are readonly.
# Example : any dashboard which has all the fields readonly.(due to Views(database views))
try:

View File

@ -243,7 +243,7 @@ class rml_parse(object):
self.cr = cr
self.uid = uid
self.pool = pooler.get_pool(cr.dbname)
user = self.pool.get('res.users').browse(cr, uid, uid)
user = self.pool.get('res.users').browse(cr, uid, uid, fields_process=_fields_process)
self.localcontext = {
'user': user,
'company': user.company_id,
@ -582,7 +582,8 @@ class report_sxw(report_rml):
def getObjects(self, cr, uid, ids, context):
table_obj = pooler.get_pool(cr.dbname).get(self.table)
return table_obj.browse(cr, uid, ids, list_class=browse_record_list, context=context)
return table_obj.browse(cr, uid, ids, list_class=browse_record_list, context=context,
fields_process=_fields_process)
def create(self, cr, uid, ids, data, context=None):
logo = None

View File

@ -88,5 +88,5 @@ class mysocket:
else:
return res[0]
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: