Skip to content

[16.0][FIX] shopfloor_mobile: pass remaining quantity across packaging loop iterations - #1268

Open
nicolas-delbovier-acsone wants to merge 1 commit into
OCA:16.0from
acsone:16.0-fix-shopfloor-mobile-packaging-qty-picker-NaN-input
Open

[16.0][FIX] shopfloor_mobile: pass remaining quantity across packaging loop iterations#1268
nicolas-delbovier-acsone wants to merge 1 commit into
OCA:16.0from
acsone:16.0-fix-shopfloor-mobile-packaging-qty-picker-NaN-input

Conversation

@nicolas-delbovier-acsone

@nicolas-delbovier-acsone nicolas-delbovier-acsone commented Sep 11, 2026

Copy link
Copy Markdown

Bug introduced in #1088

When calculating quantities per packaging in _product_qty_by_packaging, the initial qty parameter was passed to _qty_by_pkg at every packaging level without updating the remaining unallocated quantity.

As a result, smaller packaging units calculated their required quantity against the full initial amount rather than the remainder left by larger packaging units. This inflated the total calculated in compute_qty(), triggering a reactive watcher feedback loop that compounded the total on every tick until overflowing to NaN.

How to reproduce the error

image
  • Enter a shopfloor screen with the "packaging-qty-picker" inside
  • (Optional) Ensure you only have one product.packaging for this product
  • Input something ">=" to the qty of the given packaging

cc @jbaudoux @lmignon

… iterations

When calculating quantities per packaging in `_product_qty_by_packaging`, the initial `qty` parameter was passed to `_qty_by_pkg` at every packaging level without updating the remaining unallocated quantity.

As a result, smaller packaging units calculated their required quantity against the full initial amount rather than the remainder left by larger packaging units. This inflated the total calculated in `compute_qty()`, triggering a reactive watcher feedback loop that compounded the total on every tick until overflowing to `NaN`.
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @simahawk,
some modules you are maintaining are being modified, check this out!

@lmignon lmignon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

😱 An annoying one, and not an easy one to debunk! BTW, the code readability is improved...

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.

3 participants