Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
1333 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Penulis

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

Post Terkait Replies Tampilan Aktivitas
3
Okt 23
5003
0
Mar 25
938
1
Des 23
1612
0
Des 23
1670
1
Okt 23
5242