6c4ac28f332eb5c382512585641865ace3f563ea
Fixes issues where static multi-company filtering would get squashed /
replaced by dynamic domains not having those filters.
The conditional could be replicated in two ways: one would be to use a
python-level conditional expression:
a if cond else b
this is easier for users to interpret, but harder to analyze: python
expressions are currently opaque to view analysis (and possibly
eventually to domain edition).
The alternative here is to leverage domain simplification:
(OR (= (not cond) 1) section)
if `cond` is true becomes
(OR (= 0 1) section)
and thus `section` itself, while if `cond` is false it becomes
(OR (= 1 1) section)
and thus `true` (so the section doesn't apply).
It works OK though the inversion of the condition itself is a bit
bizarre.
And in this specific case since we need both branches the negated
condition requires explicitly converting the condition to a boolean if
it might not be one: the expression compiler recognizes specifically
`(= 0 1)` and `(= 1 1)` (`(= False 1)` and `(= True 1)` also work for
Python reasons).
[REM] dynamic domain from hr_timesheet
closes odoo/odoo#40945
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
…
…
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%