Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][IMP] repair_stock_move: relate lot_id and common methods #1375

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from

Conversation

DavidJForgeFlow
Copy link
Contributor

The value of lot id in repair lines is not related to the one of the move related. The idea is to make them correlated to improve visibility. Also added stock_rule._get_custom_move_fields method from repair_picking as it should be added in the module that adds the field.

@ForgeFlow

Copy link

@gbrito gbrito left a comment

Choose a reason for hiding this comment

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

Have a look if my comment makes sense, maybe it isn't the desired functionality

@DavidJForgeFlow
Copy link
Contributor Author

Have a look if my comment makes sense, maybe it isn't the desired functionality

Hi, I can't see the comment!

Copy link

@gbrito gbrito left a comment

Choose a reason for hiding this comment

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

sorry, now I saved the comment. try again :)

Comment on lines 61 to 66
if rec.move_id.move_line_ids:
rec.lot_id = (
rec.move_id.move_line_ids[0].lot_id
if rec.move_id.move_line_ids.mapped("lot_id")
else False
)
Copy link

Choose a reason for hiding this comment

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

There could be an edge case if the lot_id is not assigned on the first move_line_ids.
Don't know if makes sense like this. give it a try

Suggested change
if rec.move_id.move_line_ids:
rec.lot_id = (
rec.move_id.move_line_ids[0].lot_id
if rec.move_id.move_line_ids.mapped("lot_id")
else False
)
if rec.move_id.move_line_ids.lot_id:
rec.lot_id = rec.move_id.move_line_ids.lot_id[0]
else:
rec.lot_id = False

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I fixed the corner case thx! Your code give me some errors so I changed it a little bit!

The value of lot id in repair lines is not related to the one of the move related. The idea is to make them correlated to improve visibility. Also added stock_rule._get_custom_move_fields method from repair_picking as it should be added in the module that adds the field.
@DavidJForgeFlow DavidJForgeFlow force-pushed the 14.0-imp-repair_stock_move branch from 68240fc to dc744bb Compare November 13, 2024 12:03
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.

2 participants