Skip to Content
Menu
This question has been flagged
13 Replies
4210 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

Avatar
Discard
Best Answer

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:


Avatar
Discard
Author

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]

Author

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

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

Author

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

Author

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

Author

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

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

Author

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

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?

Author

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

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.

Author Best Answer

Thx. This worked on a new odoo 9 installation.

Avatar
Discard
Related Posts Replies Views Activity
1
Aug 24
295
1
Sep 15
5059
0
Aug 24
252
2
Aug 24
348
2
Mar 24
4028