Skip to content

Commit

Permalink
Merge branch '12.0-fix-purchase_open_qty-refund-from-dropship' of git…
Browse files Browse the repository at this point in the history
…+ssh://github.com/efatto/purchase-workflow into 12.0
  • Loading branch information
Pretecno committed Feb 6, 2025
2 parents 457be13 + e90842a commit e08597b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions purchase_open_qty/models/purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,13 @@ def _compute_qty_to_receive(self):
lambda m: m.state == 'done'):
sign = 1
# in case of outgoing (refund) sign is inverted
if move.location_id.usage == 'internal' and \
move.location_dest_id.usage != 'internal':
# also support particular case of refund from a supplier dropship
if (
move.location_id.usage == 'internal'
and move.location_dest_id.usage != 'internal'
or move.location_id.usage == 'customer'
and move.location_dest_id.usage == 'supplier'
):
sign = -1
product_uom_qty = move.product_uom_qty * sign
if move.product_uom != line.product_uom:
Expand Down

0 comments on commit e08597b

Please sign in to comment.