[FIX] include anglo-saxon price unit calculation in refunds.

Otherwise the anglo saxon entries won't be correct.
For example, the Interim (Delivered) account should balance
after receiving and triggering a refund on a customer rma.
This commit is contained in:
Jordi Ballester Alomar
2022-11-21 15:13:06 +01:00
committed by Carlos Vallés Fuster
parent b688c7faae
commit 4f59aea9e3

View File

@@ -58,6 +58,18 @@ class RmaOrderLine(models.Model):
pickings |= move.picking_id
return pickings
@api.model
def _get_in_moves(self):
moves = self.env["stock.move"]
for move in self.move_ids:
first_usage = move._get_first_usage()
last_usage = move._get_last_usage()
if last_usage == "internal" and first_usage != "internal":
moves |= move
elif last_usage == "supplier" and first_usage == "customer":
moves |= moves
return moves
@api.model
def _get_out_pickings(self):
pickings = self.env["stock.picking"]