Skip to content

Commit

Permalink
[FIX] repair_stock_move: default repair line source location for remo…
Browse files Browse the repository at this point in the history
…ve operations

With this fix, for "remove" repair lines repair location is not used as
default source location, that is preserved for "add" operations
  • Loading branch information
dalonsod committed Sep 25, 2024
1 parent fef80e5 commit a300830
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions repair_stock_move/models/repair_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ def create(self, vals):
res.move_id = move
return res

@api.onchange("product_id")
def _onchange_location(self):
if self.state == "draft":
@api.onchange("type")
def onchange_operation_type(self):
super().onchange_operation_type()

Check warning on line 50 in repair_stock_move/models/repair_line.py

View check run for this annotation

Codecov / codecov/patch

repair_stock_move/models/repair_line.py#L50

Added line #L50 was not covered by tests
if self.state == "draft" and self.type == "add":
self.location_id = self.repair_id.location_id

# TODO: write qty - update stock move.
Expand Down

0 comments on commit a300830

Please sign in to comment.