Skip to content

[19.0][MIG] sale_sourced_by_line - #4544

Open
JasminSForgeFlow wants to merge 68 commits into
OCA:19.0from
ForgeFlow:19.0-mig-sale_sourced_by_line
Open

[19.0][MIG] sale_sourced_by_line#4544
JasminSForgeFlow wants to merge 68 commits into
OCA:19.0from
ForgeFlow:19.0-mig-sale_sourced_by_line

Conversation

@JasminSForgeFlow

Copy link
Copy Markdown
Contributor

Scope reduced: most of the feature is now in core

Odoo 19 sale_stock already provides the bulk of what this module used to add:

18.0 module behaviour 19.0
warehouse_id on sale.order.line core — sale_stock/models/sale_order_line.py (computed, stored)
Stock moves / pickings sourced from the line's warehouse core — _prepare_procurement_values passes self.warehouse_id
One delivery order per warehouse core — falls out of the stock rules, no grouping code needed
_get_procurement_group_key() / _prepare_procurement_group_vals() removedprocurement.group no longer exists in 19.0 (replaced by stock.reference), so there is nothing to override

What remains, and is what this module now does:

  • make sale.order.line.warehouse_id user-editable (core declares it compute-only, derived from the line routes);
  • keep a manually set line warehouse from being overwritten — _compute_warehouse_id only recomputes lines where the field is empty;
  • expose the field on the sale order line list and form;
  • relabel sale.order.warehouse_id as Default Warehouse with its help text.

The end-user behaviour is unchanged from 18.0.

Changes

  • __manifest__.py: version 19.0.1.0.0; dependency sale_procurement_group_by_linesale_stock. The former has no 19.0 branch and its purpose (one procurement group per line) is obsolete now that procurement.group is gone.
  • model/sale.py:
    • dropped the three procurement-group related methods (see table above);
    • sale.order.line.warehouse_id redefined with readonly=False;
    • _compute_warehouse_id @api.depends: route_idroute_ids, and product_packaging_id dropped (product.packaging was merged into uom.uom in 19.0);
    • dropped the legacy readonly=True on sale.order.warehouse_id. Core declares that field with precompute=True, and models.create() discards values for precompute + readonly fields (odoo/orm/models.py), so keeping readonly=True would silently swallow warehouse_id passed at sale order creation. The field stays labelled Default Warehouse.
  • view/sale_view.xml:
    • line form xpath anchor route_idroute_ids;
    • removed the {'default_warehouse_id': warehouse_id} context on order_line. It is redundant — core computes and stores the line warehouse from the order — and it would both override core's route-based warehouse resolution and clobber the context attribute core sets on that field.
  • tests/: rewritten. No demo data on 19.0, so all fixtures are created in setUpClass; assertions moved from procurement groups to picking count and move_ids.warehouse_id. Added a test asserting a line-level warehouse survives a change of the order warehouse.

@ForgeFlow

guewen and others added 30 commits August 18, 2026 11:52
…dule sale_sourced_by_line

(/tmp/trunk-generic/ rev 27)
(/tmp/trunk-generic/ rev 40.1.6)
Now allows to set a warehouse on sale order line

Added a test for sale order with multiple warehouses sources
In order to get visibility on https://www.odoo.com/apps the OCA board has
decided to add the OCA as author of all the addons maintained as part of the
association.
This module extract logic to create multiple procurement group
for a single sale order for grouped sale order lines.
oca-ci and others added 27 commits August 18, 2026 11:52
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-15.0/sale-workflow-15.0-sale_sourced_by_line
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-15-0/sale-workflow-15-0-sale_sourced_by_line/
Currently translated at 50.0% (2 of 4 strings)

Translation: sale-workflow-15.0/sale-workflow-15.0-sale_sourced_by_line
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-15-0/sale-workflow-15-0-sale_sourced_by_line/it/
Currently translated at 50.0% (2 of 4 strings)

Translation: sale-workflow-15.0/sale-workflow-15.0-sale_sourced_by_line
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-15-0/sale-workflow-15-0-sale_sourced_by_line/it/
Currently translated at 100.0% (4 of 4 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_sourced_by_line
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_sourced_by_line/de/
Currently translated at 100.0% (4 of 4 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_sourced_by_line
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_sourced_by_line/it/
Currently translated at 100.0% (4 of 4 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_sourced_by_line
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_sourced_by_line/es/
Currently translated at 100.0% (4 of 4 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_sourced_by_line
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_sourced_by_line/pt_BR/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-17.0/sale-workflow-17.0-sale_sourced_by_line
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-17-0/sale-workflow-17-0-sale_sourced_by_line/
Currently translated at 100.0% (6 of 6 strings)

Translation: sale-workflow-17.0/sale-workflow-17.0-sale_sourced_by_line
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-17-0/sale-workflow-17-0-sale_sourced_by_line/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-18.0/sale-workflow-18.0-sale_sourced_by_line
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_sourced_by_line/
Currently translated at 100.0% (4 of 4 strings)

Translation: sale-workflow-18.0/sale-workflow-18.0-sale_sourced_by_line
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_sourced_by_line/es/
Currently translated at 100.0% (4 of 4 strings)

Translation: sale-workflow-18.0/sale-workflow-18.0-sale_sourced_by_line
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_sourced_by_line/sl/
@OCA-git-bot OCA-git-bot added series:19.0 mod:sale_sourced_by_line Module sale_sourced_by_line labels Aug 25, 2026
@AaronHForgeFlow

Copy link
Copy Markdown
Contributor

Hi @JasminSForgeFlow we have to make this module to depend on sale_stock_reference_by_line and adapt the methods to work like it was with the previous dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:sale_sourced_by_line Module sale_sourced_by_line series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.