-
- Downloads
[FIX] fields: `compute_sudo` defaults to True for stored fields only
The default `compute_sudo=True` makes sense for recomputing stored fields that are indirectly related to a business operation. This ensures that the recomputation of the field does not break an operation that is not aware of the fields to recompute. However, computing non-stored fields in superuser mode is usually not necessary. It even leads to unexpected values: counting a partner's sales orders does not give the same result in superuser mode as in normal mode. That is why non-stored fields are not computed in superuser mode by default. [FIX] account, delivery, event, hr_recruitment, point_of_sale, stock: adapt the model definition to make all fields with the same compute method have the same value for `compute_sudo`. [FIX] sale: split the computation of `invoice_ids`, `invoice_count` (non-stored) and `invoice_status` (stored), as no code is actually shared. closes odoo/odoo#39195 X-original-commit: 843fd38a Signed-off-by:Olivier Dony (odo) <odo@openerp.com>
Showing
- addons/account/models/account_move.py 1 addition, 1 deletionaddons/account/models/account_move.py
- addons/delivery/models/sale_order.py 7 additions, 7 deletionsaddons/delivery/models/sale_order.py
- addons/event/models/event.py 1 addition, 1 deletionaddons/event/models/event.py
- addons/hr_recruitment/models/hr_recruitment.py 2 additions, 2 deletionsaddons/hr_recruitment/models/hr_recruitment.py
- addons/point_of_sale/models/pos_session.py 1 addition, 1 deletionaddons/point_of_sale/models/pos_session.py
- addons/sale/models/sale.py 19 additions, 22 deletionsaddons/sale/models/sale.py
- addons/stock/models/stock_quant.py 1 addition, 1 deletionaddons/stock/models/stock_quant.py
- odoo/addons/test_new_api/tests/test_new_fields.py 2 additions, 0 deletionsodoo/addons/test_new_api/tests/test_new_fields.py
- odoo/fields.py 15 additions, 10 deletionsodoo/fields.py
Loading
Please register or sign in to comment