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

[FIX] don't recompute old fields if recompute=False #6626

Closed
wants to merge 2 commits into from

Conversation

hbrunn
Copy link
Contributor

@hbrunn hbrunn commented May 8, 2015

This changes make _write() behave like _create() in respect of context['recompute'] and env.recompute: https://github.com/odoo/odoo/blob/8.0/openerp/models.py#L4266

@pedrobaeza
Copy link
Collaborator

runbot errors seems unrelated.

@gurneyalex
Copy link
Contributor

OCA runbot is green on the corresponding OCB PR.

@clonedagain
Copy link

Is this really a fix or rather an optimization?
Are we currently at risk of getting inconsistent data without this patch?

@hbrunn
Copy link
Contributor Author

hbrunn commented Jun 3, 2015

For as much as I oversee it, it's an optimization - but one that can really hurt if it's not there.

I think you should be able to produce an infinite loop if you have two old style function fields that trigger a store on each other.

@mdietrichc2c
Copy link
Contributor

I found an error case without this PR, which is fixed by using it:

  1. create an object with a field belonging to recompute_old but not recomputing (in my case, it was account.journal.period, and the company_id related field),
  2. rollback the object, but don't raise the exception (recompute_old is not emptied),
  3. write something else entirely: the recompute_old will only be tried there, and fail, since the account.journal.period does not exist anymore.

Using this PR, the field will not be added at creation time, fixing the behavior.

👍 as a fix rather than an optimization.

@lepistone
Copy link
Contributor

The code affected by this has changed. @mdietrichc2c made two updated PRs: OCA#342 and
#8919.

This one can be closed.

@C3POdoo
Copy link
Contributor

C3POdoo commented Dec 13, 2017

Hello,

This is an automatic message.

Thank you for your contribution but the version 8.0 is no longer supported. We only support the last 3 stable versions so no longer accepts patches into this branch.
We apology if we could not look at your request in time.

If the contribution still makes sense for the upper version, please let us know and do not hesitate to recreate one for the recent versions. We will try to check it as soon as possible.

Regards,

@C3POdoo C3POdoo closed this Dec 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants