Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
oacc_overview_cdc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Le Filament
Opération Auto-Consommation Collective
oacc_overview_cdc
Commits
996ae7ff
Commit
996ae7ff
authored
1 year ago
by
Juliana
Browse files
Options
Downloads
Patches
Plain Diff
[UPD]Change date min calcul
parent
70779448
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
models/acc_operation.py
+2
-19
2 additions, 19 deletions
models/acc_operation.py
with
2 additions
and
19 deletions
models/acc_operation.py
+
2
−
19
View file @
996ae7ff
...
@@ -259,24 +259,6 @@ class AccOperation(models.Model):
...
@@ -259,24 +259,6 @@ class AccOperation(models.Model):
return
date_start
,
date_end
return
date_start
,
date_end
def
get_first_day
(
self
):
"""
Fonction retournant la première date où des données ont été enregistrées.
:return: une date
"""
# Get last date slot recorded
first_record
=
self
.
env
[
"
acc.enedis.cdc
"
].
sudo
().
search
(
[
(
"
acc_operation_id
"
,
"
in
"
,
self
.
ids
),
],
limit
=
1
,
order
=
"
date_slot ASC
"
,
)
date_min
=
first_record
.
date_slot
return
date_min
def
get_step_from_date
(
self
,
date_start
,
date_end
,
scale
=
None
):
def
get_step_from_date
(
self
,
date_start
,
date_end
,
scale
=
None
):
"""
"""
Fonction retournant le pas des courbes en fonction de 2 dates.
Fonction retournant le pas des courbes en fonction de 2 dates.
...
@@ -646,7 +628,8 @@ class AccOperation(models.Model):
...
@@ -646,7 +628,8 @@ class AccOperation(models.Model):
last_record
=
self
.
get_the_last_day
()
last_record
=
self
.
get_the_last_day
()
date_deb
,
date_max
=
self
.
get_last_day
(
"
day
"
,
last_record
)
date_deb
,
date_max
=
self
.
get_last_day
(
"
day
"
,
last_record
)
date_max
=
date_max
.
strftime
(
"
%d/%m/%Y
"
)
date_max
=
date_max
.
strftime
(
"
%d/%m/%Y
"
)
date_min
=
self
.
get_first_day
()
date_min
=
self
.
date_start_contract
date_min
=
date_min
.
strftime
(
"
%d/%m/%Y
"
)
date_min
=
date_min
.
strftime
(
"
%d/%m/%Y
"
)
result_graph
.
update
(
result_graph
.
update
(
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment