Skip to content

[18.0][IMP] mrp_byproduct_auto_create_lot: add lot propagation to byproducts#1707

Open
yostashiro wants to merge 1 commit intoOCA:18.0from
qrtl:18.0-imp-mrp_byproduct_auto_create_lot
Open

[18.0][IMP] mrp_byproduct_auto_create_lot: add lot propagation to byproducts#1707
yostashiro wants to merge 1 commit intoOCA:18.0from
qrtl:18.0-imp-mrp_byproduct_auto_create_lot

Conversation

@yostashiro
Copy link
Member

Add option to propagate main product's lot to byproducts instead of generating unique lots. Configurable at company level with product-level override.

Unused method _get_lot_sequence() is removed from mrp.production.

@qrtl QT5959

@yostashiro yostashiro changed the title [IMP] mrp_byproduct_auto_create_lot: add lot propagation to byproducts [18.0][IMP] mrp_byproduct_auto_create_lot: add lot propagation to byproducts Feb 1, 2026
@yostashiro yostashiro force-pushed the 18.0-imp-mrp_byproduct_auto_create_lot branch from 16b02f7 to 6b4ed8a Compare February 1, 2026 14:02
Add option to propagate main product's lot to byproducts instead of
generating unique lots. Configurable at company level with product-level
override.

Unused method _get_lot_sequence() is removed from mrp.production.
@yostashiro yostashiro force-pushed the 18.0-imp-mrp_byproduct_auto_create_lot branch from 6b4ed8a to 4c6cbf6 Compare February 1, 2026 14:10
Copy link
Contributor

@AungKoKoLin1997 AungKoKoLin1997 left a comment

Choose a reason for hiding this comment

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

Functional and Code review: LGTM

nobuQuartile

This comment was marked as duplicate.

Copy link

@nobuQuartile nobuQuartile left a comment

Choose a reason for hiding this comment

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

Code Review


1. Go to *Settings \> Manufacturing* and set "Propagate Lot to Byproducts".
2. Optionally override at product level via "Propagate Lot to Byproduct" field
(after the "Auto Create Lot" field in the General Information tab).

Choose a reason for hiding this comment

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

Suggested change
(after the "Auto Create Lot" field in the General Information tab).
(after the byproducts' "Auto Create Lot" field in the General Information tab).

Copy link
Member Author

Choose a reason for hiding this comment

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

@nobuQuartile That's not the design. The current description should be okay.

return self.env["ir.sequence"].next_by_code("stock.lot.serial")
for line in lines:
if propagate_lot_to_byproduct and production.lot_producing_id:
line.lot_name = production.lot_producing_id.name

Choose a reason for hiding this comment

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

When multiple units of a serial-tracked byproduct are produced, an error occurs indicating that the same serial number has been created multiple times.

This might be something we should add to the roadmap

Copy link
Member Author

Choose a reason for hiding this comment

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

This might be something we should add to the roadmap

@nobuQuartile Please help do so.

_inherit = "res.company"

propagate_lot_to_byproduct = fields.Selection(
selection=[("no", "No"), ("yes", "Yes")],

Choose a reason for hiding this comment

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

Suggested change
selection=[("no", "No"), ("yes", "Yes")],
selection=[("yes", "Yes"),("no", "No")],

I think it’s more common to put “Yes” before “No.” Was there any reason for the order?

Image

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