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
Le Filament
Opération Auto-Consommation Collective
oacc_portal_overview_cdc
Validations
9c8638ab
Valider
9c8638ab
rédigé
Il y a 2 mois
par
Rémi - Le Filament
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[FIX] prorata computation
parent
0c69a335
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
+1
-1
1 ajout, 1 suppression
controllers/main.py
models/acc_operation.py
+39
-52
39 ajouts, 52 suppressions
models/acc_operation.py
templates/operation_templates_page.xml
+3
-3
3 ajouts, 3 suppressions
templates/operation_templates_page.xml
avec
43 ajouts
et
56 suppressions
controllers/main.py
+
1
−
1
Voir le fichier @
9c8638ab
...
...
@@ -202,7 +202,7 @@ class CustomerPortal(CustomerPortal):
raise
werkzeug
.
exceptions
.
abort
(
werkzeug
.
wrappers
.
Response
(
status
=
401
))
if
graph_type
==
"
repartition_data
"
:
vals
=
operation
.
get_repartition_data
(
start_date
,
end_date
,
partner_id
,
prm_id
,
data_type
,
graph_type
start_date
,
end_date
,
partner_id
,
prm_id
)
else
:
vals
=
operation
.
get_graph
(
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
models/acc_operation.py
+
39
−
52
Voir le fichier @
9c8638ab
...
...
@@ -103,11 +103,8 @@ class AccOperation(models.Model):
for
counter_id
in
counter_ids
:
# injection
if
filter_counter_id
is
not
None
and
counter_id
!=
filter_counter_id
:
continue
timeslot_ids
=
counter_ids
[
counter_id
]
for
timeslot_id
in
timeslot_ids
:
timeslot
=
timeslot_ids
[
timeslot_id
]
total_surplus
=
total_surplus
+
timeslot
[
"
surplus
"
]
total_prod
=
total_prod
+
timeslot
[
"
prod
"
]
total_surplus
=
total_surplus
+
counter_ids
[
counter_id
][
"
surplus
"
]
total_prod
=
total_prod
+
counter_ids
[
counter_id
][
"
prod
"
]
return
total_prod
,
total_surplus
def
sort_partners_prorata
(
...
...
@@ -120,21 +117,18 @@ class AccOperation(models.Model):
counter_ids
=
partner
[
"
acc_counter_ids
"
]
autocons
=
0
for
counter_id
in
counter_ids
:
# soutirage
timeslot_ids
=
counter_ids
[
counter_id
]
for
timeslot_id
in
timeslot_ids
:
timeslot
=
timeslot_ids
[
timeslot_id
]
if
filter_counter_id
is
not
None
:
autocons
=
(
autocons
+
timeslot
[
"
autocons_per_inj_counter
"
][
filter_counter_id
]
+
counter_ids
[
counter_id
]
[
"
autocons_per_inj_counter
"
][
filter_counter_id
]
)
elif
filter_partner_id
is
not
None
:
autocons
=
(
autocons
+
timeslot
[
"
autocons_per_inj_partner
"
][
filter_partner_id
]
+
counter_ids
[
counter_id
]
[
"
autocons_per_inj_partner
"
][
filter_partner_id
]
)
else
:
autocons
=
autocons
+
timeslot
[
"
autocons
"
]
autocons
=
autocons
+
counter_ids
[
counter_id
]
[
"
autocons
"
]
tPartners
[
partner_id
]
=
autocons
total
=
total
+
autocons
...
...
@@ -148,22 +142,19 @@ class AccOperation(models.Model):
):
tCounters
=
{}
for
counter_id
in
counter_ids
:
# soutirage
timeslot_ids
=
counter_ids
[
counter_id
]
autocons
=
0
for
timeslot_id
in
timeslot_ids
:
timeslot
=
timeslot_ids
[
timeslot_id
]
if
filter_counter_id
is
not
None
:
autocons
=
(
autocons
+
timeslot
[
"
autocons_per_inj_counter
"
][
filter_counter_id
]
+
counter_ids
[
counter_id
]
[
"
autocons_per_inj_counter
"
][
filter_counter_id
]
)
elif
filter_partner_id
is
not
None
:
autocons
=
(
autocons
+
timeslot
[
"
autocons_per_inj_partner
"
][
filter_partner_id
]
+
counter_ids
[
counter_id
]
[
"
autocons_per_inj_partner
"
][
filter_partner_id
]
)
else
:
autocons
=
autocons
+
timeslot
[
"
autocons
"
]
autocons
=
autocons
+
counter_ids
[
counter_id
]
[
"
autocons
"
]
tCounters
[
counter_id
]
=
autocons
sorted_counter
=
dict
(
...
...
@@ -190,22 +181,19 @@ class AccOperation(models.Model):
tCounter
[
"
zip
"
]
=
dbCounter
.
zip
tCounter
[
"
city
"
]
=
dbCounter
.
city
timeslot_ids
=
counter_ids
[
counter_id
]
autocons
=
0
for
timeslot_id
in
timeslot_ids
:
timeslot
=
timeslot_ids
[
timeslot_id
]
if
filter_counter_id
is
not
None
:
autocons
=
(
autocons
+
timeslot
[
"
autocons_per_inj_counter
"
][
filter_counter_id
]
+
counter_ids
[
counter_id
]
[
"
autocons_per_inj_counter
"
][
filter_counter_id
]
)
elif
filter_partner_id
is
not
None
:
autocons
=
(
autocons
+
timeslot
[
"
autocons_per_inj_partner
"
][
filter_partner_id
]
+
counter_ids
[
counter_id
]
[
"
autocons_per_inj_partner
"
][
filter_partner_id
]
)
else
:
autocons
=
autocons
+
timeslot
[
"
autocons
"
]
autocons
=
autocons
+
counter_ids
[
counter_id
]
[
"
autocons
"
]
subtotal
=
subtotal
+
autocons
tCounter
[
"
autocons
"
]
=
autocons
...
...
@@ -250,8 +238,6 @@ class AccOperation(models.Model):
end_date
,
filter_partner_id
,
filter_prm_id
,
data_type
,
graph_type
,
):
self
.
ensure_one
()
start_date
=
datetime
.
strptime
(
start_date
,
"
%d/%m/%Y
"
)
...
...
@@ -260,6 +246,7 @@ class AccOperation(models.Model):
acc_operation_id
=
self
.
id
,
start_date
=
start_date
,
end_date
=
end_date
,
filter_date
=
False
,
)
self
.
env
[
"
acc.logs
"
].
create
(
{
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
templates/operation_templates_page.xml
+
3
−
3
Voir le fichier @
9c8638ab
...
...
@@ -451,7 +451,7 @@
<tr
class=
"fw-bolder bg-light"
>
<td
class=
"text-uppercase"
>
Surplus
</td>
<td
class=
"text-end text-nowrap"
><t
t-esc=
"('%.
0
f' % tSurplus['surplus'])"
t-esc=
"('%.
2
f' % tSurplus['surplus'])"
/>
kWh
</td>
<td
class=
"text-end text-nowrap"
><t
t-esc=
"('%.1f' % tSurplus['percentage']).replace('.', ',')"
...
...
@@ -466,7 +466,7 @@
>
<td><t
t-esc=
"tPartner['name']"
/></td>
<td
class=
"text-end text-nowrap"
><t
t-esc=
"('%.
0
f' % tPartner['autocons'])"
t-esc=
"('%.
2
f' % tPartner['autocons'])"
/>
kWh
</td>
<td
class=
"text-end text-nowrap"
><t
t-esc=
"('%.1f' % tPartner['percentage']).replace('.', ',')"
...
...
@@ -491,7 +491,7 @@
/>
</td>
<td
class=
"text-end text-nowrap"
><t
t-esc=
"('%.
0
f' % tCounter['autocons'])"
t-esc=
"('%.
2
f' % tCounter['autocons'])"
/>
kWh
</td>
<td
class=
"text-end text-nowrap"
><t
t-esc=
"('%.1f' % tCounter['percentage']).replace('.', ',')"
...
...
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