mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[IMP] centralize the logic to get the correct cost of the RMA.
This commit is contained in:
committed by
Carlos Vallés Fuster
parent
4f59aea9e3
commit
1a2599e866
@@ -36,11 +36,5 @@ class StockRule(models.Model):
|
||||
res["partner_id"] = line.delivery_address_id.id
|
||||
else:
|
||||
res["partner_id"] = line.rma_id.partner_id.id
|
||||
# We are not checking the reference move here because if stock account
|
||||
# is not installed, there is no way to know the cost of the stock move
|
||||
# so better use the standard cost in this case.
|
||||
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
|
||||
res["price_unit"] = line._get_price_unit()
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user