Skip to content
Permalink
Browse files

[IMP] fields: document the new pre_compute field attribute

  • Loading branch information
Feyensv committed Jan 14, 2020
1 parent aa13957 commit f78a0981e1d532810e5552613a7510f2e0626914
Showing with 12 additions and 0 deletions.
  1. +12 −0 odoo/fields.py
@@ -187,6 +187,18 @@ class Field(MetaField('DummyField', (object,), {})):
.. seealso:: :ref:`Advanced Fields/Compute fields <reference/fields/compute>`
:param bool pre_compute: whether the field should be computed after record insertion
in database (e.g. statistics fields based on search/read_group), many2one
linking to the previous record, ...
.. note::
Since https://github.com/odoo/odoo/pull/42560, stored computes are computed
before record creation to allow enforcing SQL constraints (and required)
on computed fields (readonly or not). This means that some computed fields
have to be manually specified as pre_compute=False if their computation method
or their behavior needs it.
:param bool compute_sudo: whether the field should be recomputed as superuser
to bypass access rights (by default ``True`` for stored fields, ``False``
for non stored fields)

0 comments on commit f78a098

Please sign in to comment.
You can’t perform that action at this time.