Commit 53c67e55 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_corporate_identity: fix search problems

1. title is not exact match
2. can't search title in objectValues
parent 5d9a9afd
...@@ -114,8 +114,8 @@ def populateOrganisationDict(my_organisation_list): ...@@ -114,8 +114,8 @@ def populateOrganisationDict(my_organisation_list):
organisation_region = organisation.getRegionValue() organisation_region = organisation.getRegionValue()
organisation_phone = organisation.getDefaultTelephoneValue() organisation_phone = organisation.getDefaultTelephoneValue()
organisation_fax = organisation.getDefaultFax() organisation_fax = organisation.getDefaultFax()
organisation_link_list = organisation.objectValues(portal_type="Link",title="Corporate Web Site") organisation_link_list = [x for x in organisation.objectValues(portal_type="Link") if x.getTitle()=="Corporate Web Site"]
organisation_bank_list = organisation.objectValues(portal_type="Bank Account",title="Default Bank Account") organisation_bank_list = [x for x in organisation.objectValues(portal_type="Bank Account") if x.getValidationState()=='validated' and x.getTitle()=="Default Bank Account"]
organisation_default_image = organisation.getDefaultImage() organisation_default_image = organisation.getDefaultImage()
output_dict["organisation_title"] = organisation.getTitle() output_dict["organisation_title"] = organisation.getTitle()
...@@ -235,11 +235,13 @@ if pass_parameter is not None and pass_source_data is not None: ...@@ -235,11 +235,13 @@ if pass_parameter is not None and pass_source_data is not None:
# XXX remove, too much ambiguity if multiple results # XXX remove, too much ambiguity if multiple results
# returns [{organisation_dict}] # returns [{organisation_dict}]
if pass_parameter == "override_organisation": if pass_parameter == "override_organisation":
return populateOrganisationDict(portal_object.portal_catalog( organisation_list = portal_object.portal_catalog(
portal_type="Organisation", portal_type="Organisation",
#title=(''.join(["=", str(pass_source_data)])) #title=(''.join(["=", str(pass_source_data)]))
title=pass_source_data title=pass_source_data,
)) )
organisation_list = [x for x in organisation_list if x.getTitle()==pass_source_data]
return populateOrganisationDict(organisation_list)
# ------------ Override Sender/Recipient Organisation (URL) -------------------- # ------------ Override Sender/Recipient Organisation (URL) --------------------
# returns [{organisation_dict}] # returns [{organisation_dict}]
......
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