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

[16.0][IMP] stock_available_immediately_exclude_location: Deducte the quants in excluded locations for free_qty of products #26

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

QuocDuong1306
Copy link

Context:

  • For now, Odoo calculates the availability of products to show on SO without deducting the qty in excluded locations:
    • Widget to show available quanties of product: here
    • free_qty_today comes from free_qty field of product (It is computed from here)
    • But it didn't exclude the locations that enable exclude_from_immediately_usable_qty : here

Changes:

  • Add more context in _compute_quantities_dict to avoid making recursive in method
  • Re-compute free_qty by deducting the qty in excluded locations
  • Refactor code in a clean way

Result: (Forecasted qty and Available qty)

image
image

…s in excluded locations for free_qty of products
Copy link

@cyrilmanuel cyrilmanuel left a comment

Choose a reason for hiding this comment

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

not an expert but LGTM

Comment on lines 15 to 18
"""
change the way immediately_usable_qty is computed by deducing the quants
Re-compute the the `free to use` qty by deducting the quants
in excluded locations
"""
Copy link

Choose a reason for hiding this comment

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

Better to not override the original docstring of the method and to write this as a comment instead

Comment on lines +35 to +38
"""
change the way immediately_usable_qty is computed by deducting the quants
in excluded locations
"""
Copy link

Choose a reason for hiding this comment

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

Same remark (the docstring was already there but better to fix it)

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.

3 participants