From a302373d3f400e930deac1d3c48c191db2898e45 Mon Sep 17 00:00:00 2001 From: Simon Wydooghe Date: Tue, 2 Jan 2024 14:45:06 +0100 Subject: [PATCH] [FIX] stock: fix stock.traceability.report XML-RPC method call Trying to call the get_lines() method of the stock.traceability.report model was failing using the external API, due to the response containing None values. Making sure that False is returned instead of None fixes this. The XML-RPC client error is the following: closes odoo/odoo#152712 Typeerror: cannot marshal None unless allow_none is enabled X-original-commit: 76ba5fc08e76c3163cd21ccfa710cdcc82340c89 Signed-off-by: William Henrotin (whe) --- addons/stock/report/stock_traceability.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/report/stock_traceability.py b/addons/stock/report/stock_traceability.py index acede4805e9..cf42a403f63 100644 --- a/addons/stock/report/stock_traceability.py +++ b/addons/stock/report/stock_traceability.py @@ -52,7 +52,7 @@ class MrpStockReport(models.TransientModel): return lines_seen - move_lines @api.model - def get_lines(self, line_id=None, **kw): + def get_lines(self, line_id=False, **kw): context = dict(self.env.context) model = kw and kw['model_name'] or context.get('model') rec_id = kw and kw['model_id'] or context.get('active_id') @@ -172,7 +172,7 @@ class MrpStockReport(models.TransientModel): return False, False @api.model - def _lines(self, line_id=None, model_id=False, model=False, level=0, move_lines=[], **kw): + def _lines(self, line_id=False, model_id=False, model=False, level=0, move_lines=None, **kw): final_vals = [] lines = move_lines or [] if model and line_id: