Géry Debongnie 0cf7b8fd6f [FIX] web: issue with field named "length"
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>
2021-03-03 15:36:34 +00:00
2015-09-08 15:45:09 +02:00
…
2015-09-08 17:58:38 +02:00
2019-11-08 11:24:04 +00:00
2020-09-28 14:07:25 +00:00

Build Status Tech Doc Help Nightly Builds

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

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%