Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odoo CE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Comunitats Energètiques
Odoo CE
Commits
bed3c47c
Commit
bed3c47c
authored
1 year ago
by
Daniil Digtyar Vasilieva
Browse files
Options
Downloads
Patches
Plain Diff
[IMP] removed distribution_table_id
parent
393d3227
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!138
Hotfix setup name error
,
!134
Release v14.0.1.1.6
,
!126
[IMP] Feature/add energy selfconsumption distribution table
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
energy_selfconsumption/models/selfconsumption.py
+2
-3
2 additions, 3 deletions
energy_selfconsumption/models/selfconsumption.py
energy_selfconsumption/views/selfconsumption_views.xml
+0
-6
0 additions, 6 deletions
energy_selfconsumption/views/selfconsumption_views.xml
with
2 additions
and
9 deletions
energy_selfconsumption/models/selfconsumption.py
+
2
−
3
View file @
bed3c47c
...
...
@@ -19,7 +19,6 @@ class Selfconsumption(models.Model):
)
code
=
fields
.
Char
(
string
=
"
CAU
"
)
power
=
fields
.
Float
(
string
=
"
Generation Power (kWh)
"
)
distribution_table_id
=
fields
.
Many2one
(
'
energy_selfconsumption.distribution_table
'
)
distribution_table_ids
=
fields
.
One2many
(
'
energy_selfconsumption.distribution_table
'
,
'
selfconsumption_project_id
'
,
readonly
=
True
)
distribution_table_count
=
fields
.
Integer
(
compute
=
_compute_distribution_table_count
)
...
...
@@ -45,6 +44,6 @@ class Selfconsumption(models.Model):
raise
ValidationError
(
_
(
"
Project must have a valid Code.
"
))
if
not
record
.
power
or
record
.
power
<=
0
:
raise
ValidationError
(
_
(
"
Project must have a valid Generation Power.
"
))
if
not
record
.
distribution_table_id
:
raise
ValidationError
(
_
(
"
Must
select
a valid Distribution Table.
"
))
if
record
.
distribution_table_id
s
.
filtered_domain
([(
'
state
'
,
'
=
'
,
'
validated
'
)])
:
raise
ValidationError
(
_
(
"
Must
have
a valid Distribution Table.
"
))
record
.
write
({
"
state
"
:
"
active
"
})
This diff is collapsed.
Click to expand it.
energy_selfconsumption/views/selfconsumption_views.xml
+
0
−
6
View file @
bed3c47c
...
...
@@ -65,12 +65,6 @@
name=
"power"
attrs=
"{'readonly': [('state', 'not in', ['draft', 'activation'])]}"
/>
<field
name=
"distribution_table_id"
attrs=
"{'readonly': [('state', 'not in', ['draft', 'activation'])]}"
domain=
"[('state', '=', 'active'), ('selfconsumption_project_id', '=', id)]"
options=
"{'no_create': True}"
/>
</group>
<group>
<span
class=
"o_form_label o_td_label"
name=
"address_name"
>
...
...
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