0cf7b8fd6f80c643fb53a980cf551990ca8070da
The underscore (_) library has a bug in which the _.each method does not work with object which contains a "length" property. This is because it does look for that key and if it is a number, it will assume that it is an array with that length value. Nicely done... If that length value is set to 0, then it will just do nothing, since it thinks that it is dealing with an empty array. Note that if the value is set to an object, _.each is smart enough to notice that it cannot be an array, and will do the correct thing in this case. Usually, our _.each calls are safe, since we usually iterate on arrays, or on object with safe keys, or on object with values that cannot be a number. But there was 2 unsafe calls in basic_model, which leads to strange bugs: some code is skipped, and the form view is then confused. The motivation for this fix is the fact that onchanges are not applied at all, if there is a length field set to 0. To fix this, we can just avoid using _.each. Note to every Odoo JS developers reading this: new Odoo code should avoid using the _ and $ libraries, because we do not really need them, and we want to keep our dependencies to the strict mininum. OPW: #2465808 closes odoo/odoo#66126 closes odoo/odoo#67172 X-original-commit: 8dbd1efef899fb637acca3c318ae99cb23838b8f Signed-off-by: Aaron Bohy (aab) <aab@odoo.com> Signed-off-by: Géry Debongnie (ged) <ged@openerp.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%