Skip to content

Commit

Permalink
[FIX] point_of_sale: POS anglo-saxon in FIFO
Browse files Browse the repository at this point in the history
In FIFO, the stock move cost related to the picking of the POS
Order must be used to compute the price.

Fine tuning of this commit: a36ff26

opw:1829801
  • Loading branch information
simongoffin committed Apr 10, 2018
1 parent b856561 commit e62fb90
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions addons/point_of_sale/models/pos_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,14 +413,14 @@ def insert_data(data_type, values):
return True

def _get_pos_anglo_saxon_price_unit(self, product, partner_id, quantity):
# In the SO part, the entries will be inverted by function compute_invoice_totals
price_unit = - product._get_anglo_saxon_price_unit()
price_unit = product._get_anglo_saxon_price_unit()
if product._get_invoice_policy() == "delivery":
moves = self.filtered(lambda o: o.partner_id.id == partner_id).mapped('picking_id.move_lines').filtered(lambda m: m.product_id.id == product.id)
moves.sorted(lambda x: x.date)
average_price_unit = product._compute_average_price(quantity, quantity, moves)
average_price_unit = product._compute_average_price(0, quantity, moves)
price_unit = average_price_unit or price_unit
return price_unit
# In the SO part, the entries will be inverted by function compute_invoice_totals
return - price_unit

def _reconcile_payments(self):
for order in self:
Expand Down

0 comments on commit e62fb90

Please sign in to comment.