Odoo Help


This community 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.


add an existing field to a model

Barry Achterberg
on 10/29/13, 12:35 PM 1,158 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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


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