Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
B
bluemind4-connector
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
Afficher davantage de fils d'Ariane
Le Filament
bluemind4-connector
Validations
4d8dee24
Valider
4d8dee24
rédigé
27 avr. 2022
par
Rémi - Le Filament
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[IMP] use function to retrieve calendar uid
parent
cde7171c
Branches
master
Étiquettes
v1.0.0
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
models/calendar_event.py
+1
-1
1 ajout, 1 suppression
models/calendar_event.py
models/res_users.py
+15
-8
15 ajouts, 8 suppressions
models/res_users.py
avec
16 ajouts
et
9 suppressions
models/calendar_event.py
+
1
−
1
Voir le fichier @
4d8dee24
...
@@ -44,7 +44,7 @@ PRIVACY_CONVERTER_O2B = {
...
@@ -44,7 +44,7 @@ PRIVACY_CONVERTER_O2B = {
}
}
# TODO: manage attendee_ids, organizer, alarm_ids, priority, status, categories ?
# TODO: manage attendee_ids, organizer, alarm_ids, priority, status, categories
, attachments
?
# TODO: check if recurrency properly working without exceptions
# TODO: check if recurrency properly working without exceptions
# TODO: manage exceptions in recurrencies
# TODO: manage exceptions in recurrencies
class
CalendarEvent
(
models
.
Model
):
class
CalendarEvent
(
models
.
Model
):
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
models/res_users.py
+
15
−
8
Voir le fichier @
4d8dee24
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
import
logging
import
logging
from
netbluemind.calendar.api.ICalendarUids
import
ICalendarUids
from
netbluemind.python.client
import
BMClient
,
ServerFault
from
netbluemind.python.client
import
BMClient
,
ServerFault
from
odoo
import
_
,
api
,
fields
,
models
from
odoo
import
_
,
api
,
fields
,
models
...
@@ -80,7 +81,12 @@ class ResUser(models.Model):
...
@@ -80,7 +81,12 @@ class ResUser(models.Model):
# TODO : add notification that it works or not
# TODO : add notification that it works or not
return
self
.
bluemind_auth
(
force
=
True
)
return
self
.
bluemind_auth
(
force
=
True
)
@api.depends
(
"
company_id.bluemind_domain
"
,
"
bluemind_login
"
,
"
bluemind_password
"
,
"
is_bm_connection_ok
"
)
@api.depends
(
"
company_id.bluemind_domain
"
,
"
bluemind_login
"
,
"
bluemind_password
"
,
"
is_bm_connection_ok
"
,
)
def
_compute_bluemind_user_id
(
self
):
def
_compute_bluemind_user_id
(
self
):
"""
"""
This method retrieves the user id from Bluemind client object
This method retrieves the user id from Bluemind client object
...
@@ -95,8 +101,7 @@ class ResUser(models.Model):
...
@@ -95,8 +101,7 @@ class ResUser(models.Model):
client
=
user
.
bluemind_auth
()
client
=
user
.
bluemind_auth
()
if
client
:
if
client
:
user
.
bluemind_user_id
=
(
user
.
bluemind_user_id
=
(
client
client
.
directory
(
user
.
company_id
.
bluemind_domain
)
.
directory
(
user
.
company_id
.
bluemind_domain
)
.
getByEmail
(
user
.
bluemind_login
)
.
getByEmail
(
user
.
bluemind_login
)
.
entryUid
.
entryUid
)
)
...
@@ -104,12 +109,14 @@ class ResUser(models.Model):
...
@@ -104,12 +109,14 @@ class ResUser(models.Model):
@api.depends
(
"
bluemind_user_id
"
)
@api.depends
(
"
bluemind_user_id
"
)
def
_compute_bluemind_calendar_uid
(
self
):
def
_compute_bluemind_calendar_uid
(
self
):
"""
"""
This method computes default Bluemind calendar_id for the current user
This method retrieves default calendar uid from Bluemind for the user
by concatenating calendar:Default: and Bluemind user_id
"""
"""
for
user
in
self
:
for
user
in
self
:
if
user
.
bluemind_user_id
:
client_bm
=
user
.
bluemind_auth
()
user
.
bluemind_calendar_id
=
"
calendar:Default:
"
+
user
.
bluemind_user_id
if
client_bm
and
user
.
bluemind_user_id
:
user
.
bluemind_calendar_id
=
ICalendarUids
(
client_bm
.
apiKey
,
client_bm
.
baseUrl
).
getDefaultUserCalendar
(
user
.
bluemind_user_id
)
def
sync_bluemind_calendar
(
self
):
def
sync_bluemind_calendar
(
self
):
"""
"""
...
@@ -191,7 +198,7 @@ class ResUser(models.Model):
...
@@ -191,7 +198,7 @@ class ResUser(models.Model):
odoo_events_no_bm
=
Calendar
.
search
(
odoo_events_no_bm
=
Calendar
.
search
(
[(
"
user_id
"
,
"
=
"
,
self
.
id
),
(
"
bluemind_id
"
,
"
=
"
,
False
)]
[(
"
user_id
"
,
"
=
"
,
self
.
id
),
(
"
bluemind_id
"
,
"
=
"
,
False
)]
)
)
odoo_event_no_bm
.
create_odoo_events_in_bm
()
odoo_event
s
_no_bm
.
create_odoo_events_in_bm
()
@api.model
@api.model
def
_sync_all_bm_calendar
(
self
):
def
_sync_all_bm_calendar
(
self
):
...
...
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