Commit 0484f911 authored by Jérome Perrin's avatar Jérome Perrin

Add an action to add multiple accounting lines into accounting transaction.

Stop using "object_add" action category + hidden content type, use standard way (mainly because we cannot copy & paste, create new, or clone lines), the previous behaviour of staying in the delivery view is kept if we use this new action, with adding only one line.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34443 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0f59d66e
......@@ -19,13 +19,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_add</string>
<string>action_type/object_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_add</string> </value>
<value> <string>object_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......@@ -33,7 +33,9 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
......@@ -53,11 +55,11 @@
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>9.0</float> </value>
<value> <float>20.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Accounting Transaction Line</string> </value>
<value> <string>Add Accounting Transaction Lines</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
......@@ -77,7 +79,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/AccountingTransaction_addAccountingTransactionLine</string> </value>
<value> <string>string:${object_url}/AccountingTransaction_viewAccountingTransactionLineDialog?portal_type=Accounting+Transaction+Line</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -19,13 +19,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_add</string>
<string>action_type/object_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_add</string> </value>
<value> <string>object_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......@@ -33,7 +33,9 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
......@@ -53,11 +55,11 @@
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>10.0</float> </value>
<value> <float>20.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Accounting Transaction Line</string> </value>
<value> <string>Add Accounting Transaction Lines</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
......@@ -77,7 +79,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/AccountingTransaction_addAccountingTransactionLine</string> </value>
<value> <string>string:${object_url}/AccountingTransaction_viewAccountingTransactionLineDialog?portal_type=Accounting+Transaction+Line</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -19,13 +19,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_add</string>
<string>action_type/object_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_add</string> </value>
<value> <string>object_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......@@ -33,7 +33,9 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
......@@ -53,11 +55,11 @@
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>11.0</float> </value>
<value> <float>20.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Accounting Transaction Line</string> </value>
<value> <string>Add Accounting Transaction Lines</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
......@@ -77,7 +79,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/AccountingTransaction_addAccountingTransactionLine?portal_type=Purchase+Invoice+Transaction+Line</string> </value>
<value> <string>string:${object_url}/AccountingTransaction_viewAccountingTransactionLineDialog?portal_type=Purchase+Invoice+Transaction+Line</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -19,13 +19,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_add</string>
<string>action_type/object_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_add</string> </value>
<value> <string>object_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......@@ -33,7 +33,9 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
......@@ -53,11 +55,11 @@
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>16.0</float> </value>
<value> <float>20.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Accounting Transaction Line</string> </value>
<value> <string>Add Accounting Transaction Lines</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
......@@ -77,7 +79,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/AccountingTransaction_addAccountingTransactionLine?portal_type=Sale+Invoice+Transaction+Line</string> </value>
<value> <string>string:${object_url}/AccountingTransaction_viewAccountingTransactionLineDialog?portal_type=Sale+Invoice+Transaction+Line</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -3,7 +3,6 @@
<item>Accounting Transaction Line</item>
</portal_type>
<portal_type id="Accounting Transaction">
<item>Accounting Transaction Line</item>
<item>File</item>
<item>Image</item>
</portal_type>
......@@ -14,7 +13,6 @@
<item>Balance Transaction Line</item>
</portal_type>
<portal_type id="Payment Transaction">
<item>Accounting Transaction Line</item>
<item>File</item>
<item>Image</item>
</portal_type>
......@@ -27,11 +25,9 @@
<portal_type id="Purchase Invoice Transaction">
<item>File</item>
<item>Image</item>
<item>Purchase Invoice Transaction Line</item>
</portal_type>
<portal_type id="Sale Invoice Transaction">
<item>File</item>
<item>Image</item>
<item>Sale Invoice Transaction Line</item>
</portal_type>
</hidden_content_type_list>
\ No newline at end of file
......@@ -53,16 +53,19 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>\'\'\'Adds an accounting transaction line in an accounting transaction\n
and redirects to the accounting transaction view which is easyier to\n
<value> <string>\'\'\'Adds accounting transaction lines in an accounting transaction\n
and redirects to the accounting transaction view which is easier to\n
use.\n
\'\'\'\n
Base_translateString = context.Base_translateString\n
context.newContent(portal_type=portal_type)\n
return context.Base_redirect(form_id, keep_items=dict(\n
portal_status_message=Base_translateString(\'Accounting Transaction Line added.\'),\n
selection_name=selection_name,\n
selection_index=selection_index))\n
from Products.ERP5Type.Message import translateString\n
request = container.REQUEST\n
\n
for i in range(line_count):\n
context.newContent(portal_type=portal_type)\n
\n
request.set(\'portal_status_message\',\n
translateString(\'Accounting Transaction Lines added.\'),)\n
return getattr(context, form_id)()\n
</string> </value>
</item>
<item>
......@@ -73,7 +76,7 @@ return context.Base_redirect(form_id, keep_items=dict(\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>portal_type=\'Accounting Transaction Line\', selection_name=\'\', selection_index=0, form_id=\'view\'</string> </value>
<value> <string>form_id=\'view\', portal_type=\'Accounting Transaction Line\', line_count=1</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -93,20 +96,25 @@ return context.Base_redirect(form_id, keep_items=dict(\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>4</int> </value>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>portal_type</string>
<string>selection_name</string>
<string>selection_index</string>
<string>form_id</string>
<string>portal_type</string>
<string>line_count</string>
<string>Products.ERP5Type.Message</string>
<string>translateString</string>
<string>_getattr_</string>
<string>container</string>
<string>request</string>
<string>_getiter_</string>
<string>range</string>
<string>i</string>
<string>context</string>
<string>Base_translateString</string>
<string>dict</string>
<string>getattr</string>
</tuple>
</value>
</item>
......@@ -119,10 +127,9 @@ return context.Base_redirect(form_id, keep_items=dict(\n
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<string>Accounting Transaction Line</string>
<string></string>
<int>0</int>
<string>view</string>
<string>Accounting Transaction Line</string>
<int>1</int>
</tuple>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>AccountingTransaction_addAccountingTransactionLine</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>disabled</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>disabled</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>your_portal_type</string>
<string>your_line_count</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AccountingTransaction_viewAccountingTransactionLineDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_dialog</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Add Accounting Transaction Lines</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="IntegerField" module="Products.Formulator.StandardFields"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_line_count</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>integer_out_of_range</string> </key>
<value> <string>The integer you entered was out of range.</string> </value>
</item>
<item>
<key> <string>not_integer</string> </key>
<value> <string>You did not enter an integer.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>end</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>start</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>end</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>start</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string>figure</string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string>1</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>end</string> </key>
<value> <int>100</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>start</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Number of Lines to Add</string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2010-04-09 Jérome
* Add an action to add multiple accounting lines
2010-04-08 yusuke
* Reverted previous my change.
......
1156
\ No newline at end of file
1159
\ No newline at end of file
Accounting Rule Cell | Accounting Transaction Line
Accounting Transaction Module | Balance Transaction
Accounting Transaction | Accounting Transaction Line
Accounting Transaction | File
Accounting Transaction | Image
Balance Transaction | Balance Transaction Line
Payment Transaction | Accounting Transaction Line
Payment Transaction | File
Payment Transaction | Image
Preference | Accounting Transaction
......@@ -13,7 +11,5 @@ Preference | Purchase Invoice Transaction
Preference | Sale Invoice Transaction
Purchase Invoice Transaction | File
Purchase Invoice Transaction | Image
Purchase Invoice Transaction | Purchase Invoice Transaction Line
Sale Invoice Transaction | File
Sale Invoice Transaction | Image
Sale Invoice Transaction | Sale Invoice Transaction Line
\ No newline at end of file
Sale Invoice Transaction | Image
\ 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