Commit 113a509c authored by Jérome Perrin's avatar Jérome Perrin

change the isSourceView/isDestinationView scripts to return true when no...

change the isSourceView/isDestinationView scripts to return true when no sections are defined. Prior to that change a purchase invoice was displayed in source view when no section was defined

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34134 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2e71fb55
...@@ -58,11 +58,14 @@ section_category = context.portal_preferences\\\n ...@@ -58,11 +58,14 @@ section_category = context.portal_preferences\\\n
.getPreferredAccountingTransactionSectionCategory()\n .getPreferredAccountingTransactionSectionCategory()\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 0\n return False\n
if destination.isMemberOf(section_category):\n if destination.isMemberOf(section_category):\n
return 1\n return True\n
\n \n
return 0\n if destination is None and context.getSourceSection() is None:\n
return True\n
\n
return False\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -104,6 +107,8 @@ return 0\n ...@@ -104,6 +107,8 @@ return 0\n
<string>destination</string> <string>destination</string>
<string>section_category</string> <string>section_category</string>
<string>None</string> <string>None</string>
<string>False</string>
<string>True</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -58,11 +58,14 @@ section_category = context.portal_preferences\\\n ...@@ -58,11 +58,14 @@ section_category = context.portal_preferences\\\n
.getPreferredAccountingTransactionSectionCategory()\n .getPreferredAccountingTransactionSectionCategory()\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 0\n return False\n
if source.isMemberOf(section_category):\n if source.isMemberOf(section_category):\n
return 1\n return True\n
\n \n
return 0\n if source is None and context.getDestinationSection() is None:\n
return True\n
\n
return False\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -104,6 +107,8 @@ return 0\n ...@@ -104,6 +107,8 @@ return 0\n
<string>source</string> <string>source</string>
<string>section_category</string> <string>section_category</string>
<string>None</string> <string>None</string>
<string>False</string>
<string>True</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
1153 1155
\ 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