Skip to content

Commit

Permalink
Merge PR #636 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by dreispt
  • Loading branch information
OCA-git-bot committed Aug 22, 2024
2 parents 9dea4b1 + 066bfbb commit bcd4400
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion stock_intercompany/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def _get_counterpart_picking_vals(self, company):
"picking_type_id": ptype.id,
"state": "draft",
"location_id": self.env.ref("stock.stock_location_suppliers").id,
"location_dest_id": warehouse.lot_stock_id.id,
"location_dest_id": ptype.default_location_dest_id.id
or warehouse.lot_stock_id.id,
"counterpart_of_picking_id": self.id,
"move_ids": move_ids,
"move_line_ids": move_line_ids,
Expand Down
7 changes: 5 additions & 2 deletions stock_intercompany_bidirectional/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ def _check_company_consistency(self, company):
move_ids, move_line_ids = super()._check_company_consistency(company)

warehouse = company.intercompany_in_type_id.warehouse_id
location_dest = company.intercompany_in_type_id.default_location_dest_id
stock_move_line_obj = self.env["stock.move.line"]

# Remove package-related data and update destination location
# in move_ids and move_line_ids
for move_data in move_ids:
# Update destination location for each move
move_data[2]["location_dest_id"] = warehouse.lot_stock_id.id
move_data[2]["location_dest_id"] = (
location_dest.id or warehouse.lot_stock_id.id
)
# Set rule_id to False
move_data[2]["rule_id"] = False
for line_data in move_line_ids:
Expand All @@ -54,7 +57,7 @@ def _check_company_consistency(self, company):
{
"package_level_id": False,
"package_id": False,
"location_dest_id": warehouse.lot_stock_id.id,
"location_dest_id": location_dest.id or warehouse.lot_stock_id.id,
}
)

Expand Down

0 comments on commit bcd4400

Please sign in to comment.