90f235fceff96f4dd060b142a1073ce37bd0f7a2
When the user tries to add properties field in domain of a model
without property name the error occurs.
To reproduce the issue:
- Install knowledge module.
- Go to Settings > Technical > User Defined Filters.
- Enter a name, add 'Knowledge Article' as model and then add domain
[('article_properties', '!=', False)].
- Click on save button and then on refresh button below code editor of domain.
- The traceback will be generated
Error: IndexError: list index out of range
The issue is occurring because we are getting single element
in path over here -
https://github.com/odoo/odoo/blob/f4e60765db57fe3612f267e8fa44d10ccf5ff107/odoo/osv/expression.py#L649
but we are trying to access path[1] due to which IndexError is occurring
over here -
https://github.com/odoo/odoo/blob/f4e60765db57fe3612f267e8fa44d10ccf5ff107/odoo/osv/expression.py#L683
and here -
https://github.com/odoo/odoo/blob/f4e60765db57fe3612f267e8fa44d10ccf5ff107/odoo/osv/expression.py#L687
The condition is also wrong over here -
https://github.com/odoo/odoo/blob/f4e60765db57fe3612f267e8fa44d10ccf5ff107/odoo/osv/expression.py#L683-L684
in which we are checking length of path is not equals to 2 and then also
we are trying to access path[1], due to which ValueError becomes a dead code.
To fix this issue 'and' is replaced with 'or' in that condition.
sentry-4499339271
closes odoo/odoo#141533
X-original-commit: da41853fc93a60a0a05083d79f0bb08f429cded9
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
Signed-off-by: Saurabh Choraria (sauc) <sauc@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%