Hi,
how can I set event listener (from javascript) for change on Many2one field? Field is showed like select (but in HTML is text input field). Listener works if I write in field but if I change option by selection from list, no event is fired. I need it from javascript becouse I want change select options in other field. Or it's posible from python?
Odoo is the world's easiest all-in-one management software.
 It includes hundreds of business apps:
- CRM
- e-Commerce
- 会計
- 在庫
- PoS
- プロジェクト
- MRP
この質問にフラグが付けられました
            
                1
                
                    返信
                
            
        
        
            
                3381
                
                    ビュー
                
            
        
    Hi,
There is already a function called "onSelect" in Many2XAutocomplete component so you can use that by patching it.
/** @odoo-module **/
import { Many2XAutocomplete } from "@web/views/fields/relational_utils";
import { patch } from "@web/core/utils/patch";
patch(Many2XAutocomplete.prototype, "file_path or something unique", {
onSelect(option, params = {}){
// your code
this._super.apply(this, arguments);
}
})
Regards
| 関連投稿 | 返信 | ビュー | 活動 | |
|---|---|---|---|---|
|  | 1 4月 24  | 2904 | ||
|  | 0 1月 24  | 2384 | ||
|  | 1 9月 23  | 3983 | ||
|  | 2 4月 23  | 6129 | ||
|  | 2 1月 23  | 8676 | 
