Skip to content

Commit

Permalink
[IMP] create whs lists only for not excluded products
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiocorato committed Dec 2, 2024
1 parent ef50f94 commit a7e512c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions connector_whs/models/mrp.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def _generate_whs(self):
continue
if (
move.product_id.type == "product"
and not move.product_id.exclude_from_whs
and move.location_id == production.location_src_id
):
if not num_lista:
Expand Down
2 changes: 2 additions & 0 deletions connector_whs/models/repair.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ def action_repair_end(self):
and x.move_id.state == "done"
and x.move_id.product_id.type == "product"
and x.move_id.location_id == location_id
and not x.move_id.product_id.exclude_from_whs
)
remove_operations = repair.operations.filtered(
lambda x: x.move_id
and x.move_id.state == "done"
and x.move_id.product_id.type == "product"
and x.move_id.location_dest_id == location_id
and not x.move_id.product_id.exclude_from_whs
)
if add_operations:
num_lista = self.env["ir.sequence"].next_by_code("hyddemo.whs.liste")
Expand Down
8 changes: 7 additions & 1 deletion connector_whs/models/stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,13 @@ def create_whs_list(self):
in self.env.context.get("picking_ids_not_to_backorder", [])
):
continue
moves = self.filtered(lambda m: m.picking_id == picking)
moves = self.filtered(
lambda m: m.picking_id == picking
and m.product_type == "product"
and not m.product_id.exclude_from_whs
)
if not moves:
continue
list_number = False # get existing active list_number to append new whslist
list_numbers = list(
set(
Expand Down

0 comments on commit a7e512c

Please sign in to comment.