Skip to content

[18.0][FIX] stock_picking_return_lot: Add domain to the lot_id field so that only the appropriate lots can be selected#2281

Open
victoralmau wants to merge 1 commit into
OCA:18.0from
Tecnativa:18.0-fix-stock_picking_return_lot-TT61559
Open

[18.0][FIX] stock_picking_return_lot: Add domain to the lot_id field so that only the appropriate lots can be selected#2281
victoralmau wants to merge 1 commit into
OCA:18.0from
Tecnativa:18.0-fix-stock_picking_return_lot-TT61559

Conversation

@victoralmau
Copy link
Copy Markdown
Member

@victoralmau victoralmau commented Mar 18, 2026

Add domain to the lot_id field so that only the appropriate lots can be selected

Please @pedrobaeza and @carlos-lopez-tecnativa can you review it?

@Tecnativa TT61559

@pedrobaeza pedrobaeza added this to the 18.0 milestone Mar 18, 2026
Comment thread stock_picking_return_lot/wizards/stock_return_picking_line.py Outdated
…t only the appropriate lots can be selected

TT61559
@victoralmau victoralmau force-pushed the 18.0-fix-stock_picking_return_lot-TT61559 branch from 377a296 to 5577a1b Compare March 18, 2026 15:10
Comment on lines +29 to +33
smls = rec.move_id.move_line_ids.filtered(
lambda x: x.state == "done" and x.lot_id
)
domain = [("id", "in", smls.lot_id.ids)]
rec.lot_id_domain = domain
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why is it so restrictive?
The same as my comment here: OCA/rma#554 (comment)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Similar to what was discussed in the other PR, IMO you should only be able to select lots that have been used; what would be the point of creating a return for a lot that hasn't been used?

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