Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
oacc_enedis_api
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_enedis_api
Commits
5ff89b93
Commit
5ff89b93
authored
1 year ago
by
Rémi - Le Filament
Browse files
Options
Downloads
Patches
Plain Diff
[UPD] check cdc for correct interval
parent
d0cafccf
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
wizards/acc_operation_wizard.py
+6
-2
6 additions, 2 deletions
wizards/acc_operation_wizard.py
with
6 additions
and
2 deletions
wizards/acc_operation_wizard.py
+
6
−
2
View file @
5ff89b93
# Copyright 2021- Le Filament (https://le-filament.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
import
pytz
from
odoo
import
_
,
fields
,
models
from
odoo.exceptions
import
UserError
from
odoo.osv
import
expression
...
...
@@ -103,9 +105,11 @@ class AccOperationWizard(models.TransientModel):
domain_extra_cdc
=
expression
.
OR
([
domain_cons_cdc
,
domain_prod_cdc
])
domain_periods
=
expression
.
AND
([
domain_base
,
domain_extra
])
start_datetime
=
pytz
.
timezone
(
"
Europe/Paris
"
).
localize
(
fields
.
Datetime
.
to_datetime
(
start_date
)).
astimezone
(
pytz
.
UTC
).
replace
(
tzinfo
=
None
)
end_datetime
=
pytz
.
timezone
(
"
Europe/Paris
"
).
localize
(
fields
.
Datetime
.
to_datetime
(
start_date
)).
astimezone
(
pytz
.
UTC
).
replace
(
tzinfo
=
None
)
domain_date
=
[
(
"
date_slot
"
,
"
>=
"
,
self
.
start_date
),
(
"
date_slot
"
,
"
<
"
,
self
.
end_date
),
(
"
date_slot
"
,
"
>=
"
,
start_date
time
),
(
"
date_slot
"
,
"
<
"
,
end_date
time
),
]
domain_cdc
=
expression
.
AND
([
domain_base
,
domain_extra_cdc
,
domain_date
])
...
...
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