[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) <iel@odoo.com>
This commit is contained in:
Mohit Beniwal
2023-03-14 14:39:22 +01:00
parent 0cf04fdd85
commit 66cac3a7ed
+2 -2
View File
@@ -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})