Reputation: 84
I am trying to get the knowledge about how odoo creates a field, which methods are invoked while creating it. I am following below link.
I have tried to change _add_field , setup_base and setup_attr methods present in "odoo/models.py","odoo/fields.py" initially by printing a simple statement, but it generates an error. "IndentationError: unexpected indent" Once I got success printing a statement but it was printed when I started odoo server (while initializing all the existing fields).
So my question is still at the point from where I started,When we create a new field in Odoo 10 in a model what actually happens in the back end. How different methods are invoked as I have to perform some custom operations on Odoo fields latter on using this concept.
Upvotes: -1
Views: 259
Reputation: 39
When we press the create button it renders the respective form view in any case(either for creation of field or model or anything), no function is invoked at that time. After the data is entered when we press save button, it calls the function against save(I don't know exactly at the moment which function is it). The function in save decides if it was an edit call or create call
Specific to your case i.e. creating new field, it will call create function in odoo/odoo/models.py which is responsible for creating new record.
Upvotes: 0