Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cgscop_alfresco
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
Show more breadcrumbs
Le Filament
Confédération Générale des SCOP
cgscop_alfresco
Commits
3e368593
Commit
3e368593
authored
3 years ago
by
Benjamin - Le Filament
Browse files
Options
Downloads
Patches
Plain Diff
[fix] OCB error on folder creation
parent
f582c6a2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
controllers/main.py
+20
-1
20 additions, 1 deletion
controllers/main.py
with
20 additions
and
1 deletion
controllers/main.py
+
20
−
1
View file @
3e368593
...
...
@@ -6,7 +6,26 @@ from odoo import http
class
AlfrescoController
(
http
.
Controller
):
@http.route
([
'
/web/alfresco/session
'
],
type
=
"
json
"
,
auth
=
"
user
"
,
method
=
[
'
POST
'
])
@http.route
(
[
'
/web/alfresco/session
'
],
type
=
"
json
"
,
auth
=
"
user
"
,
method
=
[
'
POST
'
])
def
get_alf_ticket
(
self
,
username
):
data
=
http
.
request
.
env
[
'
cgscop.alfresco
'
].
alfresco_get_ticket
(
username
)
return
data
# ------------------------------------------------------
# Override parent
# ------------------------------------------------------
@http.route
(
'
/web/cmis/field/create_value
'
,
type
=
'
json
'
,
methods
=
[
'
POST
'
],
auth
=
"
user
"
)
def
create_field_value
(
self
,
model_name
,
res_id
,
field_name
):
"""
Override parent to return dict with res_id key to avoid error on OCB
form_widget rendering
:return: { object_id: nodeRef }
"""
model_inst
=
http
.
request
.
env
[
model_name
].
browse
(
int
(
res_id
))
model_inst
.
_fields
[
field_name
].
create_value
(
model_inst
)
value
=
getattr
(
model_inst
,
field_name
)
return
{
res_id
:
value
}
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