Skip to Content
मेन्यू
This question has been flagged

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
Discard
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
Discard
Author

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

Related Posts Replies Views Activity
3
अक्तू॰ 23
5129
0
मार्च 25
1026
1
दिस॰ 23
1691
0
दिस॰ 23
1726
1
अक्तू॰ 23
5371