Skip to content

Conversation

@TDu
Copy link
Member

@TDu TDu commented Jan 7, 2026

Finally fixing the broken function after the commit described below

Revert

It breaks the module shopfloor_delivery_shipment

Because this function

relies on the is_done field. And it is not covered by tests 😞

Also there is a fix proposed on odoo for the root cause of the issue

@OCA-git-bot
Copy link
Contributor

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

@jbaudoux
Copy link
Contributor

jbaudoux commented Jan 8, 2026

@TDu When the move line is marked as picked by the move line load_shipment, the package level is then also marked as is_done. However, I see the compute is_done is lacking a depends on move_line_ids.picked
https://github.com/odoo/odoo/blob/80a1f0e8208c52c8995ccf4ebb24db1bf8ead8a1/addons/stock/models/stock_package_level.py#L42

If we write also the current quantity when we mark as picked, will it trigger the compute is_done?
Otherwise, let's explicitly call the compute method.

This way, it will work without the patch on odoo. Also I prefer we don't rely on is_done if possible as this is dropped in odoo v19.

@TDu TDu force-pushed the 18-revert-load-package-fix branch from 584b722 to 77dc424 Compare January 8, 2026 15:34
Following the change from the PR

* OCA#200

There was an issue with the is loaded function on package level.

This fixes the function by not relying on the state of the package
level but the state of move lines it contains.
@TDu TDu force-pushed the 18-revert-load-package-fix branch from 77dc424 to 3cad079 Compare January 8, 2026 15:52
@TDu
Copy link
Member Author

TDu commented Jan 8, 2026

Added a unit test

@TDu TDu changed the title [18.0][FIX] shipment advice revert shipment_advice: load package [18.0][FIX] Fix shipment advice function is_loaded_in_shipment Jan 9, 2026
return all([pl.is_done and pl.shipment_advice_id for pl in self])
return all(
[
all([line.picked for line in pl.move_line_ids])
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
all([line.picked for line in pl.move_line_ids])
pl.move_line_ids and all([line.picked for line in pl.move_line_ids])

@jbaudoux
Copy link
Contributor

jbaudoux commented Jan 9, 2026

@TDu Can't we just invalidate is_done on the corresponding package levels when we mark a move line as picked in the move line load shipment ?
You should then be able to rely on the package level is done which is more accurate as it ensures all corresponding move lines are there

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