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] stock: slow recurring computation #32990

Closed
wants to merge 1 commit into from

Conversation

nim-odoo
Copy link
Contributor

The methods _compute_is_initial_demand_editable and
_compute_is_locked might have a significant computation time when
triggered during the modification of stock move lines. Indeed, on a
picking, the modification of a single line triggers the recomputation of
all move lines.

We attempt to optimize the process by taking advantage that:

  • the fields are not stored.
  • they globally depend on the picking state, which is something modified
    through action buttons. It shouldn't be modified when editing a
    picking.
  • the default value is False

Thanks to this, we only assign a value when it is True and avoid
unnecessary assignments.

opw-1965248

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

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

The methods `_compute_is_initial_demand_editable` and
`_compute_is_locked` might have a significant computation time when
triggered during the modification of stock move lines. Indeed, on a
picking, the modification of a single line triggers the recomputation of
all move lines.

We attempt to optimize the process by taking advantage that:
- the fields are not stored.
- they globally depend on the picking state, which is something modified
  through action buttons. It shouldn't be modified when editing a
  picking.
- the default value is `False`

Thanks to this, we only assign a value when it is `True` and avoid
unnecessary assignments.

opw-1965248
@nim-odoo nim-odoo self-assigned this Apr 26, 2019
@nim-odoo nim-odoo added the Blocked will not be processed until a blocking point is resolved label Apr 26, 2019
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Apr 26, 2019
@robodoo robodoo added the CI 🤖 Robodoo has seen passing statuses label Apr 26, 2019
@nim-odoo nim-odoo closed this Apr 30, 2019
@nim-odoo nim-odoo deleted the 11.0-opw-1965248-slow_edit-nim branch April 30, 2019 06:21
@robodoo robodoo added closed 💔 and removed CI 🤖 Robodoo has seen passing statuses labels Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked will not be processed until a blocking point is resolved OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants