Skip to content

[18.0][ADD] sale_stock_put_to_order: put-to-order zone configuration and target resolution#4263

Closed
StephaneMangin wants to merge 1 commit intoOCA:18.0from
acsone:18.0
Closed

[18.0][ADD] sale_stock_put_to_order: put-to-order zone configuration and target resolution#4263
StephaneMangin wants to merge 1 commit intoOCA:18.0from
acsone:18.0

Conversation

@StephaneMangin
Copy link
Copy Markdown

@StephaneMangin StephaneMangin commented Apr 8, 2026

Configure locations as put-to-order zones to direct incoming goods to bins that already hold products from the same order.

Features of this module:

  • Recursive is_pto boolean on stock.location (parent → children)
  • Sale-order-aware product scope for bin selection
  • Optional auto-select mode via _apply_putaway_strategy
  • Storage-category validation on candidate bins
  • Main extension entrypoints: _is_pto_location_valid, _get_pto_source_products, _prepare_pto_bin_group_vals

Supervised coding using Copilot AI with Claude Opus 4.6. Here are the different phases:

  • customer need analysis
  • reusable modules analysis (including integration efforts regarding initial budget)
  • module creation and human testing
  • Tests generation
  • Optimisations (module architecture and extensibility, speed tests, etc)

Easily integrable with the enterprise module stock_barcode to help pickers select the proper bin as quickly as possible (during a pre-pack action for instance)

@StephaneMangin StephaneMangin changed the title [ADD] sale_stock_put_to_order: put-to-order zone configuration and target resolution [18.0][ADD] sale_stock_put_to_order: put-to-order zone configuration and target resolution Apr 8, 2026
("product_id", "in", products.ids),
("quantity", ">", 0),
]
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just a kindly reminder, I've not read the whole PR !

as far I remember, at least in previous versions, quant are not meant to be unique to avoid some concurrency issues. So if you really needs products with available quantities you should consider group by.

Also, I'm wonder if you consider physical stock or available stock ?

Copy link
Copy Markdown
Author

@StephaneMangin StephaneMangin Apr 8, 2026

Choose a reason for hiding this comment

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

This is the physical quantity indeed. I think this is sufficient for this behavior because we just want to know where certain products are to select the correct location for the put-to-order action.

    quantity = fields.Float(
        'Quantity',
        help='Quantity of products in this quant, in the default unit of measure of the product',
        readonly=True, digits='Product Unit of Measure')

    reserved_quantity = fields.Float(
        'Reserved Quantity',
        default=0.0,
        help='Quantity of reserved products in this quant, in the default unit of measure of the product',
        readonly=True, required=True, digits='Product Unit of Measure')

    available_quantity = fields.Float(
        'Available Quantity',
        help="On hand quantity which hasn't been reserved on a transfer, in the default unit of measure of the product",
        compute='_compute_available_quantity', digits='Product Unit of Measure')

Hope i understood well you concern

Comment thread sale_stock_put_to_order/models/stock_location.py
Comment thread sale_stock_put_to_order/models/stock_location.py
…rget resolution

Configure locations as put-to-order zones to direct incoming goods
to bins that already hold products from the same order.
@StephaneMangin
Copy link
Copy Markdown
Author

I've made some changes after Usecases review. It seems it missed a relation to the procurement group if the sale order line relation is not set on moves. Added in the Sale link retrieval.

Thus, the location proposition was a bit trival in its approach, too trivial. What's has changed : filter quants for products position + move analysis to get the reel locations related to the move -> sale order record.

@StephaneMangin
Copy link
Copy Markdown
Author

Overseeded by #4266

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.

4 participants