4258680356_06ed6244d1_o

How-To (tech) Dynamically Modify Your View!

This a tech tutorial on how to dynamically modify your view on Odoo. In Odoo, once a view record is defined, there is not much possibility of dynamically changing it according to the record(s) that it is showcasing. For example, in its XML definition, you can’t make the ‘string‘ attribute of a field to be the value of another field.

Most of the time, our needs can be solved using selection fields, notably state/type, if the changes we would like to impose are limited to a few variations. But it does not resolve the need to dynamically change the view according to model contents.

It is therefore needed that we override the fields_view_get function in the models.Model. Since apparently its documentation is “scarce” on line, we shall take a detailed tour around it.
Continue reading

Startup Stock Photo

How-To: Adding a field on Odoo

How to add a field on Odoo

This is a sample “sales” module of Odoo version 8, loaded with demo data.
Under the “sales” module, “Sales/Customers” label, I have opened “Michel Fletcher” customer form for the example.

Customization Needed: I want to be able to enter the contact’s Personal Mobile Phone in a separate field.
Continue reading