Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
A
adefpat_alfodoo
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
Adefpat
adefpat_alfodoo
Validations
1302f1ce
Valider
1302f1ce
rédigé
Il y a 2 ans
par
Juliana
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[UPD]Fix bug generation Bilan
parent
0aac3b20
Branches
Branches contenant la validation
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
3
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
3 fichiers modifiés
models/account.py
+11
-2
11 ajouts, 2 suppressions
models/account.py
models/hr_expense.py
+43
-1
43 ajouts, 1 suppression
models/hr_expense.py
wizard/adefpat_project_justif_zip_wizard.py
+14
-2
14 ajouts, 2 suppressions
wizard/adefpat_project_justif_zip_wizard.py
avec
68 ajouts
et
5 suppressions
models/account.py
+
11
−
2
Voir le fichier @
1302f1ce
...
@@ -68,12 +68,21 @@ class AccountInvoice(models.Model):
...
@@ -68,12 +68,21 @@ class AccountInvoice(models.Model):
"""
"""
if
self
.
task_ids
:
if
self
.
task_ids
:
task_start
=
self
.
task_ids
.
sorted
(
key
=
lambda
r
:
r
.
date_deadline
)[
0
].
date_deadline
task_start
=
self
.
task_ids
.
sorted
(
key
=
lambda
r
:
r
.
date_deadline
)[
0
].
date_deadline
if
task_start
:
start_date
=
fields
.
Datetime
.
to_datetime
(
task_start
).
isoformat
()
else
:
start_date
=
""
task_end
=
self
.
task_ids
.
sorted
(
key
=
lambda
r
:
r
.
date_deadline
,
reverse
=
True
)[
0
].
date_deadline
task_end
=
self
.
task_ids
.
sorted
(
key
=
lambda
r
:
r
.
date_deadline
,
reverse
=
True
)[
0
].
date_deadline
if
task_end
:
end_date
=
fields
.
Datetime
.
to_datetime
(
task_end
).
isoformat
()
else
:
end_date
=
""
return
{
return
{
'
cmis:secondaryObjectTypeIds
'
:
[
'
P:adefpat:facture
'
],
'
cmis:secondaryObjectTypeIds
'
:
[
'
P:adefpat:facture
'
],
'
adefpat:factureStartDate
'
:
fields
.
Datetime
.
to_datetime
(
task_start
).
isoformat
()
,
'
adefpat:factureStartDate
'
:
start_date
,
'
adefpat:factureEndDate
'
:
fields
.
Datetime
.
to_datetime
(
task_end
).
isoformat
()
,
'
adefpat:factureEndDate
'
:
end_date
,
'
adefpat:factureTypeConvention
'
:
self
.
type_convention_id
.
name
or
""
,
'
adefpat:factureTypeConvention
'
:
self
.
type_convention_id
.
name
or
""
,
'
adefpat:factureProjet
'
:
self
.
project_id
.
name
or
""
,
}
}
else
:
else
:
return
{
return
{
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
models/hr_expense.py
+
43
−
1
Voir le fichier @
1302f1ce
# Copyright 2020 Le Filament (<http://www.le-filament.com>)
# Copyright 2020 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import
logging
from
odoo
import
api
,
models
,
fields
from
odoo
import
api
,
models
,
fields
from
odoo.exceptions
import
UserError
from
odoo.exceptions
import
UserError
,
ValidationError
from
cmislib.exceptions
import
ContentAlreadyExistsException
,
\
ObjectNotFoundException
,
UpdateConflictException
,
InvalidArgumentException
_logger
=
logging
.
getLogger
(
__name__
)
ALFRESCO_TRACKED_FIELDS
=
[
'
type_convention_id
'
,
'
date
'
,
'
employee_id
'
]
class
AdefpatHrExpense
(
models
.
Model
):
class
AdefpatHrExpense
(
models
.
Model
):
...
@@ -14,6 +22,40 @@ class AdefpatHrExpense(models.Model):
...
@@ -14,6 +22,40 @@ class AdefpatHrExpense(models.Model):
# ------------------------------------------------------
# ------------------------------------------------------
# Override ORM
# Override ORM
# ------------------------------------------------------
# ------------------------------------------------------
@api.multi
def
write
(
self
,
vals
):
"""
Surcharge la fonction write() pour mettre à jour
le type de convention, la date et l
'
utilisateur
"""
# Ecriture des nouvelles valeurs
result
=
super
(
AdefpatHrExpense
,
self
).
write
(
vals
)
change_fields
=
vals
.
keys
()
# check intersection
is_alfresco_field
=
[
value
for
value
in
change_fields
if
value
in
ALFRESCO_TRACKED_FIELDS
]
# Check des modifications sur les coopératives présentes dans RIGA
for
record
in
self
:
if
record
.
proof_file
:
if
is_alfresco_field
:
try
:
properties
=
self
.
get_file_properties
()
backend
=
self
.
env
[
'
cmis.backend
'
].
search
([],
limit
=
1
)
file
=
backend
.
get_cmis_repository
().
getObject
(
self
.
proof_file
)
file
.
updateProperties
(
properties
)
except
(
ContentAlreadyExistsException
,
ObjectNotFoundException
,
UpdateConflictException
,
InvalidArgumentException
)
as
e
:
_logger
.
error
(
e
)
raise
ValidationError
(
"""
Erreur de mise à jour Alfresco :
- Code : %s
- Url : %s
- Détail : %s
"""
%
(
e
.
status
,
e
.
url
,
e
.
details
))
except
Exception
as
e
:
raise
ValidationError
(
e
)
return
result
@api.multi
@api.multi
def
unlink
(
self
):
def
unlink
(
self
):
for
espense
in
self
:
for
espense
in
self
:
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
wizard/adefpat_project_justif_zip_wizard.py
+
14
−
2
Voir le fichier @
1302f1ce
...
@@ -72,7 +72,7 @@ class AdefpatProjectJustifZip(models.TransientModel):
...
@@ -72,7 +72,7 @@ class AdefpatProjectJustifZip(models.TransientModel):
json_file
=
[]
json_file
=
[]
for
project
in
project_ids
:
for
project
in
project_ids
:
compteur
+=
1
compteur
+=
1
proj
=
project
.
name
.
replace
(
"
"
,
"
_x0020_
"
)
proj
=
project
.
name
.
replace
(
"
"
,
"
_x0020_
"
)
.
replace
(
"'"
,
"
_x0027
"
)
path
=
"
PATH:
'
/app:company_home/st:sites/cm:odoo/cm:documentLibrary/cm:Projets/cm:
"
+
proj
path
=
"
PATH:
'
/app:company_home/st:sites/cm:odoo/cm:documentLibrary/cm:Projets/cm:
"
+
proj
json_file
.
append
({
json_file
.
append
({
"
id
"
:
bilan_nb
+
str
(
compteur
),
"
id
"
:
bilan_nb
+
str
(
compteur
),
...
@@ -133,6 +133,18 @@ class AdefpatProjectJustifZip(models.TransientModel):
...
@@ -133,6 +133,18 @@ class AdefpatProjectJustifZip(models.TransientModel):
"
query
"
:
path
+
"
/cm:admin//*
'"
+
"
AND (=adefpat:typeDocument:
'
convention d
'
accompagnement
'
OR =adefpat:typeDocument:
'
convention d
'
objectif
'
)
"
,
"
query
"
:
path
+
"
/cm:admin//*
'"
+
"
AND (=adefpat:typeDocument:
'
convention d
'
accompagnement
'
OR =adefpat:typeDocument:
'
convention d
'
objectif
'
)
"
,
},
},
},
},
{
"
id
"
:
bilan_nb
+
str
(
compteur
)
+
"
7
"
,
"
name
"
:
"
Factures Fournisseurs
"
,
"
description
"
:
"
Factures Fournisseurs
"
,
"
search
"
:
{
"
language
"
:
"
fts-alfresco
"
,
"
query
"
:
"
(PATH:
'
/app:company_home/st:sites/cm:odoo/cm:documentLibrary/cm:Factures_x0020_fournisseurs//*
'
) AND (+adefpat:factureEndDate:[
'"
+
str
(
self
.
period_start
)
+
"'
TO
'"
+
str
(
self
.
period_end
)
+
"'
] OR +adefpat:factureSartDate:[
'"
+
str
(
self
.
period_start
)
+
"'
TO
'"
+
str
(
self
.
period_end
)
+
"'
]) AND =adefpat:factureProjet:
'"
+
project
.
name
+
"'"
,
},
},
]})
]})
virtual_json
=
{
virtual_json
=
{
...
...
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