diff options
| author | wan <wan@odoo.com> | 2020-08-12 15:29:15 +0000 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2020-08-20 07:45:18 +0000 |
| commit | f2ceef0e2f0efb2e47b5f595a80009184305a2c4 (patch) | |
| tree | fc890511b910167a2ecec0881ddd7169007cbe10 /odoo/osv/expression.py | |
| parent | 9ad16bf84a0a1e33426105ec20670042e00f19b9 (diff) | |
[IMP] core: add models defined by a query instead of a table/view
By adding a parameter `_table_query` on the Model, we can now have views
that depend on the context. The query is used instead of the table name
in ORM operations. This allows to pre-compute some values to improve
performance, instead of storing context values in the database.
Co-authored-by: william-andre <wan@odoo.com>
Co-authored-by: rco-odoo <rco@odoo.com>
Diffstat (limited to 'odoo/osv/expression.py')
| -rw-r--r-- | odoo/osv/expression.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/osv/expression.py b/odoo/osv/expression.py index 87208bba372..aba79c3859d 100644 --- a/odoo/osv/expression.py +++ b/odoo/osv/expression.py @@ -432,7 +432,7 @@ class expression(object): self.expression = distribute_not(normalize_domain(domain)) # this object handles all the joins - self.query = Query(model.env.cr, model._table) if query is None else query + self.query = Query(model.env.cr, model._table, model._table_query) if query is None else query # parse the domain expression self.parse() |
