Commit 2b374847 authored by Boxiang Sun's avatar Boxiang Sun

erp5_officejs_support_request: Pass support request value directly

The original implementation were passing the object's url. So
we need to get the object's value again through portal_catalog.
But if we create a new Support Request just now, and then create
a post to use this SR as follow up. We can't get the SR value due
to the Vincent's reindex change: https://lab.nexedi.com/vpelletier/erp5/commit/2e35fa174ebafd2a6c9af84c116c35c29a0261c1
So pass the object's value directly.
parent 4e0c0864
follow_up_object, = context.getPortalObject().portal_catalog(relative_url=follow_up, limit=1) follow_up_value.edit() # update modification date
follow_up_object.edit() # update modification date
post = context.PostModule_createHTMLPostFromText( post = context.PostModule_createHTMLPostFromText(
follow_up=follow_up, follow_up_value=follow_up_value,
data=data, data=data,
) )
...@@ -19,6 +19,3 @@ if file not in ("undefined", None): # XXX "undefined" ? should also be fixed in ...@@ -19,6 +19,3 @@ if file not in ("undefined", None): # XXX "undefined" ? should also be fixed in
document.publish() document.publish()
post.publish() post.publish()
# XXX in support request web app interface, discussable page reloads right after
# adding a post, searching for new post hoping it is already indexed.
post.immediateReindexObject()
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>follow_up, predecessor, data, file</string> </value> <value> <string>follow_up_value, predecessor, data, file</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -32,13 +32,12 @@ support_request.edit( ...@@ -32,13 +32,12 @@ support_request.edit(
start_date=now, start_date=now,
) )
support_request.submit() support_request.submit()
support_request.immediateReindexObject() support_request.immediateReindexObject()
if description is not None or file is not None: if description is not None or file is not None:
portal.post_module.PostModule_createHTMLPostForSupportRequest( portal.post_module.PostModule_createHTMLPostForSupportRequest(
follow_up=support_request.getRelativeUrl(), # XXX give support_request as follow_up_value follow_up_value=support_request,
predecessor=None, predecessor=None,
data="" if description is None else description, data="" if description is None else description,
file=file, file=file,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment