-
-
Notifications
You must be signed in to change notification settings - Fork 267
linting field names? #385
Comments
An excellent idea 👍 |
Thanks for report. I didn't find the piece of js code with the problem. |
|
@moylop260 the issue is related specifically to the use of Here's a solid sample: https://github.com/gdgellatly/odoo_bug_demos/search?utf8=%E2%9C%93&q=length |
I got it Are there another fields name reserved for js? |
I can't think of any right now. But I also couldn't think of |
thanks! |
@hbrunn |
I'd write something like
|
Notwithstanding that length is already used as field name in odoo core on product model. Years I dealt with that issue. |
* [REF] attribute-deprecated: Deprecate length class attribute Related issue: OCA/maintainer-quality-tools#385 and odoo/odoo#13780 * [REF] .travis.yml: Disable F999 Disable the error: "dictionary key 'name' repeated with different value" This error is duplicated from pylint.
* [REF] global refactoring: better message output and use real file and line number in non-py files (#62) [REF] global refactoring: better message output and use real file and line number in non-py files Change from `pylint_odoo/test_repo/broken_module/__init__:1: [W7910(wrong-tabs-instead-of-spaces), ] model_view_odoo.xml:23 Use wrong tabs indentation instead of four spaces` to `pylint_odoo/test_repo/broken_module/model_view_odoo.xml:23: [W7910(wrong-tabs-instead-of-spaces), ] Use wrong tabs indentation instead of four spaces` * [FIX] rst-syntax-error: Skip unknown directives * [FIX] rst-syntax-error: Skip unknown roles * [ADD] missing-import-error, missing-manifest-dependency * [REF] README: Update messages list Signed-off-by: Moisés López <moylop260@vauxoo.com> * Adding isort dependency (#70) * [REF] requirements: Update developer version of pylint and astroid * [ADD] Support for 10.0 manifest name * [REF] missing-import-error: Skip test file since these files are loaded only when running tests and in such a case your module and their external dependencies are installed. * [IMP] manifest-version-format: Add valid_odoo_versions parameter to force a valid version of odoo in the manifest version * [FIX] missing-import-error: Updating libraries used from requirements.txt but not imported or nested imported from odoo * [FIX] manifest-version-format: Support -e manifest-version-format only * [FIX] manifest-version-format: Fix regex to use explicit dot instead of any char * [FIX] Whitelist `anybox.testing.openerp` * Add `anybox.testing.openerp` - Fixes #81 * [ADD] missing-return If you use call a `super` method then you will need return the original value. If you want overwrite a original method then you need add documentation of why and add a `pylint: disable=missing-return` * [REF] attribute-deprecated: Deprecate length class attribute (#86) * [REF] attribute-deprecated: Deprecate length class attribute Related issue: OCA/maintainer-quality-tools#385 and odoo/odoo#13780 * [REF] .travis.yml: Disable F999 Disable the error: "dictionary key 'name' repeated with different value" This error is duplicated from pylint. * [FIX] method-NAME: Fix case compute=None Fix OCA#88
In odoo/odoo#13780, a quite difficult to find bug was introduced by the fact that some javascript code breaks if a record has a column with the name
length
.The specific instance where this was problematic is fixed in odoo core now, but I assume a lot of community addons will have a problem with this too. As it's probably not feasible to work around the problem in every module, should we introduce a lint test that forbids some field names? In this case, it would be
length
, but I can also think of a couple of other field names I'd like to forbid, like python keywords.The text was updated successfully, but these errors were encountered: