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
c57dba75
Commit
c57dba75
authored
1 year ago
by
daniquilez
Browse files
Options
Downloads
Patches
Plain Diff
apply linter corrections
parent
86cb02a8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!277
[REL] Release Sprint 27/11/23
,
!244
Feature/company data public form
Pipeline
#67440
passed
1 year ago
Stage: test
Changes
2
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
energy_communities/controllers/website_community_data.py
+10
-0
10 additions, 0 deletions
energy_communities/controllers/website_community_data.py
energy_communities/views/website_community_data_template.xml
+87
-59
87 additions, 59 deletions
energy_communities/views/website_community_data_template.xml
with
97 additions
and
59 deletions
energy_communities/controllers/website_community_data.py
+
10
−
0
View file @
c57dba75
...
...
@@ -276,6 +276,13 @@ class WebsiteCommunityData(http.Controller):
)
)
def
_is_lead_pack
(
self
,
lead_id
,
pack_tag_ext_id
):
lead
=
request
.
env
[
"
crm.lead
"
].
sudo
().
search
([(
"
id
"
,
"
=
"
,
lead_id
)])[
0
]
pack_tag
=
lead
.
tag_ids
.
filtered
(
lambda
tag
:
tag
.
tag_ext_id
==
"
energy_communities.
"
+
pack_tag_ext_id
)
return
bool
(
pack_tag
)
def
_get_energy_service_tag_ids
(
self
):
return
(
request
.
env
[
"
crm.tag
"
]
...
...
@@ -328,6 +335,9 @@ class WebsiteCommunityData(http.Controller):
values
[
"
form_submit_url
"
]
=
"
/community-data/submit?lead_id={lead_id}
"
.
format
(
lead_id
=
values
[
"
lead_id
"
]
)
# packs
values
[
"
pack_1
"
]
=
self
.
_is_lead_pack
(
values
[
"
lead_id
"
],
"
pack_1
"
)
values
[
"
pack_2
"
]
=
self
.
_is_lead_pack
(
values
[
"
lead_id
"
],
"
pack_2
"
)
# form labels
# form keys
for
field_key
in
_COMMUNITY_DATA__FIELDS
.
keys
():
...
...
This diff is collapsed.
Click to expand it.
energy_communities/views/website_community_data_template.xml
+
87
−
59
View file @
c57dba75
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