Odoo Help

1

How to add a new type of partner?

By
Dale E. Moore
on 10/6/13, 10:33 AM 1,210 views

I'd like to have a type of partner, like ice cream truck owners, or beauticians about which I collect additional information. Would you suggest I add a type_of_partner field in res.partner, or create a new table beauty.partner with the new fields and partner_id to keep the typical partner information like name, address...

Is the additional information you want to store the same for all the types ?

odoo.ma by IBS Group
on 10/6/13, 2:40 PM

...and how many variants will there be?

Could you use the tags?

Cameron
on 10/6/13, 7:55 PM

All ice cream truck owners will have the same additional information. All beauticians will have the same additional information. Ice cream truck owners and beauticians will not have the same additional information. There's actually just one variant now.

Moore Works, Dale E. Moore
on 10/7/13, 12:37 AM
1
odoo.ma by IBS Group
On 10/7/13, 1:09 AM

Just add a new profession type field to res.partner ( a selection )

And then add additional tabs to the form notebook, one for each profession type, in these tabs you can put their respective additional information fields.

You can then show or hide all the profession additional information tabs except one, depending on the value of the profession type field.

Notes:

  • Make sure you update the state of the form ( hide the unnecessary form tabs ) if the value of the profession type is changed ( use the onchange event )
  • Make sure to clear the old values if the profession was changed ( do this when the user saves, not on the onchange event, because perhaps they want to cancel the changes )

And none of this new stuff goes into new tables? All new fields are added to res.partner?

Moore Works, Dale E. Moore
on 10/7/13, 9:09 AM

Should I have any concerns about upgrading OpenERP and loosing my changes to the res.partner table?

Moore Works, Dale E. Moore
on 10/7/13, 10:04 AM

Yes indeed, you only need to augment the res.partner object by inheriting it. As for updating, as long as you put all of this in a module, including the form modifications, it shouldn't be a problem.

odoo.ma by IBS Group
on 10/7/13, 11:03 AM

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: 10/6/13, 10:33 AM
Seen: 1210 times
Last updated: 3/16/15, 8:10 AM