-
Notifications
You must be signed in to change notification settings - Fork 2
[4207][ADD] mrp_mto_owner #108
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
base: 16.0
Are you sure you want to change the base?
Conversation
| company_id, origins, values | ||
| ) | ||
| values = values[0] | ||
| move_dest = values.get("move_dest_ids") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AungKoKoLin1997 Did you test this code? I can't find the relevant code where move_dest_ids is assigned in values. The following line throws a server error because there is no move_dest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find the relevant code where
move_dest_idsis assigned invalues.
https://github.com/OCA/OCB/blob/b1c66f1/addons/stock/models/stock_move.py#L1422
move_dest_ids is assigned in the MTO scenario, not in the scenario of orderpoint procurements, which is not considered in the current code.
| if move_dest_ids: | ||
| origin_move = self._find_origin_move(move_dest_ids[0]) | ||
| if origin_move and origin_move.raw_material_production_id.owner_id: | ||
| vals["owner_id"] = origin_move.raw_material_production_id.owner_id.id | ||
| return vals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AungKoKoLin1997 Do you think we can simply do this, discarding the _find_origin_move() method? I guess we don't need to get to the very origin, as long as the parent inherits the value from its parent. Same for the purchase_mto_owner module.
| if move_dest_ids: | |
| origin_move = self._find_origin_move(move_dest_ids[0]) | |
| if origin_move and origin_move.raw_material_production_id.owner_id: | |
| vals["owner_id"] = origin_move.raw_material_production_id.owner_id.id | |
| return vals | |
| if move_dest_ids: | |
| vals["owner_id"] = move_dest_ids[0].raw_material_production_id.owner_id.id | |
| return vals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I will check and if the parent inherits the value from its parent, I will get rid of _find_origin_move.
2516ae0 to
b741d71
Compare
7b555c1 to
8ab5c08
Compare
1146626 to
8ab5c08
Compare
kanda999
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functional check
4207