Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odoo CE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Comunitats Energètiques
Odoo CE
Merge requests
!142
Feature/assign ce admin
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Feature/assign ce admin
feature/assign_ce_admin
into
dev
Overview
43
Commits
46
Pipelines
32
Changes
15
Merged
Benjamí Ramos
requested to merge
feature/assign_ce_admin
into
dev
1 year ago
Overview
43
Commits
46
Pipelines
32
Changes
3
Expand
0
0
Merge request reports
Compare
version 6
version 31
49a2aa3c
1 year ago
version 30
6d59400f
1 year ago
version 29
0af0b9ba
1 year ago
version 28
9bbad0ac
1 year ago
version 27
639e20bc
1 year ago
version 26
c9c9ae05
1 year ago
version 25
07cde450
1 year ago
version 24
de8d1aaf
1 year ago
version 23
33c9b9b5
1 year ago
version 22
0963ceb6
1 year ago
version 21
75d7a9a5
1 year ago
version 20
8952c9ed
1 year ago
version 19
748dd1d4
1 year ago
version 18
9d199b41
1 year ago
version 17
c3c06d75
1 year ago
version 16
6d5cb862
1 year ago
version 15
24344cfc
1 year ago
version 14
00798db2
1 year ago
version 13
58732f3b
1 year ago
version 12
9bd678d8
1 year ago
version 11
c165f240
1 year ago
version 10
c1373ffa
1 year ago
version 9
ebf397fd
1 year ago
version 8
58cdbbfb
1 year ago
version 7
2983c3b2
1 year ago
version 6
5c488dfd
1 year ago
version 5
48a5ef61
1 year ago
version 4
bbe7b923
1 year ago
version 3
4fbc836b
1 year ago
version 2
ae7db9c3
1 year ago
version 1
deef37d0
1 year ago
dev (base)
and
version 7
latest version
283b3bdd
46 commits,
1 year ago
version 31
49a2aa3c
46 commits,
1 year ago
version 30
6d59400f
46 commits,
1 year ago
version 29
0af0b9ba
45 commits,
1 year ago
version 28
9bbad0ac
45 commits,
1 year ago
version 27
639e20bc
45 commits,
1 year ago
version 26
c9c9ae05
44 commits,
1 year ago
version 25
07cde450
43 commits,
1 year ago
version 24
de8d1aaf
39 commits,
1 year ago
version 23
33c9b9b5
35 commits,
1 year ago
version 22
0963ceb6
33 commits,
1 year ago
version 21
75d7a9a5
33 commits,
1 year ago
version 20
8952c9ed
33 commits,
1 year ago
version 19
748dd1d4
32 commits,
1 year ago
version 18
9d199b41
32 commits,
1 year ago
version 17
c3c06d75
31 commits,
1 year ago
version 16
6d5cb862
31 commits,
1 year ago
version 15
24344cfc
30 commits,
1 year ago
version 14
00798db2
29 commits,
1 year ago
version 13
58732f3b
26 commits,
1 year ago
version 12
9bd678d8
24 commits,
1 year ago
version 11
c165f240
23 commits,
1 year ago
version 10
c1373ffa
23 commits,
1 year ago
version 9
ebf397fd
22 commits,
1 year ago
version 8
58cdbbfb
19 commits,
1 year ago
version 7
2983c3b2
17 commits,
1 year ago
version 6
5c488dfd
16 commits,
1 year ago
version 5
48a5ef61
15 commits,
1 year ago
version 4
bbe7b923
14 commits,
1 year ago
version 3
4fbc836b
13 commits,
1 year ago
version 2
ae7db9c3
10 commits,
1 year ago
version 1
deef37d0
10 commits,
1 year ago
Show latest version
3 files
+
35
−
16
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
energy_communities/models/res_users.py
+
4
−
6
Options
@@ -279,7 +279,7 @@ class ResUsers(models.Model):
for
child_company
in
child_companies
:
self
.
make_ce_user
(
company_id
,
"
role_ce_admin
"
)
# TODO: New super-role!
def
add_energy_community_role
(
self
,
role_name
,
company_id
):
def
add_energy_community_role
(
self
,
company_id
,
role_name
):
if
role_name
==
'
role_ce_member
'
or
role_name
==
'
role_ce_admin
'
:
self
.
make_ce_user
(
company_id
,
role_name
)
elif
role_name
==
'
role_coordination
'
or
role_name
==
'
role_coordination
'
:
# TODO: Change role name and New super-role!
@@ -290,21 +290,19 @@ class ResUsers(models.Model):
)
def
create_energy_community_base_user
(
cls
,
vat
,
first_name
,
last_name
,
lang_code
,
email
,
company_id
cls
,
vat
,
first_name
,
last_name
,
lang_code
,
email
):
vals
=
{
"
login
"
:
vat
,
"
firstname
"
:
first_name
,
"
lastname
"
:
last_name
,
# "company_id": company_id, # TODO: Move!
# "company_ids": [(6, 0, [company_id])], # TODO: Move!
"
lang
"
:
lang_code
,
"
email
"
:
email
,
}
user
=
cls
.
create
(
vals
)
user
.
make_internal_user
()
#
user.create_users_on_keycloak()
# TEMPORAL
#
user.send_reset_password_mail()
# TEMPORAL
user
.
create_users_on_keycloak
()
user
.
send_reset_password_mail
()
return
user
Loading