Connect Servala Portal User to Odoo Contact (Partner) #60

Open
opened 2025-05-20 12:43:03 +00:00 by tobru · 1 comment
Owner

Stories

As a user, I want to see my contact details stored in the CRM

As the system, I want to have a connection from the portal user to a contact in the CRM

Implementation Notes

This is similar to #54 - we need to connect to the Odoo API and work with data in the res.partner model.

When a user logs in for the first time, we search for the email address in the res.partner model.

  • If exactly one match: Store the ID of the contact in the Portal DB and use this from now on
  • If more than one match or if no match: Create a new contact in Odoo and store the resulting ID in the Portal DB

Then display some information in the users' profile:

  • function
  • parent_id.display_name

Only read access, no editing yet. Also, no caching, directly get this information from Odoo. Make sure to handle the situation when Odoo API should be inaccessible.

## Stories _As a user, I want to see my contact details stored in the CRM_ _As the system, I want to have a connection from the portal user to a contact in the CRM_ ## Implementation Notes This is similar to #54 - we need to connect to the Odoo API and work with data in the `res.partner` model. When a user logs in for the first time, we search for the email address in the `res.partner` model. - If exactly one match: Store the ID of the contact in the Portal DB and use this from now on - If more than one match or if no match: Create a new contact in Odoo and store the resulting ID in the Portal DB Then display some information in the users' profile: - `function` - `parent_id.display_name` Only read access, no editing yet. Also, no caching, directly get this information from Odoo. Make sure to handle the situation when Odoo API should be inaccessible.
tobru added the
enhancement
label 2025-05-20 12:43:03 +00:00
tobru added this to the Servala Portal project 2025-05-20 12:43:03 +00:00
Member

As discussed in our call today, I'll implement a method User.get_odoo_contact(organization), as the Odoo contact may depend on the organization context, and retrieving it on the fly should be good enough for now. Will implement this as part of #54.

As discussed in our call today, I'll implement a method `User.get_odoo_contact(organization)`, as the Odoo contact may depend on the organization context, and retrieving it on the fly *should* be good enough for now. Will implement this as part of #54.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: servala/servala-portal#60
No description provided.