diff --git a/openerp/osv/expression.py b/openerp/osv/expression.py index cb8cfea583f..ff2528db73d 100644 --- a/openerp/osv/expression.py +++ b/openerp/osv/expression.py @@ -450,7 +450,7 @@ class expression(object): # field could not be found in model columns, it's probably invalid, unless # it's one of the _log_access special fields # TODO: make these fields explicitly available in self.columns instead! - if field_path[0] not in MAGIC_COLUMNS: + if (field_path[0] not in MAGIC_COLUMNS) and (left not in MAGIC_COLUMNS): raise ValueError("Invalid field %r in domain expression %r" % (left, exp)) continue diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index 0dd7d487bba..37dd1010d2f 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -2556,7 +2556,8 @@ LOG_ACCESS_COLUMNS = { 'write_date': 'TIMESTAMP' } # special columns automatically created by the ORM -MAGIC_COLUMNS = ['id'] + LOG_ACCESS_COLUMNS.keys() +MAGIC_COLUMNS = ['id'] + LOG_ACCESS_COLUMNS.keys() + \ + ['internal.create_uid', 'internal.date_access'] # for osv_memory only class orm(orm_template): _sql_constraints = []