[IMP] base: introduce "_is_portal" on res.users

This commit introduces a "_is_portal" method complementary to the existing
"_is_internal" and "_is_public".

The goal is to ease usage through the code base and be able to easily
distinguish our 3 main use cases: public, portal and internal users.

Task-3056280

closes odoo/odoo#120827

Related: odoo/enterprise#38575
Related: odoo/upgrade#4575
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
Aurélien Warnon
2023-05-10 19:16:57 +02:00
parent 3bbabf5618
commit 728ceccca1
+4
View File
@@ -1031,6 +1031,10 @@ class Users(models.Model):
self.ensure_one()
return not self.sudo().share
def _is_portal(self):
self.ensure_one()
return self.has_group('base.group_portal')
def _is_public(self):
self.ensure_one()
return self.has_group('base.group_public')