Skip to content

Commit

Permalink
[FIX] stock: False check company error on interco push
Browse files Browse the repository at this point in the history
Usecase to reproduce:
- Company A Stock -> Interco -> Push to Company B stock
- Create a SO from company A with company B as customer
- Create a pull from WH/A to interco
- Create a push interco to WH/B
- Confirm the SO

Current behavior:
Wrong company on stock.move from interco to WH/B due to rule with
company A

Expected behavior:
Pushed to stock B

It happens because the rule_id is not set during the copy of push_apply.
So it just keep the same rule than the move triggering the push (WH/A ->
interco).

X-original-commit: dc58d79
Part-of: odoo#161717
  • Loading branch information
amoyaux committed Apr 12, 2024
1 parent 87f1106 commit 8db471e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions addons/stock/models/stock_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def _push_prepare_move_copy_values(self, move_to_copy, new_date):
'origin': move_to_copy.origin or move_to_copy.picking_id.name or "/",
'location_id': move_to_copy.location_dest_id.id,
'location_dest_id': self.location_dest_id.id,
'rule_id': self.id,
'date': new_date,
'date_deadline': move_to_copy.date_deadline,
'company_id': company_id,
Expand Down

0 comments on commit 8db471e

Please sign in to comment.