From b895fae4b229207315e4e501d36909b5a163cf7d Mon Sep 17 00:00:00 2001 From: ravb-odoo Date: Fri, 29 Sep 2023 17:43:30 +0530 Subject: [PATCH] [FIX] website: resolving traceback Issue when creating Tasks/Tickets Issue: A traceback error was observed when attempting to create a task or ticket using the website form. Cause: This issue arise as a result of converting RPC to ORM readSearch. The problem lay in the domain being passed to the ORM. Not all fields had a defined domain, causing 'undefined' to be passed to the ORM, leading to the traceback error. Fix: To address this, we have introduced an 'or' condition within the domain. Now, if a field has a domain, it will be passed accordingly; otherwise, an empty array is set as the domain. This modification resolves the traceback issue. Task-3526887 closes odoo/odoo#137359 Signed-off-by: Romain Derie (rde) --- addons/website/static/src/snippets/s_website_form/options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/static/src/snippets/s_website_form/options.js b/addons/website/static/src/snippets/s_website_form/options.js index 252a11767ae..47a701fa47e 100644 --- a/addons/website/static/src/snippets/s_website_form/options.js +++ b/addons/website/static/src/snippets/s_website_form/options.js @@ -71,7 +71,7 @@ const FormEditor = options.Class.extend({ display_name: el[1], })); } else if (field.relation && field.relation !== 'ir.attachment') { - field.records = await this.orm.searchRead(field.relation, field.domain, ["display_name"]); + field.records = await this.orm.searchRead(field.relation, field.domain || [], ["display_name"]); } return field.records; },