Commit bbc25e7c authored by Jérome Perrin's avatar Jérome Perrin

fallback to preferred currency if the current organisation doesn't define a

price_currency. Thanks Bartek.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12551 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 30660c13
......@@ -80,15 +80,15 @@ def getCurrencyForSection(section_url):\n
portal = context.getPortalObject()\n
section = portal.portal_categories.restrictedTraverse(section_url)\n
\n
if section.getPortalType() == \'Organisation\':\n
if section.getPortalType() == \'Organisation\' and section.getPriceCurrency():\n
return section.getPriceCurrency()\n
\n
if section.getPortalType() == \'Category\':\n
member_list = section.getGroupRelatedValueList(portal_type=\'Organisation\')\n
if len(member_list) == 1:\n
if len(member_list) == 1 and member_list[0].getPriceCurrency():\n
return member_list[0].getPriceCurrency()\n
mapping = section.getMappingValue(portal_type=\'Organisation\')\n
if mapping is not None:\n
if mapping is not None and mapping.getPriceCurrency():\n
return mapping.getPriceCurrency()\n
\n
# nothing found ... returns the currency from preferences.\n
......
173
\ No newline at end of file
174
\ No newline at end of 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