Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master sale computes vfe #42709

Draft
wants to merge 11 commits into
base: master
from
Draft

Conversation

@Feyensv
Copy link
Contributor

Feyensv commented Jan 3, 2020

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@robodoo robodoo added the seen 🙂 label Jan 3, 2020
@C3POdoo C3POdoo added the RD label Jan 3, 2020
@Feyensv Feyensv force-pushed the odoo-dev:master-sale-computes-vfe branch 2 times, most recently from 06f2c23 to 619f202 Jan 14, 2020
@Feyensv Feyensv force-pushed the odoo-dev:master-sale-computes-vfe branch 4 times, most recently from f18bc6d to cc78dfc Mar 19, 2020
odoo/models.py Outdated Show resolved Hide resolved
@Feyensv Feyensv force-pushed the odoo-dev:master-sale-computes-vfe branch 2 times, most recently from 23bea95 to 225ad86 Mar 23, 2020

SaleOrder = self.env["sale.order"]

if "sale_order_template_id" in SaleOrder._fields.keys():

This comment has been minimized.

Copy link
@Feyensv

Feyensv Mar 23, 2020

Author Contributor

keys() not needed.

@Feyensv Feyensv force-pushed the odoo-dev:master-sale-computes-vfe branch 5 times, most recently from 852d0f3 to dffb0fd Mar 23, 2020
@Feyensv Feyensv force-pushed the odoo-dev:master-sale-computes-vfe branch from ad11557 to eab241a Mar 25, 2020
@Feyensv Feyensv force-pushed the odoo-dev:master-sale-computes-vfe branch 4 times, most recently from 53e07a9 to 903be79 Mar 25, 2020
Feyensv added 6 commits Jan 13, 2020
Until now, stored compute fields were computed after database insertion.

This meant that required fields or constraints couldn't be used on
computed fields, unless a default was specified.

But using a default meant that the field wasn't computed after insertion
either, because it was protected against recomputation.

We sometimes do want to explicitly compute some computed stored fields
AFTER INSERT, mainly:

* statistics fields computed with search/read_group/...
* fields potentially referencing the current record (e.g.
res.partner.commercial_partner_id)
* field referencing the first one of a m2m/o2m relational field (only if
stored)
* fields depending on the create_date/write_date/create_uid/write_uid
...

Those fields can be specified as pre_compute=False to force their
computation post record creation.
@Feyensv Feyensv force-pushed the odoo-dev:master-sale-computes-vfe branch from 903be79 to 9ae60f3 Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.