This is my block of code that opens the dialog box:
const resModel = field.relation;
this .addDialog(SelectCreateDialog, {
title: sprintf( this .env._t( "Select: %s" ) ), field.string),
noCreate: true ,
multiSelect: true ,
resModel: resModel,
context: field.context || { },
onSelected: async (resIds) => {
console.log( "************onSelected**********" );
const data = await this .fetchData( resModel,[[ "id" , "in" , resIds]]);
if (!data.length) {
condition.
condition.displayedValue = "" ;
return ;
}
// replace comma with ¶ to avoid split errors (in case of comma in display_name)
condition.value = field.type == "one2many" || field.type == "many2many" ? data.map(d => d.id).join( "," ) : data.map(d => d.display_name.replace( "," , "¶" )).join( "," );
condition.displayedValue = data.map(d => ` "${d.display_name}" `).join( "," );
// click on apply to trigger the onApply()
$( ".
},
{
onClose: () => {
console.log( "************onClose**********" );
},
}
);
I would appreciate any help!