Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
A
acc_rest_api
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse du dépôt
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Ce projet est archivé. Le dépôt et les autres ressources du projet sont en lecture seule.
Afficher davantage de fils d'Ariane
Le Filament
Opération Auto-Consommation Collective
acc_rest_api
Validations
0275e5e4
Valider
0275e5e4
rédigé
Il y a 2 ans
par
Juliana
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[UPD]Add date log info on contact
parent
f4fb5cd3
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
services/auth_services.py
+7
-0
7 ajouts, 0 suppression
services/auth_services.py
services/operation_services.py
+23
-11
23 ajouts, 11 suppressions
services/operation_services.py
avec
30 ajouts
et
11 suppressions
services/auth_services.py
+
7
−
0
Voir le fichier @
0275e5e4
...
@@ -70,6 +70,8 @@ class AuthService(Component):
...
@@ -70,6 +70,8 @@ class AuthService(Component):
"
user
"
:
user_datas
,
"
user
"
:
user_datas
,
"
token
"
:
{
"
access_token
"
:
token
,
"
expiration_date
"
:
payload
.
get
(
"
exp
"
)},
"
token
"
:
{
"
access_token
"
:
token
,
"
expiration_date
"
:
payload
.
get
(
"
exp
"
)},
}
}
# Mise à jour de la date de connexion
user_id
.
partner_id
.
write
({
"
date_log
"
:
datetime
.
now
()})
return
datas
return
datas
# A faire pour gestion User
# A faire pour gestion User
...
@@ -179,6 +181,8 @@ class AuthService(Component):
...
@@ -179,6 +181,8 @@ class AuthService(Component):
user
=
{
user
=
{
"
login
"
:
user_id
.
login
,
"
login
"
:
user_id
.
login
,
}
}
# Mise à jour de la date de connexion
user
.
partner_id
.
write
({
"
date_log
"
:
datetime
.
now
()})
return
user
return
user
@restapi.method
(
@restapi.method
(
...
@@ -201,6 +205,7 @@ class AuthService(Component):
...
@@ -201,6 +205,7 @@ class AuthService(Component):
if
user
:
if
user
:
if
password
==
confirm_password
:
if
password
==
confirm_password
:
user
.
write
({
"
password
"
:
password
})
user
.
write
({
"
password
"
:
password
})
user
.
partner_id
.
write
({
"
date_log
"
:
datetime
.
now
()})
else
:
else
:
datas
[
datas
[
"
error
"
"
error
"
...
@@ -259,6 +264,8 @@ class AuthService(Component):
...
@@ -259,6 +264,8 @@ class AuthService(Component):
},
},
}
}
user
.
write
({
"
password
"
:
password
})
user
.
write
({
"
password
"
:
password
})
# Mise à jour de la date de connexion
user
.
partner_id
.
write
({
"
date_log
"
:
datetime
.
now
()})
else
:
else
:
datas
[
datas
[
"
error
"
"
error
"
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
services/operation_services.py
+
23
−
11
Voir le fichier @
0275e5e4
...
@@ -215,22 +215,33 @@ class OperationsService(Component):
...
@@ -215,22 +215,33 @@ class OperationsService(Component):
role
=
self
.
_get_role
(
operation
)
role
=
self
.
_get_role
(
operation
)
if
role
.
get
(
"
isConsumer
"
)
or
role
.
get
(
"
isProductor
"
):
if
role
.
get
(
"
isConsumer
"
)
or
role
.
get
(
"
isProductor
"
):
domain_c
+=
[
domain_c
+=
[
'
|
'
,
(
"
type
"
,
"
=
"
,
"
other
"
),
"
|
"
,
(
"
type
"
,
"
=
"
,
"
other
"
),
(
"
type
"
,
"
=
"
,
"
vente_achat
"
),
(
"
type
"
,
"
=
"
,
"
vente_achat
"
),
]
]
if
role
.
get
(
"
isPmo
"
):
if
role
.
get
(
"
isPmo
"
):
domain_pmo
+=
[(
"
type
"
,
"
!=
"
,
False
)]
domain_pmo
+=
[(
"
type
"
,
"
!=
"
,
False
)]
acc_contract_ids
=
self
.
env
[
"
acc.contract
"
].
sudo
().
search
(
domain_pmo
)
acc_contract_ids
=
self
.
env
[
"
acc.contract
"
].
sudo
().
search
(
domain_pmo
)
else
:
else
:
acc_contract_all
=
self
.
env
[
"
acc.contract
"
].
sudo
().
search
([
acc_contract_all
=
(
(
"
acc_operation_id
"
,
"
=
"
,
_id
),
(
"
type
"
,
"
=
"
,
"
all
"
),
self
.
env
[
"
acc.contract
"
]
])
.
sudo
()
.
search
(
[
(
"
acc_operation_id
"
,
"
=
"
,
_id
),
(
"
type
"
,
"
=
"
,
"
all
"
),
]
)
)
acc_contract_ids
=
self
.
env
[
"
acc.contract
"
].
search
(
domain_c
)
acc_contract_ids
=
self
.
env
[
"
acc.contract
"
].
search
(
domain_c
)
acc_contract_ids
+=
acc_contract_all
acc_contract_ids
+=
acc_contract_all
acc_contract_pmo
=
self
.
env
[
"
acc.contract
"
].
search
([
acc_contract_pmo
=
self
.
env
[
"
acc.contract
"
].
search
(
(
"
acc_operation_id
"
,
"
=
"
,
_id
),
(
"
type
"
,
"
=
"
,
"
pmo
"
),
[
])
(
"
acc_operation_id
"
,
"
=
"
,
_id
),
(
"
type
"
,
"
=
"
,
"
pmo
"
),
]
)
acc_contract_ids
+=
acc_contract_pmo
acc_contract_ids
+=
acc_contract_pmo
contract_exist
=
False
contract_exist
=
False
if
acc_contract_ids
:
if
acc_contract_ids
:
...
@@ -378,8 +389,9 @@ class OperationsService(Component):
...
@@ -378,8 +389,9 @@ class OperationsService(Component):
domain_prm
.
append
(
domain_prm
.
append
(
(
"
partner_id
"
,
"
in
"
,
[
partner_id
.
id
,
partner_id
.
parent_id
.
id
])
(
"
partner_id
"
,
"
in
"
,
[
partner_id
.
id
,
partner_id
.
parent_id
.
id
])
)
)
prm_ids
=
self
.
env
[
"
acc.counter
"
].
sudo
().
search
(
prm_ids
=
(
domain_prm
,
order
=
"
partner_id asc
"
)
self
.
env
[
"
acc.counter
"
].
sudo
().
search
(
domain_prm
,
order
=
"
partner_id asc
"
)
)
prm_name
=
prm_ids
.
mapped
(
prm_name
=
prm_ids
.
mapped
(
lambda
p
:
{
lambda
p
:
{
...
@@ -397,7 +409,7 @@ class OperationsService(Component):
...
@@ -397,7 +409,7 @@ class OperationsService(Component):
)
)
if
role
.
get
(
"
isConsumer
"
)
and
not
role
.
get
(
"
isPmo
"
)
and
not
prm_id
:
if
role
.
get
(
"
isConsumer
"
)
and
not
role
.
get
(
"
isPmo
"
)
and
not
prm_id
:
consumer_id
=
consumer_name
[
0
][
'
id
'
]
consumer_id
=
consumer_name
[
0
][
"
id
"
]
if
operation
.
is_data_enedis
:
if
operation
.
is_data_enedis
:
if
scale
:
if
scale
:
graph_datas
=
operation
.
graph_view_type
(
graph_datas
=
operation
.
graph_view_type
(
...
@@ -619,7 +631,7 @@ class OperationsService(Component):
...
@@ -619,7 +631,7 @@ class OperationsService(Component):
"
role
"
:
role
,
"
role
"
:
role
,
"
id
"
:
operation
.
id
,
"
id
"
:
operation
.
id
,
"
name
"
:
operation
.
name
,
"
name
"
:
operation
.
name
,
"
email
"
:
operation
.
sudo
().
pmo_id
.
mail_contact_pmo
"
email
"
:
operation
.
sudo
().
pmo_id
.
mail_contact_pmo
,
}
}
return
datas
return
datas
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter