From 66cac3a7edbbb2dd0a776e545c2c341764d4b175 Mon Sep 17 00:00:00 2001 From: Mohit Beniwal Date: Wed, 15 Feb 2023 11:15:56 +0000 Subject: [PATCH] [FIX] inventory: invalid literal for base 10:'false' in inventory This issue was occurring while printing the count sheets in the 'update quantity' section of products in 'Inventory' module. Steps to Reproduce: - Open Inventory module and go to any product. - Click on update quantity button. - Click create button, select the new record without saving it. Then click Print > Count Sheet To fix this we check whether it is integer or not, if it is integer then only it will print the report. sentry-3880400776 closes odoo/odoo#115186 X-original-commit: 2600c17859363f5ec8c1f50a73e9d1990aa762ba Signed-off-by: Ivan Elizaryev (iel) --- addons/web/controllers/report.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/controllers/report.py b/addons/web/controllers/report.py index c24155aaca9..bd075adc03d 100644 --- a/addons/web/controllers/report.py +++ b/addons/web/controllers/report.py @@ -29,7 +29,7 @@ class ReportController(http.Controller): context = dict(request.env.context) if docids: - docids = [int(i) for i in docids.split(',')] + docids = [int(i) for i in docids.split(',') if i.isdigit()] if data.get('options'): data.update(json.loads(data.pop('options'))) if data.get('context'): @@ -123,7 +123,7 @@ class ReportController(http.Controller): filename = "%s.%s" % (report.name, extension) if docids: - ids = [int(x) for x in docids.split(",")] + ids = [int(x) for x in docids.split(",") if x.isdigit()] obj = request.env[report.model].browse(ids) if report.print_report_name and not len(obj) > 1: report_name = safe_eval(report.print_report_name, {'object': obj, 'time': time})