[FIX] coding_guidelines: fix typos and add sql contraints
task-2977263
closes odoo/documentation#2701
X-original-commit: 8061470577
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Castillo Jonathan (jcs) <jcs@odoo.com>
This commit is contained in:
parent
89cf77f760
commit
7de62ec00e
@ -635,7 +635,7 @@ a different context, the ``with_context`` method should be used :
|
||||
having a field name *my_field* are created, their default value will be set too.
|
||||
|
||||
If you need to create a key context influencing the behavior of some object,
|
||||
choice a good name, and eventually prefix it by the name of the module to
|
||||
choose a good name, and eventually prefix it by the name of the module to
|
||||
isolate its impact. A good example are the keys of ``mail`` module :
|
||||
*mail_create_nosubscribe*, *mail_notrack*, *mail_notify_user_signature*, ...
|
||||
|
||||
@ -744,7 +744,7 @@ update the database even from within a report
|
||||
- within *models.Transient* methods: these methods are called exactly like
|
||||
regular *models.Model* ones, within a transaction and with the corresponding
|
||||
``cr.commit()/rollback()`` at the end
|
||||
- etc. (see general rule above if you have in doubt!)
|
||||
- etc. (see general rule above if you are in doubt!)
|
||||
|
||||
All ``cr.commit()`` calls outside of the server framework from now on must
|
||||
have an **explicit comment** explaining why they are absolutely necessary, why
|
||||
@ -887,8 +887,8 @@ Symbols and Conventions
|
||||
at the beginning of the method.
|
||||
|
||||
- In a Model attribute order should be
|
||||
#. Private attributes (``_name``, ``_description``, ``_inherit``, ...)
|
||||
#. Default method and ``_default_get``
|
||||
#. Private attributes (``_name``, ``_description``, ``_inherit``, ``_sql_constraints``, ...)
|
||||
#. Default method and ``default_get``
|
||||
#. Field declarations
|
||||
#. Compute, inverse and search methods in the same order as field declaration
|
||||
#. Selection method (methods used to return computed values for selection fields)
|
||||
|
Loading…
Reference in New Issue
Block a user