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
Merge requests
!132
Connect wp erp
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Connect wp erp
connect-wp-erp
into
dev
Overview
0
Commits
3
Pipelines
2
Changes
3
Merged
Dani Quilez
requested to merge
connect-wp-erp
into
dev
1 year ago
Overview
0
Commits
3
Pipelines
2
Changes
3
Expand
0
0
Merge request reports
Compare
dev
version 1
79932749
1 year ago
dev (base)
and
latest version
latest version
f1957673
3 commits,
1 year ago
version 1
79932749
2 commits,
1 year ago
3 files
+
17
−
13
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
energy_communities/models/landing_page.py
+
13
−
11
Options
@@ -70,15 +70,17 @@ class LandingPage(models.Model):
def
action_landing_page_status
(
self
):
for
record
in
self
:
new_status
=
"
draft
"
if
record
.
status
==
"
publish
"
else
"
publish
"
instance_company
=
self
.
env
[
'
res.company
'
].
search
(
[(
'
hierarchy_level
'
,
'
=
'
,
'
instance
'
)])
if
instance_company
:
username
=
instance_company
.
wordpress_db_username
password
=
instance_company
.
wordpress_db_password
auth
=
Authenticate
(
username
,
password
).
authenticate
()
token
=
"
Bearer %s
"
%
auth
[
"
token
"
]
landing_page_data
=
record
.
to_dict
()
landing_page_data
[
"
status
"
]
=
new_status
landing_page_resource
=
LandingPageResource
(
record
.
wp_landing_page_id
)
landing_page_resource
.
update
(
token
,
landing_page_data
)
username
=
self
.
company_id
.
wordpress_db_username
password
=
self
.
company_id
.
wordpress_db_password
auth
=
Authenticate
(
username
,
password
).
authenticate
()
token
=
"
Bearer %s
"
%
auth
[
"
token
"
]
landing_page_data
=
record
.
to_dict
()
landing_page_data
[
"
status
"
]
=
new_status
landing_page_resource
=
LandingPageResource
(
record
.
wp_landing_page_id
)
landing_page_resource
.
update
(
token
,
landing_page_data
)
record
.
write
({
"
status
"
:
new_status
})
record
.
write
({
"
status
"
:
new_status
})
Loading