This question has been flagged
1 Reply
5552 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...

Avatar
Discard

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

...and how many variants will there be?

Could you use the tags?

Author

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.

Best Answer

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 )
Avatar
Discard
Author

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

Author

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

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.