mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[IMP] rma: Refactor all rma modules in order to consider using the correct price unit in moves
Otherwise the inventory accounting will be completely wrong.
This commit is contained in:
committed by
Carlos Vallés Fuster
parent
d6960ba8b7
commit
8bedb814cf
@@ -35,7 +35,8 @@ class StockRule(models.Model):
|
||||
res["partner_id"] = line.delivery_address_id.id
|
||||
else:
|
||||
res["partner_id"] = line.rma_id.partner_id.id
|
||||
dest_loc = self.env["stock.location"].browse([res["location_dest_id"]])[0]
|
||||
if dest_loc.usage == "internal":
|
||||
res["price_unit"] = line.price_unit
|
||||
company_id = res["company_id"]
|
||||
company = self.env["res.company"].browse(company_id)
|
||||
cost = product_id.with_company(company).standard_price
|
||||
res["price_unit"] = cost
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user