Odoo Help

Welcome!

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.

0

Add a custom field (for storing domains owned) to a Customer record?

By
Sami Mattila
on 11/6/15, 11:17 AM 627 views

I need to add a "Domains" tab to Company "Contacts" Form that can be used to list the domains company owns.

How do I do that?


Sam
Using odoo9

1

Ray Carnes

--Ray Carnes--
15717
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

Ray Carnes
On 11/10/15, 7:09 PM

1. Make sure you are in Developer Mode.

2. Settings --> Technical --> Database Structure --> Models

  • You need to create a new model (table) to store the domain.

  • Click CREATE.

  • Enter Domains for the model description, x_domain for the model name.

  • Click Add an Item to add a field to store the URL:

          
  • Click Save and New to add a field to store the Customer the URL is related to:

       

          


  •  Save the model

3. Link the model to the Partner model, so Customers can have one or more domains:

  • Open the res.partner model

  • Add a new field x_domain_ids

          
  • Save this change.


4.   Settings --> Technical --> User Interface --> Views

Create a new View to add the x_domain_ids field to the User Interface:




This is the final result:


Thank you for your clear answer. I seem to be missing something though since the View can't be saved. The error message is... Invalid view definition Error details: Field `x_name` does not exist Error context: View `res.partner.form.custom` [view_id: 1678, xml_id: n/a, model: res.partner, parent_id: 123]

Sami Mattila
on 11/11/15, 9:32 AM

http://dl.dropbox.com/u/49702772/Selection_083.jpg

Sami Mattila
on 11/11/15, 9:48 AM

I think you made a mistake on step (3). Can you post a screenshot of how you added x_domain_ids to res.partner?

Bista Solutions US, Ray Carnes
on 11/11/15, 11:32 AM

http://dl.dropbox.com/u/49702772/Selection_084.jpg

Sami Mattila
on 11/12/15, 1:56 AM

http://dl.dropbox.com/u/49702772/Selection_085.jpg

Sami Mattila
on 11/12/15, 1:57 AM

http://dl.dropbox.com/u/49702772/Selection_085.jpg

Sami Mattila
on 11/12/15, 1:57 AM

Your last two screenshots are the same. Can you post a screenshot of how you added x_domain_ids to res.partner?

Bista Solutions US, Ray Carnes
on 11/12/15, 1:55 PM

This is the screenshot of res.partner... http://dl.dropbox.com/u/49702772/Selection_084.jpg And this is the screenshot of x_domain_ids it self... http://dl.dropbox.com/u/49702772/Selection_085.jpg Looks ok...

Sami Mattila
on 11/13/15, 6:41 AM

I don't see anything wrong with any of the screenshots you have shared. Can you share the screenshot of your VIEW res.partner.form.custom?

Bista Solutions US, Ray Carnes
on 11/16/15, 7:32 PM

If I try to Save this it will give an error. http://dl.dropbox.com/u/49702772/Selection_087.jpg Here is the error... http://dl.dropbox.com/u/49702772/Selection_086.jpg

Sami Mattila
on 11/19/15, 4:52 AM

Sorry it isn't working for you. I repeated the steps I posted on a new database and it all worked fine. I am guessing you aren't saving everything but I don't know how else I can assist you - it has worked twice for me following exactly what I posted for you.

Bista Solutions US, Ray Carnes
on 11/19/15, 1:39 PM
0
Sami Mattila
On 3/29/16, 2:42 AM

Thx. This worked on a new odoo 9 installation.

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

1 follower(s)

Stats

Asked: 11/6/15, 11:17 AM
Seen: 627 times
Last updated: 3/29/16, 2:42 AM