I am in a case that I need to change a field value from outside the widget (Example Browser JS Console).
I have the input id and when I change its value it is not saved on form save.
I think that the field Widget do have some events that should be called in order for the value to be registered.
To reproduce the case try just to change any form input value from the browser dev tools (inspector) and you will notice that when you save the form the value will disappear.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project
- MRP
This question has been flagged
Hello Slim
i have just applied javascript to change value of phone field on contact form.
find id of your field where you want to change value
1) check following field has id o_field_input_53 and value is 3331.
2) now i have changed phone value and it has been changed.
$('#o_field_input_13').val('3333')
$("#o_field_input_13").trigger("change");
3) apply $("#o_field_input_13").trigger("change"); and save record
Thanks & Regards,
CandidRoot Solutions Pvt. Ltd.
Mobile: (+91) 8849036209
Email: info@candidroot.com
Skype: live:candidroot
Web: https://www.candidroot.com
Address: 1229-1230, Iconic Shyamal, Near Shyamal Cross Road, Ahmedabad, Gujarat
we have to apply trigger change event externally
$("#o_field_input_13").trigger("change");
what if the fields inside wizard? sometimes it's work and the rest is not
You are right this is sufficient, do you think is it possible to call widgets methods ? I think this can be helpful in other cases.
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up