Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
1549 Lượt xem

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!

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 10 23
5331
0
thg 3 25
1136
1
thg 12 23
1809
0
thg 12 23
1855
1
thg 10 23
5575