Skip to content

Commit e49c90d

Browse files
[FIX] coding_guidelines: Change camelcase for Pascal case
The coding guidelines establish that we have to write class declaration for both Python and JavaScript in camel case but it's actually in Pascal case. It also establishing that model variable (ex: `Partner = self.env['res.partner]'`) has to be in camel case but it's actually following the Pascal case. Pascal case has to start all variables with a capital letter where camel case is starting with a lower case letter. Source: https://builtin.com/articles/pascal-case-vs-camel-case no task id closes #14709 X-original-commit: 9fa2ffd Signed-off-by: Antoine Vandevenne (anv) <[email protected]> Signed-off-by: Florian Gilbert (flg) <[email protected]>
1 parent 1284e7f commit e49c90d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/contributing/development/coding_guidelines.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ Symbols and Conventions
877877
- When defining *report* model (SQL views e.i.) : use
878878
``<related_base_model>.report.<action>``, based on the Transient convention.
879879

880-
- Odoo Python Class : use camelcase (Object-oriented style).
880+
- Odoo Python Class : use Pascal case (Object-oriented style).
881881

882882

883883
.. code-block:: python
@@ -886,7 +886,7 @@ Symbols and Conventions
886886
...
887887
888888
- Variable name :
889-
- use camelcase for model variable
889+
- use Pascal case for model variable
890890
- use underscore lowercase notation for common variable.
891891
- suffix your variable name with *_id* or *_ids* if it contains a record id or list of id. Don't use ``partner_id`` to contain a record of res.partner
892892

@@ -1017,7 +1017,7 @@ Javascript coding guidelines
10171017
- ``use strict;`` is recommended for all javascript files
10181018
- Use a linter (jshint, ...)
10191019
- Never add minified Javascript Libraries
1020-
- Use camelcase for class declaration
1020+
- Use Pascal case for class declaration
10211021

10221022
More precise JS guidelines are detailed in the `github wiki <https://github.com/odoo/odoo/wiki/Javascript-coding-guidelines>`_.
10231023
You may also have a look at existing API in Javascript by looking Javascript

0 commit comments

Comments
 (0)