Odoo Help


add an existing field to a model

Barry Achterberg
on 10/29/13, 12:35 PM 1,786 views


I want to add the existing field "state" to the model "mail.compose.message". I want to do this because in my custom view(based on the mail.compose.message model), I want to send a message and at the same time change the workflow "hr_timesheet_sheet.sheet".

Can someone tell me how I can get this done?

On 10/30/13, 7:36 AM

Inherit the model 'mail.compose.message' and add the field.

okay, but the model 'hr_timesheet_sheet.sheet' already inherits 'mail.thread'. How can I add the 'mail.compose.message' so it inherits both models?

Barry Achterberg
on 10/30/13, 10:29 AM

that is not an issue if you want to add the field just inherit the base model. You can either inherit mail compose or hr_timesheet. but the module you give in depends in descriptor file matters. The fields upto the inherited model will be available to you. Add the field you wish in your new model which is inherited from the base model. and adjust the position of the field in the view in xml file, for that you have to inherit the view also

Abhishek H Menon
on 10/31/13, 4:08 AM

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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 10/29/13, 12:35 PM
Seen: 1786 times
Last updated: 3/16/15, 8:10 AM