diff options
| author | Raphael Collet <rco@odoo.com> | 2019-08-14 07:35:49 +0000 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2019-08-20 12:43:59 +0000 |
| commit | 9920f20e4c7753bc17bea71dea3a90f7de687196 (patch) | |
| tree | 6a3d0258c10a8ccb1d85949ddafdeb070de78121 /addons/hr_expense/data | |
| parent | e28d3aa4d3851d72deba08c236072d002f83216a (diff) | |
[IMP] models: ORM speedup
This branch is the combination of several optimizations in the ORM:
* store field values once in the cache: the cache reflects more
faithfully the database, only fields that explicitly depend on the
context have an extra indirection in the cache;
* delay recomputations by default: use method `recompute` to explicitly
flush out pending recomputations;
* delay updates in method `write`: updates are stored in a data
structure that can be flushed efficiently to the database with method
`flush` (which also flush out recomputations);
* make method `modified` take advantage of inverse fields to inverse
dependencies;
* filter records by evaluating a domain on records in Python;
* a computed field with `readonly=False` behaves like a normal field
with an onchange method;
* computed fields are computed in superuser mode by default.
Work done by Toufik Ben Jaa, Raphael Collet, Denis Ledoux and Fabien
Pinckaers.
closes odoo/odoo#35659
Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
Diffstat (limited to 'addons/hr_expense/data')
| -rw-r--r-- | addons/hr_expense/data/hr_expense_demo.xml | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/addons/hr_expense/data/hr_expense_demo.xml b/addons/hr_expense/data/hr_expense_demo.xml index a933f86d43e..969cc271e92 100644 --- a/addons/hr_expense/data/hr_expense_demo.xml +++ b/addons/hr_expense/data/hr_expense_demo.xml @@ -96,7 +96,7 @@ <field eval="289.0" name="unit_amount"/> <field name="product_uom_id" ref="uom.product_uom_unit"/> <field eval="1.0" name="quantity"/> - <field name="date" eval="time.strftime('%Y')+'-4-3'"/> + <field name="date" eval="time.strftime('%Y')+'-04-03'"/> </record> <record id="laptop_expense" model="hr.expense"> @@ -107,7 +107,7 @@ <field eval="889.0" name="unit_amount"/> <field name="product_uom_id" ref="uom.product_uom_unit"/> <field eval="1.0" name="quantity"/> - <field name="date" eval="time.strftime('%Y')+'-4-3'"/> + <field name="date" eval="time.strftime('%Y')+'-04-03'"/> </record> <record id="travel_ny_sheet" model="hr.expense.sheet"> @@ -176,7 +176,7 @@ <field name="product_id" ref="car_travel"/> <field eval="0.52" name="unit_amount"/> <field name="product_uom_id" ref="uom.product_uom_unit"/> - <field name="date" eval="time.strftime('%Y')+'-1-15'"/> + <field name="date" eval="time.strftime('%Y')+'-01-15'"/> <field eval="152.0" name="quantity"/> <field name="sheet_id" ref="customer_meeting_sheet"/> </record> @@ -186,7 +186,7 @@ <field name="employee_id" ref="hr.employee_qdp"/> <field name="analytic_account_id" ref="analytic.analytic_nebula"/> <field name="product_id" ref="product_product_fixed_cost"/> - <field name="date" eval="time.strftime('%Y')+'-1-15'"/> + <field name="date" eval="time.strftime('%Y')+'-01-15'"/> <field eval="152.8" name="unit_amount"/> <field eval="1.0" name="quantity"/> <field name="sheet_id" ref="customer_meeting_sheet"/> @@ -204,7 +204,7 @@ <field name="employee_id" ref="hr.employee_fme"/> <field name="analytic_account_id" ref="analytic.analytic_nebula"/> <field name="product_id" ref="product_product_fixed_cost"/> - <field name="date" eval="time.strftime('%Y-%m')+'-5'"/> + <field name="date" eval="time.strftime('%Y-%m')+'-05'"/> <field eval="12.5" name="unit_amount"/> <field eval="12.0" name="quantity"/> <field name="sheet_id" ref="team_building_sheet"/> @@ -215,7 +215,7 @@ <field name="employee_id" ref="hr.employee_fme"/> <field name="analytic_account_id" ref="analytic.analytic_nebula"/> <field name="product_id" ref="product_product_fixed_cost"/> - <field name="date" eval="time.strftime('%Y-%m')+'-5'"/> + <field name="date" eval="time.strftime('%Y-%m')+'-05'"/> <field eval="2.5" name="unit_amount"/> <field eval="17.0" name="quantity"/> <field name="sheet_id" ref="team_building_sheet"/> @@ -226,7 +226,7 @@ <field name="employee_id" ref="hr.employee_fme"/> <field name="analytic_account_id" ref="analytic.analytic_nebula"/> <field name="product_id" ref="product_product_fixed_cost"/> - <field name="date" eval="time.strftime('%Y-%m')+'-5'"/> + <field name="date" eval="time.strftime('%Y-%m')+'-05'"/> <field eval="25" name="unit_amount"/> <field eval="12.0" name="quantity"/> <field name="sheet_id" ref="team_building_sheet"/> @@ -244,7 +244,7 @@ <field name="employee_id" ref="hr.employee_al"/> <field name="analytic_account_id" ref="analytic.analytic_nebula"/> <field name="product_id" ref="product.product_delivery_01"/> - <field name="date" eval="time.strftime('%Y')+'-6-2'"/> + <field name="date" eval="time.strftime('%Y')+'-06-02'"/> <field eval="55.75" name="unit_amount"/> <field eval="6.0" name="quantity"/> <field name="sheet_id" ref="office_furniture_sheet"/> @@ -255,7 +255,7 @@ <field name="employee_id" ref="hr.employee_al"/> <field name="analytic_account_id" ref="analytic.analytic_nebula"/> <field name="product_id" ref="product.product_delivery_02"/> - <field name="date" eval="time.strftime('%Y')+'-6-2'"/> + <field name="date" eval="time.strftime('%Y')+'-06-02'"/> <field eval="28.99" name="unit_amount"/> <field eval="1.0" name="quantity"/> <field name="sheet_id" ref="office_furniture_sheet"/> @@ -267,7 +267,7 @@ <field name="employee_id" ref="hr.employee_stw"/> <field name="analytic_account_id" ref="analytic.analytic_nebula"/> <field name="product_id" ref="product_product_fixed_cost"/> - <field name="date" eval="time.strftime('%Y-')+'-3-15'"/> + <field name="date" eval="time.strftime('%Y')+'-03-15'"/> <field eval="112.58" name="unit_amount"/> <field eval="4.0" name="quantity"/> </record> |
