Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
A
adefpat_avenants
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_avenants
Validations
6934c4b0
Valider
6934c4b0
rédigé
25 août 2021
par
Juliana
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[UPD]Change model for cout avenant
parent
ec23b281
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
4
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
4 fichiers modifiés
__manifest__.py
+1
-0
1 ajout, 0 suppression
__manifest__.py
models/project.py
+29
-97
29 ajouts, 97 suppressions
models/project.py
security/ir.model.access.csv
+2
-1
2 ajouts, 1 suppression
security/ir.model.access.csv
views/project_views.xml
+8
-7
8 ajouts, 7 suppressions
views/project_views.xml
avec
40 ajouts
et
105 suppressions
__manifest__.py
+
1
−
0
Voir le fichier @
6934c4b0
...
...
@@ -8,6 +8,7 @@
'
depends
'
:
[
'
adefpat_project
'
,
'
adefpat_alfresco_generation
'
,
'
adefpat_account
'
],
'
data
'
:
[
'
security/ir.model.access.csv
'
,
'
views/account_invoice_views.xml
'
,
'
views/project_views.xml
'
,
],
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
models/project.py
+
29
−
97
Voir le fichier @
6934c4b0
...
...
@@ -75,10 +75,10 @@ class Project(models.Model):
string
=
"
Financements Avenants
"
)
total_financement_av
=
fields
.
Float
(
"
Total autres Avenants
"
,
compute
=
'
_compute_total_financment_av
'
)
cout_av_ids
=
fields
.
One2many
(
'
adefpat.project.cout
'
,
'
adefpat.project.cout
.av
'
,
'
project_id
'
,
domain
=
[(
'
type_avenant
'
,
'
=
'
,
True
)],
string
=
"
Coûts Avenants
"
)
total_cout_av
=
fields
.
Float
(
"
Total coûts Avenants
"
,
compute
=
'
_compute_total_cout_av
'
)
# honoraire_intervenant = fields.Float(
# "Honoraires d'intervenants")
...
...
@@ -300,10 +300,9 @@ class Project(models.Model):
keys_obj
=
consult
.
fill_data
()
keys
.
update
(
keys_obj
)
cout_ids
=
self
.
env
[
'
adefpat.project.cout
'
].
sudo
().
read_group
(
cout_ids
=
self
.
env
[
'
adefpat.project.cout
.av
'
].
sudo
().
read_group
(
[(
'
project_id
'
,
'
=
'
,
project
.
id
),
(
'
partner_id
'
,
'
=
'
,
consult
.
partner_id
.
id
),
(
'
type_avenant
'
,
'
=
'
,
True
)],
(
'
consultant_id
'
,
'
=
'
,
consult
.
id
)],
[
'
partner_id
'
,
'
montant
'
,
'
nb_jour_theorique
'
,
'
nb_jour_pratiques
'
],
[
'
partner_id
'
],
lazy
=
False
)
...
...
@@ -364,98 +363,6 @@ class Project(models.Model):
'
target
'
:
'
new
'
,
}
@api.multi
def
generate_dossier_conventions
(
self
):
for
project
in
self
:
if
not
project
.
cmis_folder
:
raise
UserError
(
"
Le répertoire Projet d
'
Alfresco n
'
est pas configuré
"
)
# Fill data project
keys
=
project
.
fill_data
()
# Récupération des conventions d'accompagnement
# 1 par formateur
template_docs
=
self
.
env
[
'
adefpat.template.doc
'
].
search
([
'
&
'
,
'
|
'
,
(
'
convention_ids
'
,
'
=
'
,
False
),
(
'
convention_ids
'
,
'
=
'
,
project
.
type_convention_id
.
id
),
(
'
type_temp
'
,
'
=
'
,
'
convention_accompagnement
'
)])
for
template_doc
in
template_docs
:
####################################
# Group by consultants
####################################
consulant_ok_ids
=
self
.
consulant_ids
.
filtered
(
lambda
r
:
r
.
is_selected
==
True
)
for
consult
in
consulant_ok_ids
:
keys_obj
=
consult
.
fill_data
()
keys
.
update
(
keys_obj
)
cout_ids
=
self
.
env
[
'
adefpat.project.cout
'
].
sudo
().
read_group
(
[(
'
project_id
'
,
'
=
'
,
project
.
id
),
(
'
partner_id
'
,
'
=
'
,
consult
.
partner_id
.
id
),
(
'
type_avenant
'
,
'
=
'
,
False
)
],
[
'
partner_id
'
,
'
montant
'
,
'
nb_jour_theorique
'
,
'
nb_jour_pratiques
'
],
[
'
partner_id
'
],
lazy
=
False
)
keys
[
'
##montant##
'
]
=
cout_ids
[
0
][
'
montant
'
]
keys
[
'
##nb_jour_theorique_tot##
'
]
=
cout_ids
[
0
][
'
nb_jour_theorique
'
]
keys
[
'
##nb_jour_pratique_tot##
'
]
=
cout_ids
[
0
][
'
nb_jour_pratiques
'
]
keys
[
'
##nb_jour_tot##
'
]
=
cout_ids
[
0
][
'
nb_jour_pratiques
'
]
+
cout_ids
[
0
][
'
nb_jour_theorique
'
]
keys
[
'
##nb_heure_tot##
'
]
=
(
cout_ids
[
0
][
'
nb_jour_pratiques
'
]
+
cout_ids
[
0
][
'
nb_jour_theorique
'
])
*
7
project
.
_publipostage_documents
(
template_doc
,
keys
,
False
)
# Récupération des annexes de conventions d'accompagnement
# 1 par bénéficiaire
template_docs
=
self
.
env
[
'
adefpat.template.doc
'
].
search
([
'
&
'
,
'
|
'
,
(
'
convention_ids
'
,
'
=
'
,
False
),
(
'
convention_ids
'
,
'
=
'
,
project
.
type_convention_id
.
id
),
(
'
type_temp
'
,
'
=
'
,
'
annexe_convention
'
)])
for
template_doc
in
template_docs
:
for
financ
in
project
.
financement_ids
:
keys_obj
=
financ
.
fill_data
()
keys
.
update
(
keys_obj
)
project
.
_publipostage_documents
(
template_doc
,
keys
,
False
)
# Récupération des conventions d'objectif
template_docs
=
self
.
env
[
'
adefpat.template.doc
'
].
search
([
'
&
'
,
'
|
'
,
(
'
convention_ids
'
,
'
=
'
,
False
),
(
'
convention_ids
'
,
'
=
'
,
project
.
type_convention_id
.
id
),
(
'
type_temp
'
,
'
=
'
,
'
convention_objectif
'
)])
for
template_doc
in
template_docs
:
# Get the display name of first Animateur
if
project
.
animateur_ids
:
first_od
=
project
.
animateur_ids
[
0
]
keys_anim
=
first_od
.
get_data_anim
()
keys
.
update
(
keys_anim
)
# Get the OD
if
project
.
od_ids
:
od_id
=
project
.
od_ids
[
0
]
keys_od
=
od_id
.
get_data_od
()
keys
.
update
(
keys_od
)
project
.
_publipostage_documents
(
template_doc
,
keys
,
True
)
# Open URL from path in alfresco
backend_name
=
self
.
_fields
[
'
cmis_folder
'
]
backend
=
backend_name
.
get_backend
(
project
.
env
)
parent_path
=
backend
.
get_cmis_repository
().
getFolder
(
project
.
cmis_folder
).
getPaths
()
path_proj
=
parent_path
+
[
template_doc
.
dossier
.
name
]
path
=
'
/
'
.
join
(
path_proj
)
cmis_folder
=
backend
.
get_folder_by_path
(
path
)
properties
=
backend
.
get_cmis_repository
().
getFolder
(
cmis_folder
).
getProperties
()
url
=
backend
.
get_content_details_url_from_props
(
properties
)
return
{
'
type
'
:
'
ir.actions.act_url
'
,
'
url
'
:
url
,
'
target
'
:
'
new
'
,
}
@api.multi
def
action_generate_invoices_av
(
self
):
for
project
in
self
:
...
...
@@ -585,6 +492,31 @@ class AdefpatCout(models.Model):
type_avenant
=
fields
.
Boolean
(
"
Type avenant
"
,
default
=
False
)
class
AdefpatCoutAV
(
models
.
Model
):
_name
=
'
adefpat.project.cout.av
'
_description
=
'
Coûts Avenants
'
module
=
fields
.
Char
(
"
Nom du module
"
)
project_id
=
fields
.
Many2one
(
'
project.project
'
,
string
=
'
Projet
'
,
default
=
lambda
self
:
self
.
env
.
context
.
get
(
'
default_project_id
'
))
consultant_id
=
fields
.
Many2one
(
'
res.partner.consultants.project
'
,
string
=
"
Consultant
"
,
domain
=
"
[(
'
is_selected
'
,
'
=
'
, True)]
"
,
on_delete
=
'
restrict
'
)
partner_id
=
fields
.
Many2one
(
'
res.partner
'
,
string
=
'
Consultant
'
,
related
=
'
consultant_id.partner_id
'
)
nb_jour_theorique
=
fields
.
Float
(
"
Nombre de jours théoriques
"
)
nb_jour_pratiques
=
fields
.
Float
(
"
Nombre de jours pratiques
"
)
cout_jour
=
fields
.
Float
(
"
Coût jour
"
,
related
=
'
consultant_id.cout_journée
'
)
montant
=
fields
.
Float
(
"
Montant
"
,
compute
=
'
_compute_montant
'
,
store
=
True
)
class
AdefpatTemplateDoc
(
models
.
Model
):
_inherit
=
'
adefpat.template.doc
'
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
security/ir.model.access.csv
+
2
−
1
Voir le fichier @
6934c4b0
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_adefpat_project_cout_av_group_user,access_adefpat_project_cout_av_group_user,model_adefpat_project_cout_av,base.group_user,1,1,1,1
\ No newline at end of file
Ce diff est replié.
Cliquez pour l'agrandir.
views/project_views.xml
+
8
−
7
Voir le fichier @
6934c4b0
...
...
@@ -71,15 +71,16 @@
<field
name=
"nb_jour_theorique_tot_av"
/>
</group>
</group>
<field
name=
"cout_av_ids"
widget=
"one2many"
context=
"{'default_type_avenant': True}"
>
<field
name=
"cout_av_ids"
widget=
"one2many"
>
<tree
string=
"Coûts Avenants"
editable=
"top"
>
<field
name=
"module"
/>
<field
name=
"partner_id"
/>
<field
name=
"consultant_id"
/>
<field
name=
"partner_id"
invisible=
"1"
/>
<field
name=
"nb_jour_theorique"
/>
<field
name=
"nb_jour_pratiques"
/>
<field
name=
"cout_jour"
/>
<field
name=
"montant"
sum=
"Montant"
/>
<field
name=
"
type_avenant
"
invisible=
"1"
/>
<field
name=
"
project_id
"
invisible=
"1"
/>
</tree>
</field>
<field
name=
"financement_av_ids"
widget=
"one2many"
context=
"{'default_type_avenant': True}"
>
...
...
@@ -105,15 +106,15 @@
<tr>
<td>
Honoraire d'intervenant :
<field
name=
"cout_av_ids"
widget=
"one2many"
context=
"{'default_type_avenant': True}"
>
<field
name=
"cout_av_ids"
widget=
"one2many"
>
<tree
string=
"Coûts"
editable=
"top"
>
<field
name=
"module"
/>
<field
name=
"partner_id"
/>
<field
name=
"consultant_id"
/>
<field
name=
"partner_id"
invisible=
"1"
/>
<field
name=
"nb_jour_theorique"
/>
<field
name=
"nb_jour_pratiques"
/>
<field
name=
"cout_jour"
/>
<field
name=
"montant"
sum=
"Montant"
/>
<field
name=
"type_avenant"
invisible=
"1"
/>
</tree>
</field>
</td>
...
...
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