跳至内容
菜单
此问题已终结
1961 查看

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!


形象
丢弃
相关帖文 回复 查看 活动
2
7月 24
5602
0
1月 24
2386
1
10月 23
2669
1
1月 25
4301
1
6月 24
5074