Commit ce238b31 authored by Boxiang Sun's avatar Boxiang Sun Committed by Tristan Cavelier

erp5_officejs_support_request_ui: Choose the correct post author.

The comment user field in the listbox which list Support Requests should show
the latest person who left comment.
parent 016766c1
...@@ -7,11 +7,9 @@ support_request_object = support_request_list[0].getObject() ...@@ -7,11 +7,9 @@ support_request_object = support_request_list[0].getObject()
# get the all HTML Posts which related to this Support Request # get the all HTML Posts which related to this Support Request
post_list = portal.portal_catalog(portal_type="HTML Post", strict_follow_up_uid=support_request_object.getUid()) # with id keyword, this function will return a sequence data type which contains one element. post_list = portal.portal_catalog(portal_type="HTML Post", strict_follow_up_uid=support_request_object.getUid(), sort_on=(('modification_date', 'descending'),), limit=1, validation_state="published") # with id keyword, this function will return a sequence data type which contains one element.
post_list = sorted(post_list, key=lambda x:x.getStartDate(), reverse=False) if len(post_list):
if post_list:
return post_list[0].Base_getOwnerTitle() return post_list[0].Base_getOwnerTitle()
else: else:
return None return None
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