Skip to content

Conversation

@hbrunn
Copy link
Member

@hbrunn hbrunn commented Nov 26, 2015

No description provided.

@StefanRijnhart
Copy link
Member

Does this prevent fetching all the other regular fields from the records?

@sebalix
Copy link
Contributor

sebalix commented Nov 26, 2015

Hi,

What kind of error did you encounter? (just to understand the fix and the prefetch_fields context key)

@hbrunn
Copy link
Member Author

hbrunn commented Nov 26, 2015

It prevents fetching fields not requested, in my case function fields. And this is not a fix for an error, but a fix for performace.
The key's explanation is here: https://github.com/OCA/OCB/blob/9.0/openerp/models.py#L3238

@hbrunn hbrunn added this to the 8.0 milestone Nov 26, 2015
@sebalix
Copy link
Contributor

sebalix commented Nov 26, 2015

In our case, we use it to log computed fields (say, fields B and C) based on the field A. This way we have a complete log when the field A is updated. Does this break this use case?
As you say, it can be very slow, and I have in mind another feature: choose the log policy on the rule:

  • full log (as it is now, including the computed values, default)
  • restricted log (to log just the fields which are updated - the vals -, avoiding the read operations before/after the CRUD query, speeding the log process)

@hbrunn
Copy link
Member Author

hbrunn commented Nov 26, 2015

for the current model, it reads all fields anyways (we pass _fields), so your use case won't be impacted. But depending on the calling tree, he would prefetch way too many other fields in other models while doing the computation

@sebalix
Copy link
Contributor

sebalix commented Nov 26, 2015

You are right, I tested on the runbot, there is no impact. 👍

@StefanRijnhart
Copy link
Member

👍

@sebalix
Copy link
Contributor

sebalix commented Jan 5, 2016

Hi,

5 days have passed, is there someone available to merge this please?

@guewen
Copy link
Member

guewen commented Jan 5, 2016

👍
Thanks!

guewen pushed a commit that referenced this pull request Jan 5, 2016
[FIX] turn off prefetching when reading values
@guewen guewen merged commit 9e4544d into OCA:8.0 Jan 5, 2016
SiesslPhillip pushed a commit to grueneerde/OCA-server-tools that referenced this pull request Nov 20, 2024
Syncing from upstream OCA/server-tools (11.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants