Commit 583a7b67 authored by Jérome Perrin's avatar Jérome Perrin

take into account section category strict to know if a transaction is source or destination

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38093 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 47544a11
...@@ -56,13 +56,17 @@ ...@@ -56,13 +56,17 @@
<value> <string>destination = context.getDestinationSectionValue()\n <value> <string>destination = context.getDestinationSectionValue()\n
section_category = context.portal_preferences\\\n section_category = context.portal_preferences\\\n
.getPreferredAccountingTransactionSectionCategory()\n .getPreferredAccountingTransactionSectionCategory()\n
section_category_strict = context.portal_preferences\\\n
.getPreferredAccountingSectionCategoryStrict()\n
\n
\n \n
# If the destination is an organisation member of the preferred section category,\n # If the destination is an organisation member of the preferred section category,\n
# then we\'ll show destination view\n # then we\'ll show destination view\n
if destination is not None and section_category:\n if destination is not None and section_category:\n
if destination.getPortalType() == \'Person\':\n if destination.getPortalType() == \'Person\':\n
return False\n return False\n
if destination.isMemberOf(section_category):\n if destination.isMemberOf(section_category,\n
strict_membership=section_category_strict):\n
return True\n return True\n
\n \n
# If the source is an organisation member of the preferred section category,\n # If the source is an organisation member of the preferred section category,\n
...@@ -71,7 +75,8 @@ source = context.getSourceSectionValue()\n ...@@ -71,7 +75,8 @@ source = context.getSourceSectionValue()\n
if source is not None and section_category:\n if source is not None and section_category:\n
if source.getPortalType() == \'Person\':\n if source.getPortalType() == \'Person\':\n
return True\n return True\n
if source.isMemberOf(section_category):\n if source.isMemberOf(section_category,\n
strict_membership=section_category_strict):\n
return False\n return False\n
\n \n
# If we reach this point, none of the sections are member of the preferred section\n # If we reach this point, none of the sections are member of the preferred section\n
...@@ -117,6 +122,7 @@ return True\n ...@@ -117,6 +122,7 @@ return True\n
<string>context</string> <string>context</string>
<string>destination</string> <string>destination</string>
<string>section_category</string> <string>section_category</string>
<string>section_category_strict</string>
<string>None</string> <string>None</string>
<string>False</string> <string>False</string>
<string>True</string> <string>True</string>
......
...@@ -56,13 +56,16 @@ ...@@ -56,13 +56,16 @@
<value> <string>source = context.getSourceSectionValue()\n <value> <string>source = context.getSourceSectionValue()\n
section_category = context.portal_preferences\\\n section_category = context.portal_preferences\\\n
.getPreferredAccountingTransactionSectionCategory()\n .getPreferredAccountingTransactionSectionCategory()\n
section_category_strict = context.portal_preferences\\\n
.getPreferredAccountingSectionCategoryStrict()\n
\n \n
# If the source is an organisation member of the preferred section category,\n # If the source is an organisation member of the preferred section category,\n
# then we\'ll show the source view\n # then we\'ll show the source view\n
if source is not None and section_category:\n if source is not None and section_category:\n
if source.getPortalType() == \'Person\':\n if source.getPortalType() == \'Person\':\n
return False\n return False\n
if source.isMemberOf(section_category):\n if source.isMemberOf(section_category,\n
strict_membership=section_category_strict):\n
return True\n return True\n
\n \n
# Else, if the destination is an organisation member of the preferred section category,\n # Else, if the destination is an organisation member of the preferred section category,\n
...@@ -71,7 +74,8 @@ destination = context.getDestinationSectionValue()\n ...@@ -71,7 +74,8 @@ destination = context.getDestinationSectionValue()\n
if destination is not None and section_category:\n if destination is not None and section_category:\n
if destination.getPortalType() == \'Person\':\n if destination.getPortalType() == \'Person\':\n
return True\n return True\n
if destination.isMemberOf(section_category):\n if destination.isMemberOf(section_category,\n
strict_membership=section_category_strict):\n
return False\n return False\n
\n \n
# If we reach this point, none of the sections are member of the preferred section\n # If we reach this point, none of the sections are member of the preferred section\n
...@@ -117,6 +121,7 @@ return True\n ...@@ -117,6 +121,7 @@ return True\n
<string>context</string> <string>context</string>
<string>source</string> <string>source</string>
<string>section_category</string> <string>section_category</string>
<string>section_category_strict</string>
<string>None</string> <string>None</string>
<string>False</string> <string>False</string>
<string>True</string> <string>True</string>
......
1341 1342
\ No newline at end of file \ 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