Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
O
oacc_portal_overview_cdc
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
Arthur - Enercoop
oacc_portal_overview_cdc
Validations
d7a01830
Valider
d7a01830
rédigé
6 févr. 2024
par
Julien - Le Filament
Validation de
Rémi - Le Filament
6 févr. 2024
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[ADD] curves export
parent
0c0425e8
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
controllers/main.py
+31
-0
31 ajouts, 0 suppression
controllers/main.py
static/src/js/operation_chart.js
+22
-0
22 ajouts, 0 suppression
static/src/js/operation_chart.js
templates/operation_templates_page.xml
+5
-1
5 ajouts, 1 suppression
templates/operation_templates_page.xml
avec
58 ajouts
et
1 suppression
controllers/main.py
+
31
−
0
Voir le fichier @
d7a01830
...
@@ -174,3 +174,34 @@ class CustomerPortal(CustomerPortal):
...
@@ -174,3 +174,34 @@ class CustomerPortal(CustomerPortal):
)
)
return
vals
return
vals
@http.route
(
[
"
/chart/export_cdc
"
],
type
=
"
http
"
,
auth
=
"
user
"
,
methods
=
[
"
GET
"
],
website
=
True
,
csrf
=
False
,
)
def
chart_export_cdc
(
self
,
operation_id
=
None
,
partner_id
=
None
,
prm_id
=
None
,
start_date
=
None
,
end_date
=
None
,
data_type
=
None
,
**
kw
,
):
"""
This route is called :
- When click on button export
"""
operation
=
request
.
env
[
"
acc.operation
"
].
sudo
().
browse
(
int
(
operation_id
))
file_values
=
operation
.
export_cdc
(
start_date
,
end_date
,
partner_id
,
prm_id
,
data_type
)
return
request
.
make_response
(
file_values
.
get
(
"
data
"
),
headers
=
file_values
.
get
(
"
headers
"
)
)
Ce diff est replié.
Cliquez pour l'agrandir.
static/src/js/operation_chart.js
+
22
−
0
Voir le fichier @
d7a01830
...
@@ -11,6 +11,7 @@ odoo.define("oacc_portal_overview_cdc.operation_chart", function (require) {
...
@@ -11,6 +11,7 @@ odoo.define("oacc_portal_overview_cdc.operation_chart", function (require) {
selector
:
"
.operation_chart
"
,
selector
:
"
.operation_chart
"
,
events
:
{
events
:
{
"
click .btn-period
"
:
"
_onBtnPeriodClick
"
,
"
click .btn-period
"
:
"
_onBtnPeriodClick
"
,
"
click #export-data
"
:
"
_onBtnExportClick
"
,
"
click #previous-period
"
:
"
_onPreviousPeriod
"
,
"
click #previous-period
"
:
"
_onPreviousPeriod
"
,
"
click #next-period
"
:
"
_onNextPeriod
"
,
"
click #next-period
"
:
"
_onNextPeriod
"
,
"
change select[name='endpoint']
"
:
"
_onChangePrm
"
,
"
change select[name='endpoint']
"
:
"
_onChangePrm
"
,
...
@@ -652,10 +653,27 @@ odoo.define("oacc_portal_overview_cdc.operation_chart", function (require) {
...
@@ -652,10 +653,27 @@ odoo.define("oacc_portal_overview_cdc.operation_chart", function (require) {
"
</h3>
"
;
"
</h3>
"
;
title_cdc
.
replaceWith
(
title_upd
);
title_cdc
.
replaceWith
(
title_upd
);
}
}
self
.
_updateDataTemplate
(
data
);
self
.
_updateDataTemplate
(
data
);
});
});
},
},
_exportChartData
:
function
(
title_name
)
{
var
self
=
this
;
var
url
=
"
/chart/export_cdc?operation_id=
"
+
self
.
operation
;
url
=
url
+
"
&start_date=
"
+
self
.
first_day
;
url
=
url
+
"
&end_date=
"
+
self
.
last_day
;
url
=
url
+
"
&data_type=
"
+
self
.
data_type
if
(
self
.
partner_id
)
{
url
=
url
+
"
&partner_id=
"
+
self
.
partner_id
;
}
if
(
self
.
prm_id
)
{
url
=
url
+
"
&prm_id=
"
+
self
.
prm_id
}
window
.
open
(
url
,
"
_blank
"
)
},
_updateDataTemplate
:
function
(
data
)
{
_updateDataTemplate
:
function
(
data
)
{
var
self
=
this
;
var
self
=
this
;
...
@@ -748,6 +766,10 @@ odoo.define("oacc_portal_overview_cdc.operation_chart", function (require) {
...
@@ -748,6 +766,10 @@ odoo.define("oacc_portal_overview_cdc.operation_chart", function (require) {
this
.
_updateChartData
(
this
.
title_name
);
this
.
_updateChartData
(
this
.
title_name
);
},
},
_onBtnExportClick
:
function
(
ev
)
{
this
.
_exportChartData
(
this
.
title_name
);
},
_onChangePrm
:
function
(
ev
)
{
_onChangePrm
:
function
(
ev
)
{
var
selected
=
$
(
ev
.
currentTarget
).
find
(
"
option:selected
"
);
var
selected
=
$
(
ev
.
currentTarget
).
find
(
"
option:selected
"
);
this
.
title_name
=
selected
.
data
(
"
name
"
);
this
.
title_name
=
selected
.
data
(
"
name
"
);
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
templates/operation_templates_page.xml
+
5
−
1
Voir le fichier @
d7a01830
...
@@ -198,7 +198,7 @@
...
@@ -198,7 +198,7 @@
class=
"col-10 col-xl-5 align-self-center mt-4 mt-lg-0"
class=
"col-10 col-xl-5 align-self-center mt-4 mt-lg-0"
t-if=
"partners"
t-if=
"partners"
>
>
<div
class=
"prm-selection align-items-
center
d-flex"
>
<div
class=
"prm-selection align-items-
between justify-content-around
d-flex"
>
<select
<select
class=
"form-select"
class=
"form-select"
aria-label=
"prm-selection"
aria-label=
"prm-selection"
...
@@ -248,6 +248,10 @@
...
@@ -248,6 +248,10 @@
</t>
</t>
</t>
</t>
</select>
</select>
<a
href=
"#"
title=
"Export"
target=
"_blank"
class=
"fa fa-cloud-download btn btn-primary"
id=
"export-data"
>
Exporter les
<br/>
données
</a>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
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