Commit 44b829bb 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 9d6b6a24
follow_up_object, = context.getPortalObject().portal_catalog(relative_url=follow_up, limit=1)
follow_up_object.edit() # update modification date
follow_up_value.edit() # update modification date
post = context.PostModule_createHTMLPostFromText(
follow_up=follow_up,
follow_up_value=follow_up_value,
data=data,
)
......@@ -19,6 +19,3 @@ if file not in ("undefined", None): # XXX "undefined" ? should also be fixed in
document.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 @@
</item>
<item>
<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>
<key> <string>id</string> </key>
......
......@@ -33,12 +33,11 @@ support_request.edit(
start_date=now,
)
support_request.submit()
if description is not None or file is not None:
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,
data="" if description is None else description,
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