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
09d04d92
Commit
09d04d92
authored
2 years ago
by
Xavier Bonet
Browse files
Options
Downloads
Plain Diff
Merge branch 'FIX_rest_api_swagger_issue' into 'main'
FIX rest api swagger issue See merge request
!53
parents
10b8e4c2
6da84776
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!53
FIX rest api swagger issue
Pipeline
#20166
passed
2 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ce/services/ce_community_service.py
+9
-6
9 additions, 6 deletions
ce/services/ce_community_service.py
ce/services/crm_lead_service.py
+2
-2
2 additions, 2 deletions
ce/services/crm_lead_service.py
with
11 additions
and
8 deletions
ce/services/ce_community_service.py
+
9
−
6
View file @
09d04d92
...
...
@@ -7,6 +7,7 @@ from odoo.addons.component.core import Component
from
odoo
import
_
from
datetime
import
datetime
from
.
import
schemas
from
odoo.http
import
request
_logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -27,7 +28,8 @@ class CommunityService(Component):
auth
=
"
api_key
"
,
)
def
get
(
self
,
_odoo_company_id
):
endpoint_args
=
self
.
work
.
request
.
endpoint_arguments
endpoint_args
=
self
.
work
and
hasattr
(
self
.
work
,
'
request
'
)
and
self
.
work
.
request
.
endpoint_arguments
or
None
company_id
=
self
.
env
[
'
res.company
'
].
get_real_ce_company_id
(
_odoo_company_id
)
...
...
@@ -39,14 +41,14 @@ class CommunityService(Component):
"
No Odoo Company found for odoo_company_id %s
"
)
%
_odoo_company_id
}
)
if
'
method_name
'
in
endpoint_args
and
endpoint_args
.
get
(
'
method_name
'
)
==
'
members
'
:
if
endpoint_args
and
'
method_name
'
in
endpoint_args
and
endpoint_args
.
get
(
'
method_name
'
)
==
'
members
'
:
return
self
.
_to_dict_members
(
company_id
.
get_ce_members
())
else
:
return
self
.
_to_dict_community
(
company_id
)
def
_validator_return_community_get
(
self
):
endpoint_args
=
self
.
work
.
request
.
endpoint_arguments
if
'
method_name
'
in
endpoint_args
and
endpoint_args
.
get
(
'
method_name
'
)
==
'
members
'
:
endpoint_args
=
self
.
work
and
hasattr
(
self
.
work
,
'
request
'
)
and
self
.
work
.
request
.
endpoint_arguments
or
None
if
endpoint_args
and
'
method_name
'
in
endpoint_args
and
endpoint_args
.
get
(
'
method_name
'
)
==
'
members
'
:
return
schemas
.
S_COMMUNITY_MEMBERS_RETURN_GET
else
:
return
schemas
.
S_COMMUNITY_RETURN_GET
...
...
@@ -66,7 +68,7 @@ class CommunityService(Component):
@staticmethod
def
_to_dict_community
(
company
):
resp
=
{
'
community
'
:{
resp
=
{
'
community
'
:
{
'
id
'
:
company
.
id
,
'
name
'
:
company
.
name
,
'
birth_date
'
:
company
.
foundation_date
and
company
.
foundation_date
.
strftime
(
'
%Y-%m-%d
'
)
or
''
,
...
...
@@ -88,6 +90,7 @@ class CommunityService(Component):
resp
[
'
community
'
].
update
(
CommunityService
.
_to_dict_members
(
company
.
get_ce_members
()))
resp
[
'
community
'
].
update
({
'
active_services
'
:
company
.
get_active_services
()})
resp
[
'
community
'
].
update
(
{
'
active_services
'
:
company
.
get_active_services
()})
return
resp
This diff is collapsed.
Click to expand it.
ce/services/crm_lead_service.py
+
2
−
2
View file @
09d04d92
...
...
@@ -72,8 +72,8 @@ class CRMLeadService(Component):
return
self
.
_to_dict
(
sr
)
def
_validator_create
(
self
):
source
=
self
.
work
.
request
.
params
.
get
(
'
source_xml_id
'
,
False
)
if
source
==
'
ce_source_creation_ce_proposal
'
:
source
=
self
.
work
and
hasattr
(
self
.
work
,
'
request
'
)
and
self
.
work
.
request
.
params
.
get
(
'
source_xml_id
'
,
False
)
or
None
if
source
and
source
==
'
ce_source_creation_ce_proposal
'
:
return
schemas
.
S_CRM_LEAD_CREATE_ALTA_CE
return
schemas
.
S_CRM_LEAD_CREATE
...
...
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