Skip to Content
Menú
This question has been flagged
1 Respondre
1560 Vistes

Hello! 

I have a problem triggering the event at a many2one field in a popover from mrp.workorder 

this is the field i put:
<div class="row">                <span class="col-6">Seleccione un Tambor</span>                <span name="selected_pope_id" class="o_field_widget col-4 pe-2">                    <Many2OneField t-props="tamborInfo" t-on-change="updateSelectedPope"/>                </span>            </div>

and this is the js/owl component:
get tamborInfo() {        return {            name: "selected_pope_id",            record: this.props.record,        };    }

this get the values for selected_pope_id, thats ok... but When i click in one of the registries, doesnt trigger.. never gets in the update o in the t-on-change and I dont know why, If somebody could help please!

thanks!

Avatar
Descartar
Best Answer

Hi,

In the Many2OneField component, you don't need to add t-on-change. You can pass the update function directly in the props.


Modify your tamborInfo function like this


get tamborInfo() {

    return {

        name: "selected_pope_id",

        record: this.props.record,

        update: this.updateSelectedPope.bind(this),

    };

}


Then, use it in your template:

<Many2OneField t-props="tamborInfo"/>

In the updateSelectedPope function, you can handle the updated value as needed.


Hope it helps

Avatar
Descartar
Autor

hello!! thank you so much for you answer!! it helped a lot!

Related Posts Respostes Vistes Activitat
3
d’oct. 23
5342
0
de març 25
1149
1
de des. 23
1815
0
de des. 23
1857
1
d’oct. 23
5591