[FIX] product: Inventory at Date does not show the correct valuation
Fine tuning of this commit: 51d072db44
When clicking on the group of the Inventory at Date, the
product.price.inventory must follow the same order as the
read_group in stock.history.
opw:747857
This commit is contained in:
@@ -562,7 +562,7 @@ class ProductProduct(models.Model):
|
||||
history = self.env['product.price.history'].search([
|
||||
('company_id', '=', company_id),
|
||||
('product_id', 'in', self.ids),
|
||||
('datetime', '<=', date or fields.Datetime.now())], limit=1)
|
||||
('datetime', '<=', date or fields.Datetime.now())], order='datetime desc,id desc', limit=1)
|
||||
return history.cost or 0.0
|
||||
|
||||
def _need_procurement(self):
|
||||
|
||||
Reference in New Issue
Block a user