Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
A
ap_sale_project
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
Arbre et Paysage
ap_sale_project
Validations
81775e15
Valider
81775e15
rédigé
Il y a 1 mois
par
Julien - Le Filament
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[UPD] ajout modifications sur export
parent
90f81c4e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
1
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
controllers/export.py
+44
-20
44 ajouts, 20 suppressions
controllers/export.py
avec
44 ajouts
et
20 suppressions
controllers/export.py
+
44
−
20
Voir le fichier @
81775e15
...
@@ -50,21 +50,26 @@ def export_xlsx(data_by_sheet):
...
@@ -50,21 +50,26 @@ def export_xlsx(data_by_sheet):
class
ApExportController
(
http
.
Controller
):
class
ApExportController
(
http
.
Controller
):
def
get_filename
(
self
,
type
,
saison
):
@staticmethod
def
get_filename
(
file_type
,
saison
):
prefix
=
{
prefix
=
{
"
order
"
:
"
suivi_commande
"
,
"
order
"
:
"
suivi_commande
"
,
"
fin
"
:
"
suivi_financeurs
"
,
"
fin
"
:
"
suivi_financeurs
"
,
"
tech
"
:
"
suivi_technique
"
,
"
tech
"
:
"
suivi_technique
"
,
}
}
return
f
"
{
prefix
.
get
(
type
,
'
fichier
'
)
}
_
{
saison
.
name
}
.xlsx
"
return
f
"
{
prefix
.
get
(
file_
type
,
'
fichier
'
)
}
_
{
saison
.
name
}
.xlsx
"
def
get_nb_staples
(
self
,
inter_id
):
@staticmethod
def
get_nb_staples
(
inter_id
):
staples
=
0
staples
=
0
if
inter_id
.
mulch_has_staples
:
if
inter_id
.
mulch_has_staples
:
if
inter_id
.
mulch_id
:
if
inter_id
.
mulch_id
:
if
inter_id
.
mulch_id
.
nb_accesories
and
inter_id
.
mulch_id
.
nb_accesories
>
0.0
:
if
(
inter_id
.
mulch_id
.
nb_accesories
and
inter_id
.
mulch_id
.
nb_accesories
>
0.0
):
mulch_qty
=
inter_id
.
mulch_id
.
nb_accesories
mulch_qty
=
inter_id
.
mulch_id
.
nb_accesories
else
:
else
:
mulch_qty
=
2
mulch_qty
=
2
...
@@ -73,7 +78,10 @@ class ApExportController(http.Controller):
...
@@ -73,7 +78,10 @@ class ApExportController(http.Controller):
if
inter_id
.
mulch2_has_staples
:
if
inter_id
.
mulch2_has_staples
:
if
inter_id
.
mulch2_id
:
if
inter_id
.
mulch2_id
:
if
inter_id
.
mulch2_id
.
nb_accesories
and
inter_id
.
mulch2_id
.
nb_accesories
>
0.0
:
if
(
inter_id
.
mulch2_id
.
nb_accesories
and
inter_id
.
mulch2_id
.
nb_accesories
>
0.0
):
mulch2_qty
=
inter_id
.
mulch2_id
.
nb_accesories
mulch2_qty
=
inter_id
.
mulch2_id
.
nb_accesories
else
:
else
:
mulch2_qty
=
2
mulch2_qty
=
2
...
@@ -81,26 +89,38 @@ class ApExportController(http.Controller):
...
@@ -81,26 +89,38 @@ class ApExportController(http.Controller):
return
staples
if
staples
>
0
else
""
return
staples
if
staples
>
0
else
""
def
get_linked_contact
(
self
,
partner_id
):
@staticmethod
def
get_linked_contact
(
partner_id
):
if
partner_id
.
child_ids
:
if
partner_id
.
child_ids
:
return
"
,
"
.
join
([
child
.
name
for
child
in
partner_id
.
child_ids
])
return
"
,
"
.
join
([
child
.
name
for
child
in
partner_id
.
child_ids
])
return
""
return
""
def
get_financial_help
(
self
,
inter
):
@staticmethod
if
inter
.
financial_help_ids
:
def
get_financial_help
(
inter_id
):
return
"
,
"
.
join
([
h
.
name
for
h
in
inter
.
financial_help_ids
])
if
inter_id
.
financial_help_ids
:
return
"
,
"
.
join
([
h
.
name
for
h
in
inter_id
.
financial_help_ids
])
return
""
return
""
def
get_nb_big_trees
(
self
,
inter_id
):
@staticmethod
def
get_nb_collarette
(
inter_id
):
if
inter_id
.
is_collarette
:
return
inter_id
.
collarette_qty
return
""
@staticmethod
def
get_nb_big_trees
(
inter_id
):
nb_big
=
0
nb_big
=
0
if
inter_id
.
sequence_type
==
"
list
"
:
if
inter_id
.
sequence_type
==
"
list
"
:
nb_big
=
sum
(
plant
.
qty
for
plant
in
inter_id
.
plant_list_ids
if
plant
.
scale
==
"
big
"
)
nb_big
=
sum
(
plant
.
qty
for
plant
in
inter_id
.
plant_list_ids
if
plant
.
scale
==
"
big
"
)
elif
inter_id
.
sequence_type
==
"
sequence
"
:
elif
inter_id
.
sequence_type
==
"
sequence
"
:
if
inter_id
.
intervention_uom_name
==
"
m
"
and
inter_id
.
plant_interval
!=
0.0
:
if
inter_id
.
intervention_uom_name
==
"
m
"
and
inter_id
.
plant_interval
!=
0.0
:
plants_qty
=
(
plants_qty
=
(
math
.
ceil
(
inter_id
.
intervention_length
/
inter_id
.
plant_interval
)
+
1
math
.
ceil
(
inter_id
.
intervention_length
/
inter_id
.
plant_interval
)
+
1
)
)
elif
inter_id
.
intervention_uom_name
==
"
Unité(s)
"
:
elif
inter_id
.
intervention_uom_name
==
"
Unité(s)
"
:
plants_qty
=
inter_id
.
plant_qty
plants_qty
=
inter_id
.
plant_qty
...
@@ -108,13 +128,14 @@ class ApExportController(http.Controller):
...
@@ -108,13 +128,14 @@ class ApExportController(http.Controller):
full_seq_qty
=
plants_qty
//
len
(
inter_id
.
plant_sequence_ids
)
full_seq_qty
=
plants_qty
//
len
(
inter_id
.
plant_sequence_ids
)
nb_big_in_seq
=
0
nb_big_in_seq
=
0
for
plant
in
inter_id
.
plant_sequence_ids
:
for
plant
in
inter_id
.
plant_sequence_ids
:
if
plant
.
scale
==
'
big
'
:
if
plant
.
scale
==
"
big
"
:
nb_big_in_seq
+=
1
nb_big_in_seq
+=
1
nb_big
=
nb_big_in_seq
*
full_seq_qty
nb_big
=
nb_big_in_seq
*
full_seq_qty
return
nb_big
if
nb_big
>
0
else
""
return
nb_big
if
nb_big
>
0
else
""
def
get_order_data
(
self
,
saison
):
@staticmethod
def
get_order_data
(
saison
):
"""
"""
export commande
export commande
"""
"""
...
@@ -238,7 +259,7 @@ class ApExportController(http.Controller):
...
@@ -238,7 +259,7 @@ class ApExportController(http.Controller):
project
.
_fields
[
"
online
"
].
selection
project
.
_fields
[
"
online
"
].
selection
).
get
(
project
.
online
)
).
get
(
project
.
online
)
or
""
,
or
""
,
"
Longueur
de haie
"
:
inter
.
intervention_length
or
""
,
"
Longueur
(en m)
"
:
inter
.
intervention_length
or
""
,
"
Nombre de plants
"
:
inter
.
plant_qty
or
""
,
"
Nombre de plants
"
:
inter
.
plant_qty
or
""
,
"
Surface (en m²)
"
:
inter
.
surface
or
""
,
"
Surface (en m²)
"
:
inter
.
surface
or
""
,
"
Dont nombre total d
'
arbres (grands)
"
:
self
.
get_nb_big_trees
(
"
Dont nombre total d
'
arbres (grands)
"
:
self
.
get_nb_big_trees
(
...
@@ -247,7 +268,7 @@ class ApExportController(http.Controller):
...
@@ -247,7 +268,7 @@ class ApExportController(http.Controller):
"
Type d
'
intervention
"
:
inter
.
intervention_type_id
.
name
or
""
,
"
Type d
'
intervention
"
:
inter
.
intervention_type_id
.
name
or
""
,
"
Implantation
"
:
inter
.
location_id
.
name
or
""
,
"
Implantation
"
:
inter
.
location_id
.
name
or
""
,
"
Objectif plantation
"
:
project
.
plant_goal_id
.
name
or
""
,
"
Objectif plantation
"
:
project
.
plant_goal_id
.
name
or
""
,
"
Avancement
"
:
project
.
admin_state_id
.
name
,
"
Avancement
"
:
"
;
"
.
join
([
avancement
.
name
for
avancement
in
project
.
sale_project_advancement_ids
])
,
"
Aides financières
"
:
self
.
get_financial_help
(
inter
),
"
Aides financières
"
:
self
.
get_financial_help
(
inter
),
}
}
...
@@ -284,7 +305,7 @@ class ApExportController(http.Controller):
...
@@ -284,7 +305,7 @@ class ApExportController(http.Controller):
"
Télephone
"
:
project
.
partner_id
.
phone
or
""
,
"
Télephone
"
:
project
.
partner_id
.
phone
or
""
,
"
Email
"
:
project
.
partner_id
.
email
or
""
,
"
Email
"
:
project
.
partner_id
.
email
or
""
,
"
Commune intervention
"
:
inter
.
city
or
""
,
"
Commune intervention
"
:
inter
.
city
or
""
,
"
Longueur
de haie
"
:
inter
.
intervention_length
or
""
,
"
Longueur
(en m)
"
:
inter
.
intervention_length
or
""
,
"
Nombre de plants
"
:
inter
.
plant_qty
or
""
,
"
Nombre de plants
"
:
inter
.
plant_qty
or
""
,
"
Surface (en m²)
"
:
inter
.
surface
or
""
,
"
Surface (en m²)
"
:
inter
.
surface
or
""
,
"
Dont nombre total d
'
arbres (grands)
"
:
self
.
get_nb_big_trees
(
"
Dont nombre total d
'
arbres (grands)
"
:
self
.
get_nb_big_trees
(
...
@@ -301,8 +322,11 @@ class ApExportController(http.Controller):
...
@@ -301,8 +322,11 @@ class ApExportController(http.Controller):
"
Qté protegée bas
"
:
inter
.
low_protection_qty
or
""
,
"
Qté protegée bas
"
:
inter
.
low_protection_qty
or
""
,
"
Qté bambous
"
:
inter
.
bamboo_qty
or
""
,
"
Qté bambous
"
:
inter
.
bamboo_qty
or
""
,
"
Nombre d
'
agrafes
"
:
self
.
get_nb_staples
(
inter
),
"
Nombre d
'
agrafes
"
:
self
.
get_nb_staples
(
inter
),
"
Nombre de collerettes
"
:
inter
.
collarette_qty
or
""
,
"
Nombre de collerettes
"
:
self
.
get_nb_collarette
(
inter
),
"
Mois livraison
"
:
project
.
delivery_month
or
""
,
"
Mois livraison
"
:
dict
(
project
.
_fields
[
"
delivery_month
"
].
selection
).
get
(
project
.
delivery_month
)
or
""
,
"
Accueil démo
"
:
dict
(
project
.
_fields
[
"
demo
"
].
selection
).
get
(
"
Accueil démo
"
:
dict
(
project
.
_fields
[
"
demo
"
].
selection
).
get
(
project
.
demo
project
.
demo
)
)
...
...
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