summaryrefslogtreecommitdiff
path: root/odoo/addons/base/tests/test_expression.py
AgeCommit message (Collapse)Author
2019-03-06[MERGE] forward port branch saas-11.3 up to 3e54704e669Christophe Simonis
2019-03-05[MERGE] forward port branch 11.0 up to 27081bf6f5fChristophe Simonis
2019-03-04[MERGE] forward port branch saas-15 up to 1f1fa35c072Christophe Simonis
2019-02-20[FIX] expression: properly handle {TRUE,FALSE}_LEAFAdrian Torres
Before this commit, doing expression.OR() with only FALSE_LEAF would yield [] which is equivalent to TRUE_LEAF and is therefore not correct. The same happened (to a lesser extent) with expression.AND() within an expression.OR(), since the former would return a [] which would be ignored by expression.OR(). See tests for a clearer view of the use cases. Fixes #30113, #26540 closes odoo/odoo#31202
2018-07-25[IMP] base: Improve partners/employees demo dataYannick Tivisse
- Update all the pictures - Rename the partners with a name that is easy to say for an English speaker (No more 'Agwoleight') - Update all the addresses/phone numbers in the american format - Unify the demo data with the new theme (Wood shop/manufacture,...)
2018-07-05[IMP] product: Unify/Clean product demo dataFabien Pinckaers
PURPOSE ======= 1. Unified product demo data 2. Less demo: one per use case 3. Demo data for all models Specification ============= 1. Refactor all the brol in the demo data 2. Adapt the tests to make them green, as some products are renamed, removed, created in python instead of as demo data ...
2018-06-04[FIX] expression: interpret `(X, 'child_of', False)` as falsePierre Masereel
Interpret such domains that do not really make sense as falsy, and log a warning when it occurs.
2018-04-06[FIX] osv.expression: normalize domains in combineAdrian Torres
Before this rev: * Take 2 domains that contain at least two leaves, and at least one of them must use the implicit `&` operator e.g.: d1 = [('so_line', 'in', [91]), ('amount', '<=', 0.0)] d2 = ['&', ('so_line', 'in', []), ('project_id', '!=', False)] * Perform osv.expression.OR() between both domains Expected result: d3 = ['|', d1, d2] Actual result (after normalization): d3 = ['&', '|', d1, d2] This is because, since the `&` is implicit for the first domain, when we OR it, we give it an explicit `|` operator, so when we pass this domain through the normalize_domain function, d1 no longer contains an implicit `&` operator but instead the implicit operator is the one between d1 and d2, therefore giving us a completely wrong domain. The `combine` function states that it only accepts normalized domains, however neither the OR nor AND functions do, this leads to a lot of developers putting non-normalized domains into these functions, and there's no error checking or anything that obviously indicates that the domain is incorrect, so we might as well normalize all domains being passed since it's already pretty optimized.
2017-09-28[MERGE] forward port branch saas-16 up to 89df681b458Christophe Simonis
2017-09-28[MERGE] forward port branch saas-15 up to da15615c45aChristophe Simonis
2017-09-27[FIX] base: tests, reflect unaccent behavior of ↵Denis Ledoux
5e3de76f363d5effb426e3a14e84a3b8e53681b4 Since the revision 5e3de76f363d5effb426e3a14e84a3b8e53681b4 The `::text` is included within the `unaccent` call The expession tests have never been changed according to this change of behavior in the building of the unaccented queries. This has never been detected by runbot because you need to start the Odoo server with the option `--unaccent` and to create the database with the unaccent extension `CREATE EXTENSION unaccent` to be able to fail the former tests, and this is not the case on runbot.
2017-08-24[MERGE] forward port branch saas-17 up to 877e7098719Christophe Simonis
2017-08-20[FIX] P3: remove pycompat.{keys,items,values} helpersOlivier Dony
Now that we're closer to switching to P3 for good, these helpers have outlived their usefulness, and mostly add noise. All remaining dict.iter*() or dict.view*() must be converted to the normal keys(), values() or items() calls. Whenever the result is likely to be used for more than the scope of a loop, or when the dict needs to be modified during iteration, the calls must be wrapped in a ``list()``, to protect the new P3 semantics. Those cases are very exceptional. Also removed some dead code or improved the API to remove unnecessary conversions.
2017-08-04[IMP] base: countries/territories list cleaningRichard Mathot
The world changes and some country names too : - Anguilla is not a part of Saint Kitts and Nevis anymore (1980) - East Timor is now called Timor-Leste and has a new ISO code (2002) - Netherlands Antilles have been split in CW, SX, BQ (2010) - Neutral Zone between Irak and Saudi Arabia does not exist anymore (1991) - The U.N. now use "State of Palestine" for West Bank and Gaza (2012) - Yugoslavia has been split (1992) then some remaining parts renamed as "Serbia and Montenegro" (2003) - Zaire is now called Democratic Republic of the Congo (1997) We also fixed/simplified names of other countries/territories when there is a more vernacular name that is not ambiguous or simply a typo source: https://www.iso.org/obp/ui/en/#search (We also fix a test that count countries beginning by Z, and there is no Zaire anymore)
2017-05-22[FIX] P3: import pattern which doesn't seem to work rightXavier Morel
``import odoo.addons.foo as bar`` doesn't seem to properly trigger the import hook in Python 3 (it blows up on decimal_precision and base). Thus convert *all* examples of that pattern to the more sensible ``from odoo.addons import foo as bar``.
2017-05-10[FIX] P3: list -> iterable builtins (#16811)xmo-odoo
In Python 3: * various builtins and dict methods were changed to return view/iterable objects rather than lists * and the separate Python 2 view/iterable builtins and methods were removed altogether This is problematic when using these items as list (which the happens repeatedly in Odoo), but more viciously when iterating *multiple times* over them (which also happens, which I've messed up multiple times while writing this, and which is a pain to debug even when you've just created the issue). Convert all code using these to semantics-matching cross-version helper functions to get the LCD behaviour between P2 and P3, and forbid the builtins via lint. issue #8530
2017-04-27[FIX] builtins removed from Python 3xmo-odoo
* Reverse wrapper courtesy of @rco-odoo's original P3 branch * thin compat module stripped down from werkzeug (to augment as needed) issue 8530
2017-04-12[MERGE] forward port branch saas-11 up to f830c7c3e31Christophe Simonis
2017-01-03[FIX] expression: multi-level expressions with magic columnsRaphael Collet
2016-09-02[FIX] adapt logger namesRaphael Collet
2016-09-02[REF] openerp: move `openerp` to `odoo`Raphael Collet