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] fix perf issue with sale_order_lot_selection #275

Conversation

sebastienbeau
Copy link
Member

Hi, first thank to Agilebg for this module

I have some perf issue with sale_order_selection_lot. Indeed my customer have more than 4000 lot for a product and when he try to select it in a sale order the function spend 3 min to compute the lot available.
With this change it spend less than 0,023s
What do you think?
@hurrinico @eLBati

Thanks for you're feedback

('id', 'child_of', location.id),
])
# Search all lot existing lot for the product and location selected
self._cr.execute("""SELECT lot_id
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use quants for searching, but without SQL. The performance will be for sure still good. You can use read_group function if you want to increase it. This way, you don't overpass multi-company rules, and so on.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, let's fix it

@sebastienbeau sebastienbeau force-pushed the 8.0-fix-perf-issue-with-sale-order-lot-selection branch 2 times, most recently from ef29da6 to b626fed Compare March 8, 2016 17:48
@sebastienbeau sebastienbeau force-pushed the 8.0-fix-perf-issue-with-sale-order-lot-selection branch from b626fed to 119a5ba Compare March 8, 2016 18:05
@sebastienbeau
Copy link
Member Author

@pedrobaeza everything is green and use read_group ;)

@pedrobaeza
Copy link
Member

Thanks 👍

@hparfr
Copy link

hparfr commented Mar 9, 2016

👍
Less CPU / Memory consumption is better for Earth 🌲 🌍

@bealdav
Copy link
Member

bealdav commented Mar 9, 2016

👍

pedrobaeza added a commit that referenced this pull request Mar 9, 2016
…der-lot-selection

[FIX] fix perf issue with sale_order_lot_selection
@pedrobaeza pedrobaeza merged commit 3d920b6 into OCA:8.0 Mar 9, 2016
@sebastienbeau sebastienbeau deleted the 8.0-fix-perf-issue-with-sale-order-lot-selection branch March 9, 2016 14:09
@eLBati
Copy link
Member

eLBati commented Mar 9, 2016

Thanks 😄

@hurrinico
Copy link

Really Thank You @sebastienbeau 👍

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

6 participants