Map routes
Add a Property Mapping
Setting
Value
Change the rendering type to Advanced Selection List
Add an import rule
Last updated
Last updated
[ 1, 5 ][ Buy, Manufacture ]/* routes Odoo import set default as manuf (6) if no input is given */
const buy = 5; /* adjust as necessary - this will be in the list when you first query odoo */
const manuf = 6;
if (!s) {
return [manuf];
}
/* try to extract an array */
if (Array.isArray(s))
{
/* default value returned if there is nothing */
if (s.length === 0) {
return [ manuf ];
}
return s.sort((a, b) => a - b);
}
/* not a native array - so parse plain text , repeating the logic */
try {
const parsed = JSON.parse(s);
if (Array.isArray(parsed))
{
if (parsed.length === 0)
return [ manuf ];
else
return parsed.sort((a, b) => a - b);
}
else
return [ parsed ];
} catch {
/* open the dev tools to check for this error if you suspect one */
console.error("routes: Failed to parse Odoo route input as JSON:", s);
return [ s ];
}