[FIX] purchase: Average cost report rounding

Steps to reproduce:
- Decimal Accuracy for Product Price > 4 digits
- Purchase a product using a price (1.2345 in my example)
- Go to Purchase > Reporting
- Enable the List View
- Add the field Average Cost (price_average)
- This displays as just two decimals

Note:
can be edited with studio but you can just add the field "price_average"
to the "purchase_report_view_tree" view xml

Fix:
round using product price Accuracy

opw-3560792

closes odoo/odoo#145667

X-original-commit: d5a3430cecb673a06057673d0671228449fa3f60
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
This commit is contained in:
Walid
2023-12-11 17:21:15 +00:00
parent ca94faef82
commit 4bddcb8c92
+1 -1
View File
@@ -34,7 +34,7 @@ class PurchaseReport(models.Model):
delay_pass = fields.Float('Days to Receive', digits=(16, 2), readonly=True, group_operator='avg',
help="Amount of time between date planned and order by date for each purchase order line.")
price_total = fields.Float('Total', readonly=True)
price_average = fields.Float('Average Cost', readonly=True, group_operator="avg")
price_average = fields.Float('Average Cost', readonly=True, group_operator="avg", digits='Product Price')
nbr_lines = fields.Integer('# of Lines', readonly=True)
category_id = fields.Many2one('product.category', 'Product Category', readonly=True)
product_tmpl_id = fields.Many2one('product.template', 'Product Template', readonly=True)