Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I've got this situation in which a boolean field get's changed by the user. And, it gets saved.
But... whenever the form is loaded, that field has to be set to False. Notice that I am not referring to default value. No, the field's value has to be changed so, no matter what value was saved, it has to be reset to False the next time the form is loaded.
I thought about using a computed field that would change the other field's value but, despite the log tellng me the value had been changed, nothing happened in the form.
An __init__, perhaps? Tried it but it was always raising an error. The model is product.template, BTW
You can use the fields_view_get method of models.Model.
This method is called whenever odoo is rendering a view of the model.
It gets the correct view given the context and returns the data of the field.
This \tutorial may help.
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 9/28/16, 1:32 AM|
|Seen: 503 times|
|Last updated: 9/28/16, 4:21 AM|