From 4bddcb8c9254351c0dfcbf8141bc37c8cec4aef4 Mon Sep 17 00:00:00 2001 From: Walid Date: Tue, 5 Dec 2023 14:37:39 +0100 Subject: [PATCH] [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) Signed-off-by: Walid Hanniche (waha) --- addons/purchase/report/purchase_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/report/purchase_report.py b/addons/purchase/report/purchase_report.py index 039f165e43e..6bc204d293f 100644 --- a/addons/purchase/report/purchase_report.py +++ b/addons/purchase/report/purchase_report.py @@ -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)