Commit 1972507f authored by Jérome Perrin's avatar Jérome Perrin

If portal_type is not passed, return all accounting transaction lines

parent bc792069
...@@ -50,7 +50,10 @@ ...@@ -50,7 +50,10 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>sort_dict = { \'income\': 0,\n <value> <string>if not portal_type:\n
portal_type = context.getPortalObject().getPortalAccountingMovementTypeList()\n
\n
sort_dict = { \'income\': 0,\n
\'expense\': -2,\n \'expense\': -2,\n
\'receivable\': -2,\n \'receivable\': -2,\n
\'payable\': 0,\n \'payable\': 0,\n
...@@ -60,10 +63,7 @@ ...@@ -60,10 +63,7 @@
def getAccountingTransactionLineSortKey(line):\n def getAccountingTransactionLineSortKey(line):\n
return sort_dict.get(line.getId(), line.getIntIndex() or line.getIntId())\n return sort_dict.get(line.getId(), line.getIntIndex() or line.getIntId())\n
\n \n
object_list = list(context.contentValues(\n return sorted(context.contentValues(portal_type=portal_type), key=getAccountingTransactionLineSortKey)\n
filter={\'portal_type\': portal_type}))\n
object_list.sort(key=getAccountingTransactionLineSortKey)\n
return object_list\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
1487 1501
\ 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