Ir al contenido
Menú
Se marcó esta pregunta
1535 Vistas

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!


Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
jul 24
4809
0
ene 24
1455
1
oct 23
2108
1
ene 25
3553
1
jun 24
4042