Commit 6327e204 authored by Jérome Perrin's avatar Jérome Perrin

Destination tab can be used for the section in a Purchase Invoice or for the

mirror section on a Sale Invoice, so disable account filtering on that screen.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10938 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 236a8df9
...@@ -70,13 +70,24 @@ ...@@ -70,13 +70,24 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""Return item list of accounts that can be used as node for this accounting\n <value> <string>"""Return item list of accounts that can be used as node for this accounting\n
transaction line.\n transaction line.\n
The id of the line is used to filter the list. If `mirror` is set to a true\n The id of the line is used to filter the list, unless `omit_filter` is true.\n
value, the list will be filtered for the mirror node.\n If `mirror` is set to a true value, the list will be filtered for the mirror\n
node.\n
"""\n """\n
from Products.ERP5Type.Cache import CachingMethod\n from Products.ERP5Type.Cache import CachingMethod\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
\n \n
if not mirror:\n if omit_filter:\n
category_dict = {\n
\'income\': \'account_type\',\n
\'expense\': \'account_type\',\n
\'payable\': \'account_type\',\n
\'receivable\': \'account_type\',\n
\'collected_vat\': \'account_type\',\n
\'refundable_vat\': \'account_type\',\n
\'bank\': \'account_type/asset\',\n
\'cash\': \'account_type/asset\', }\n
elif not mirror:\n
category_dict = {\n category_dict = {\n
\'income\': \'account_type/income\',\n \'income\': \'account_type/income\',\n
\'expense\': \'account_type/expense\',\n \'expense\': \'account_type/expense\',\n
...@@ -128,9 +139,6 @@ def getItemList(category=None, portal_path=None, mirror=0,\n ...@@ -128,9 +139,6 @@ def getItemList(category=None, portal_path=None, mirror=0,\n
base=0,\n base=0,\n
display_method=display,\n display_method=display,\n
sort_method=sort,\n sort_method=sort,\n
# we don\'t want strict membership if now category\n
# has been found.\n
strict_membership=0,\n
filter=filter_dict)\n filter=filter_dict)\n
return item_list\n return item_list\n
\n \n
...@@ -143,6 +151,7 @@ getItemList = CachingMethod(getItemList,\n ...@@ -143,6 +151,7 @@ getItemList = CachingMethod(getItemList,\n
return getItemList( category=category,\n return getItemList( category=category,\n
portal_path=context.getPortalObject().getPhysicalPath(),\n portal_path=context.getPortalObject().getPhysicalPath(),\n
mirror=mirror,\n mirror=mirror,\n
omit_filter=omit_filter, # XXX possible optim: only one cache if omit_filter\n
user_name=context.REQUEST.AUTHENTICATED_USER,\n user_name=context.REQUEST.AUTHENTICATED_USER,\n
simulation_state=context.getProperty(\n simulation_state=context.getProperty(\n
\'simulation_state\', \'no_simulation_state\') )\n \'simulation_state\', \'no_simulation_state\') )\n
...@@ -174,7 +183,7 @@ return getItemList( category=category,\n ...@@ -174,7 +183,7 @@ return getItemList( category=category,\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>mirror=0</string> </value> <value> <string>mirror=0, omit_filter=0</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -194,13 +203,14 @@ return getItemList( category=category,\n ...@@ -194,13 +203,14 @@ return getItemList( category=category,\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>1</int> </value> <value> <int>2</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>mirror</string> <string>mirror</string>
<string>omit_filter</string>
<string>Products.ERP5Type.Cache</string> <string>Products.ERP5Type.Cache</string>
<string>CachingMethod</string> <string>CachingMethod</string>
<string>_getattr_</string> <string>_getattr_</string>
...@@ -227,6 +237,7 @@ return getItemList( category=category,\n ...@@ -227,6 +237,7 @@ return getItemList( category=category,\n
<value> <value>
<tuple> <tuple>
<int>0</int> <int>0</int>
<int>0</int>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python:cell.getObject().AccountingTransactionLine_getNodeItemList(mirror=1)</string> </value> <value> <string>python:cell.getObject().AccountingTransactionLine_getNodeItemList(omit_filter=1)</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python:cell.getObject().AccountingTransactionLine_getNodeItemList()</string> </value> <value> <string>python:cell.getObject().AccountingTransactionLine_getNodeItemList(omit_filter=1)</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
98 99
\ 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