This question has been flagged
4 Replies
3339 Views

Hi everyone

I recently encountered an issue while using Odoo Enterprise 16 on Odoo.sh. I have over 100 portal users who are employees, but I couldn't afford the rates for 100+ internal users in the Odoo.sh environment. This implementation of Odoo is being used as a closed system for an intranet, and only user creation is done by Google OAuth for the company domain, with all pages hidden so that only portal users can see the site and content.

While this worked great for the intranet resource, I ran into a limitation when trying to use the gamification tool. I was only able to deploy badges to employees, or internal users. However, I only had a handful of licenses available for internal users, and paying the list price for internal user licenses to make use of the free tool seemed like a cruel joke.

So, I used Odoo Studio to modify the test environment and it worked! I then performed the same update to the live environment and everything is working. The problem stemmed from the HR settings of the employee form view. The 'Related User' was tagged to the internal users, so I updated this to any user with a status of confirmed by doing the following:

  1. Go to your employees and select or create an employee to open the HR.employee view form.
  2. Click on the Odoo Studio in the upper right-hand corner to enter the studio configurator.
  3. Once in the configurator, select the 'HR Settings' tab and then the 'Related User' field.
  4. On the left configuration editor, select the 'Domain' entry filter field and replace with [["user_ids.active","=",True]].
  5. In the builder, you can search for 'users'>'active' set to 'true'. This will compute a list of confirmed portal users, which includes the internal users.

I am not an Odoo developer, so I have no idea if this breaks anything in the backend. However, for me, this seems to have no noticeable impact on my system. I hope this information is helpful to others who may be facing a similar issue.


I hope this helps someone.

Avatar
Discard

This helped me, thank you sir

Will implement this in code

Author

@Jonathan Githumbi
when you do would you mind sharing your code? I am working on a larger module to do this and update the portal page for users to see their badges.

Hi there, managed to get the Related users to display portal users as well as internal users by inheriting the hr.view_employee_form and using this code to override the domain rule for the user_id field :
<odoo>
<record id="view_employee_form_inherit_portal_user" model="ir.ui.view">
<field name="name">hr.employee.form.inherit.portal_user</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='hr_settings']//field[@name='user_id']" position="attributes">
<attribute name="domain">[('active', '=', True)]</attribute>
</xpath>
</field>
</record>
</odoo>

https://github.com/JonathanGithumbi/relate_employee_portaluser

I suppose the same strategy can be applied for any field where you need to access both portal and internal users

Best Answer

An alternative approach to achieve the same result is to utilize the import function in the Human Resources module. By preparing an Excel or CSV file with the IDs of the employee records and the corresponding portal user record IDs, you can also accomplish this task.  

In our scenario, the Human Resources department is looking to acknowledge all employees by sending them congratulatory badges via email using the Odoo module. These recognitions range from simple accomplishments such as ‘Consistent Early Arrival’ to significant milestones like ‘Decade-long with Us’.

Avatar
Discard
Best Answer

not just for sales gamification but for hr modules

Avatar
Discard
Best Answer

Sure thing.

Avatar
Discard
Best Answer

Hi, can you give some screenshots for this ? If followed all your steps, but where to see employees already have access for this ? I have tried to login using the email for portal that I setup with your recommendation, but not seeing any changes on the portal account.

Avatar
Discard
Author

This doesn't change anything in portal. Just in the HR Sheet for granting badges. You can now select users that are not marked as internal ( licensed )