Odoo Help

0

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

By
Sami Mattila
on 11/6/15, 11:17 AM 699 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--
16009
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0; Odoo 8.0, 9.0, 10.0.

Completed Odoo Functional and Technical Training.

Major Skills:

  • User Needs and GAP Analysis;

  • Functional and Technical Design;

  • Prototyping and Proof of Concepts;

  • Requirements Specifications;

  • Agile Implementation;

  • Data Migration;

  • Configuration & Customization (UI and code);

  • Integration - Odoo and non Odoo Applications and Services;

  • Training and Knowledge Transfer;

  • Go Live Support;

  • Helpdesk;

  • Version Upgrades and Migration.

  • Accounting Expert.

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. 

I am a skilled Communicator and I only take the serious things seriously!

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

Register

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

1 follower(s)

Stats

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