Browse Source

Add ability to use ('user_id', '=', uid) in a domain

pull/86/head
Alexis de Lattre 10 years ago
parent
commit
4bc6080ce0
  1. 4
      mis_builder/models/mis_builder.py

4
mis_builder/models/mis_builder.py

@ -447,7 +447,9 @@ class MisReportInstancePeriod(models.Model):
res = {} res = {}
for query in self.report_instance_id.report_id.query_ids: for query in self.report_instance_id.report_id.query_ids:
model = self.env[query.model_id.model] model = self.env[query.model_id.model]
domain = query.domain and safe_eval(query.domain) or []
domain = query.domain and safe_eval(
query.domain,
{'uid': self._uid, 'context': self._context}) or []
if query.date_field.ttype == 'date': if query.date_field.ttype == 'date':
domain.extend([(query.date_field.name, '>=', self.date_from), domain.extend([(query.date_field.name, '>=', self.date_from),
(query.date_field.name, '<=', self.date_to)]) (query.date_field.name, '<=', self.date_to)])

Loading…
Cancel
Save