Is it possible to add a new column in the table "Contact" or "User". I want to add the first name of the user.
Thank you for your help.
You can add new column in the any tables using inherit.
For Ex :-
_inherit = 'res.users'
first_name = fields.Char('First Name')
<record id="res_users_form_view_inherit" model="ir.ui.view">
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<xpath expr="/form/sheet/div[@class='oe_title']/group/field[@name='partner_id']" position="after">
Now First name is display after Related Partner in Users form view.
For Contact, You will inherit res.partner model.
Hope it will works for you.
There is already a module available in the App store for this purpose: https://www.odoo.com/apps/modules/9.0/partner_firstname/
You should be careful to not break a lot of things if you do not ensure that the regular field "name" still has the proper value.
Note: i am assuming that you are not a developer.
For Adding a new field in any model follow these steps:
Go to setting-> technical->Database Structure ->Fields
Click on Create
Put the Field Name(x_first_name),Model(Users) ,Label/String[First Name] , Type[Text] etc.
Now open the corresponding view in edit mode ,put your field like <field name = "x_first_name"/> and save.
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
|Asked: 4/25/16, 5:52 PM|
|Seen: 278 times|
|Last updated: 4/26/16, 2:39 AM|