[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) <whe@odoo.com>
This commit is contained in:
Simon Wydooghe
2024-02-06 18:49:06 +00:00
parent 6a133f736d
commit a302373d3f
+2 -2
View File
@@ -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: