[IMP] mrp: price on product should be changed when receiving from production in average price, not only from supplier

This commit is contained in:
Richard Mathot
2017-04-05 14:05:15 +02:00
committed by GitHub
parent bf781cf740
commit a16da9f9c6
+1 -1
View File
@@ -185,7 +185,7 @@ class StockMove(models.Model):
tmpl_dict = defaultdict(lambda: 0.0)
# adapt standard price on incomming moves if the product cost_method is 'average'
std_price_update = {}
for move in self.filtered(lambda move: move.location_id.usage == 'supplier' and move.product_id.cost_method == 'average'):
for move in self.filtered(lambda move: move.location_id.usage in ('supplier', 'production') and move.product_id.cost_method == 'average'):
product_tot_qty_available = move.product_id.qty_available + tmpl_dict[move.product_id.id]
# if the incoming move is for a purchase order with foreign currency, need to call this to get the same value that the quant will use.