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
- Účetnictví
- Sklad
- PoS
- Project
- MRP
This question has been flagged
            
                1
                
                    Odpovědět
                
            
        
        
            
                3372
                
                    Zobrazení
                
            
        
    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
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Přihlásit se| Related Posts | Odpovědi | Zobrazení | Aktivita | |
|---|---|---|---|---|
|  | 1 dub 24  | 2898 | ||
|  | 0 led 24  | 2374 | ||
|  | 1 zář 23  | 3980 | ||
|  | 2 dub 23  | 6124 | ||
|  | 2 led 23  | 8652 | 
