Skip to content

[19.0][MIG] sale_order_blanket_order: Migration to 19.0 - #56

Open
vvrossem wants to merge 24 commits into
OCA:19.0from
camptocamp:19.0-mig-sale_order_blanket_order
Open

vvrossem wants to merge 24 commits into
OCA:19.0from
camptocamp:19.0-mig-sale_order_blanket_order

Conversation

@vvrossem

@vvrossem vvrossem commented Oct 19, 2026 •

Copy link
Copy Markdown

Depends on sale_manual_delivery, already migrated in OCA/sale-workflow#4316.

Besides the usual migration steps:

What changed in 19.0 What I did
Packagings are UoMs now (odoo/odoo@28b69daefddb) Strict packaging matches lines on product_uom_id. A call-off line can then be in another unit than its blanket line, so quantities are converted where they're compared or summed (see below). If a quantity isn't a whole number of packs, the call-off line falls back to the product UoM.
api.propagate() is gone (odoo/odoo@15d427ff86f0) _patch_method uses functools.update_wrapper, like base_optional_quick_create.
fields.first() is gone Replaced by [:1].
odoo_test_helper no longer needed Tests use add_to_registry and restore sale.order afterwards. I also had to give the fixed tax a group and a country, and use a carrier that isn't demo data.

These conversions use round=False, because _compute_quantity rounds UP to 0.01 by default. Example: a blanket line of 1 Pack of 3 (= 3 units), called off as 1 unit, then 2 units.

Rounded UP (default) round=False
1st call-off: 1 unit 0.34 pack 0.333… pack
Its stock move 1.02 units 1 unit
Left on the blanket line 0.66 pack = 1.98 units 0.666… pack = 2 units
2nd call-off: 2 units refused (2 > 1.98) accepted

Covered by test_call_off_units_from_pack (1 + 2 units) and test_call_off_units_from_pack_one_by_one (1 + 1 + 1 units).

I left _prepare_reserve_procurement_values and release_reservation alone: they extend sale_stock_prebook, which isn't on 19.0 yet.

lmignon and others added 3 commits October 19, 2026 11:29
These modules extends the functionality of Sale Order to support Blanket Order and Call-off Order.
…fic products

by default, blanket order overlap is not allowed, ensuring that only one active blanket order applies at a time.
however, for certain products like delivery services, overlapping blanket orders are normal and do not pose an issue.

this commit adds a bool field, allow_blanket_order_overlap, to the product model, allowing specific products to permit
overlapping blanket orders when enabled.
…roducts

At the EOL of a blanket order, if the only remaining product to deliver is a
delivery product and the user hasn't included it in any of the call-off orders,
it makes no sense to create a call-off order containing only a delivery product
without tangible items.
Such orders would serve no practical purpose and could lead to confusion.
Ensuring that call-off orders include at least one actual product maintains
meaningful and logical orders.
@OCA-git-bot OCA-git-bot added mod:sale_order_blanket_order Module sale_order_blanket_order series:19.0 labels Oct 19, 2026
sbejaoui and others added 19 commits October 19, 2026 11:45
Moves the `create_call_off_from_so_if_possible` boolean field to its own line to properly display its label and prevent it from appearing on the same line as the `commitment_date` field. This resolves a rendering issue caused by incorrect placement within an `o_row` div.
…e order for products still to be delivered in blanket orders
Currently translated at 100.0% (112 of 112 strings)

Translation: sale-blanket-16.0/sale-blanket-16.0-sale_order_blanket_order
Translate-URL: https://translation.odoo-community.org/projects/sale-blanket-16-0/sale-blanket-16-0-sale_order_blanket_order/it/
Before this change the auto creation of call off orders was not possible if the original order contains lines referencing products from different blanket order due to an error into the code
…anklet orders

If checked, the system will enforce that the products are called off with the same packaging as the one defined on the blanket order lines. If not checked, the system will not take care of the packaging defined on the blanket order lines when calling off products nor the one on the call-off order lines.
…tRaises

When a test is designed to ensure that errors are detected correctly, if the error assertion does not terminate the test and the code continues to use the ORM, it is important to wrap this assertion in a savepoint to ensure that the ORM is restored to a consistent state following the error.
…d order

It's possible to update the qty on confirmed blanked orders. Nevertheless, the price unit must be preserved.
The "Normal Orders" filter was searching for 'normal' in the 'order_type'
selection field. However, the correct technical value for standard
orders is 'order'.
…parameters

`_action_launch_stock_rule` now takes its parameters named instead of positional.

Error message:
> TypeError: SaleOrderLine._action_launch_stock_rule() takes 1 positional argument but 2 were given

- Fixed bug by changing how paremeters are passed
- Existing tests detects the issue: no need to add another
Error message:
  ValueError: Order term 'blanket_order_id.id' is not a valid aggregate nor valid groupby

Root Cause:
_compute_call_off_order_count crashes on 18 because `_read_group` is called the Odoo 16 way.

Fix:
order parameter in _read_group does not support .id anymore.
Removed order parameter as it's not useful to the function.

Added test reproducing call_off_order_count crash
…ll-off orders

When generating a call-off order from a master blanket order that has
manually overridden or updated invoice/shipping child addresses, the
resulting call-off order defaulted back to the primary partner address.
@vvrossem
vvrossem force-pushed the 19.0-mig-sale_order_blanket_order branch 5 times, most recently from 489a3fa to f4f7837 Compare October 19, 2026 10:20
sale_order_blanket_order excludes sale_blanket_order, so they can't be
installed together. Same rebel module group as on 18.0, see
OCA@8111008
@vvrossem
vvrossem force-pushed the 19.0-mig-sale_order_blanket_order branch from 8675ab5 to d9dd201 Compare October 20, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:sale_order_blanket_order Module sale_order_blanket_order series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants