[FIX] purchase_stock: move code at the right place
Oversight of previous forward-port.
This commit is contained in:
@@ -246,6 +246,12 @@ class PurchaseOrderLine(models.Model):
|
||||
if move.location_dest_id.usage == "supplier":
|
||||
if move.to_refund:
|
||||
total -= move.product_uom._compute_quantity(move.product_uom_qty, line.product_uom)
|
||||
elif move.origin_returned_move_id._is_dropshipped() and not move._is_dropshipped_returned():
|
||||
# Edge case: the dropship is returned to the stock, no to the supplier.
|
||||
# In this case, the received quantity on the PO is set although we didn't
|
||||
# receive the product physically in our stock. To avoid counting the
|
||||
# quantity twice, we do nothing.
|
||||
pass
|
||||
else:
|
||||
total += move.product_uom._compute_quantity(move.product_uom_qty, line.product_uom)
|
||||
line.qty_received = total
|
||||
@@ -378,12 +384,6 @@ class PurchaseOrderLine(models.Model):
|
||||
values.append(val)
|
||||
return self.env['stock.move'].create(values)
|
||||
|
||||
elif move.origin_returned_move_id._is_dropshipped() and not move._is_dropshipped_returned():
|
||||
# Edge case: the dropship is returned to the stock, no to the supplier.
|
||||
# In this case, the received quantity on the PO is set although we didn't
|
||||
# receive the product physically in our stock. To avoid counting the
|
||||
# quantity twice, we do nothing.
|
||||
pass
|
||||
def _merge_in_existing_line(self, product_id, product_qty, product_uom, location_id, name, origin, values):
|
||||
""" This function purpose is to be override with the purpose to forbide _run_buy method
|
||||
to merge a new po line in an existing one.
|
||||
|
||||
Reference in New Issue
Block a user