diff --git a/bt5/erp5_accounting/ActionTemplateItem/portal_types/Accounting%20Transaction%20Module/create_reversal.xml b/bt5/erp5_accounting/ActionTemplateItem/portal_types/Accounting%20Transaction%20Module/create_reversal.xml new file mode 100644 index 0000000000000000000000000000000000000000..0212a08ac3cf660272354477a600bcac9559612d --- /dev/null +++ b/bt5/erp5_accounting/ActionTemplateItem/portal_types/Accounting%20Transaction%20Module/create_reversal.xml @@ -0,0 +1,77 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="ActionInformation" module="Products.CMFCore.ActionInformation"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>action</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>category</string> </key> + <value> <string>object_action</string> </value> + </item> + <item> + <key> <string>condition</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>icon</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>create_reversal</string> </value> + </item> + <item> + <key> <string>permissions</string> </key> + <value> + <tuple> + <string>Add portal content</string> + </tuple> + </value> + </item> + <item> + <key> <string>priority</string> </key> + <value> <float>35.0</float> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Create Reversal Transactions</string> </value> + </item> + <item> + <key> <string>visible</string> </key> + <value> <int>1</int> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <tuple> + <global name="Expression" module="Products.CMFCore.Expression"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>text</string> </key> + <value> <string>string:${object_url}/AccountingTransactionModule_viewCreateReversalTransactionListDialog</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_createReversalTransactionList.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_createReversalTransactionList.xml new file mode 100644 index 0000000000000000000000000000000000000000..d207af2b111beed78c70f9f6a5e35a8792ca5910 --- /dev/null +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_createReversalTransactionList.xml @@ -0,0 +1,211 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>Script_magic</string> </key> + <value> <int>3</int> </value> + </item> + <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> + <item> + <key> <string>name_container</string> </key> + <value> <string>container</string> </value> + </item> + <item> + <key> <string>name_context</string> </key> + <value> <string>context</string> </value> + </item> + <item> + <key> <string>name_m_self</string> </key> + <value> <string>script</string> </value> + </item> + <item> + <key> <string>name_subpath</string> </key> + <value> <string>traverse_subpath</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>_body</string> </key> + <value> <string encoding="cdata"><![CDATA[ + +from Products.ERP5Type.Message import translateString\n +try:\n + from zExceptions import Redirect\n +except:\n + Redirect = \'Redirect\'\n +portal = context.getPortalObject()\n +stool = portal.portal_selections\n +getObject = portal.portal_catalog.getObject\n +countMessage = portal.portal_activities.countMessage\n +\n +stool.updateSelectionCheckedUidList(selection_name, listbox_uid, uids)\n +selection_uid_list = context.portal_selections.getSelectionCheckedUidsFor(\n + selection_name)\n +if selection_uid_list:\n + object_list = [getObject(uid) for uid in selection_uid_list]\n +else:\n + object_list = stool.callSelectionFor(selection_name)\n +\n +# XXX prevent to call this on the whole module:\n +if len(object_list) >= 1000:\n + return context.Base_redirect(form_id,\n + keep_items=dict(portal_status_message=\n + translateString(\n + \'Refusing to process more than 1000 objects, check your selection.\')))\n +\n +tag = \'reversal_creation_%s\' % random.randint(0, 1000)\n +activated = 0\n +for obj in object_list:\n + obj = obj.getObject()\n + if obj.getSimulationState() == \'delivered\':\n + if countMessage(path=obj.getPath(),\n + method_id=\'AccountingTransaction_createReversalTransaction\'):\n + raise Redirect, "%s/view?portal_status_message=%s" % (\n + context.absolute_url(), translateString(\n + \'Reveral creation already in progress, abandon.\'))\n + obj.activate(tag=tag).AccountingTransaction_createReversalTransaction(\n + cancellation_amount=cancellation_amount)\n + activated += 1\n +\n +if not activated:\n + return context.Base_redirect(form_id,\n + keep_items=dict(portal_status_message=\n + translateString(\'No valid transaction in your selection.\')))\n +\n +# activate something on the folder\n +context.activate(after_tag=tag).getTitle()\n +\n +return context.Base_redirect(form_id,\n + keep_items=dict(portal_status_message=\n + translateString(\n + \'Reversal creation for ${activated_transaction_count} on\'\n + \' ${total_selection_count} transaction in progress.\',\n + mapping=dict(activated_transaction_count=activated,\n + total_selection_count=len(object_list)))))\n + + +]]></string> </value> + </item> + <item> + <key> <string>_code</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>_params</string> </key> + <value> <string>cancellation_amount=False, uids=[], listbox_uid=[], selection_name=\'\', form_id=\'view\'</string> </value> + </item> + <item> + <key> <string>errors</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>func_code</string> </key> + <value> + <object> + <klass> + <global name="FuncCode" module="Shared.DC.Scripts.Signature"/> + </klass> + <tuple/> + <state> + <dictionary> + <item> + <key> <string>co_argcount</string> </key> + <value> <int>5</int> </value> + </item> + <item> + <key> <string>co_varnames</string> </key> + <value> + <tuple> + <string>cancellation_amount</string> + <string>uids</string> + <string>listbox_uid</string> + <string>selection_name</string> + <string>form_id</string> + <string>Products.ERP5Type.Message</string> + <string>translateString</string> + <string>zExceptions</string> + <string>Redirect</string> + <string>_getattr_</string> + <string>context</string> + <string>portal</string> + <string>stool</string> + <string>getObject</string> + <string>countMessage</string> + <string>selection_uid_list</string> + <string>append</string> + <string>$append0</string> + <string>_getiter_</string> + <string>uid</string> + <string>object_list</string> + <string>len</string> + <string>dict</string> + <string>random</string> + <string>tag</string> + <string>activated</string> + <string>obj</string> + <string>_inplacevar_</string> + </tuple> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>func_defaults</string> </key> + <value> + <tuple> + <int>0</int> + <list/> + <list/> + <string></string> + <string>view</string> + </tuple> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>AccountingTransactionModule_createReversalTransactionList</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewCreateReversalTransactionListDialog.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewCreateReversalTransactionListDialog.xml new file mode 100644 index 0000000000000000000000000000000000000000..d10d144831895973bd676e698cabe3d5b23597e2 --- /dev/null +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewCreateReversalTransactionListDialog.xml @@ -0,0 +1,155 @@ +<?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>AccountingTransactionModule_createReversalTransactionList</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>multipart/form-data</string> </value> + </item> + <item> + <key> <string>group_list</string> </key> + <value> + <list> + <string>left</string> + <string>right</string> + <string>center</string> + <string>bottom</string> + <string>hidden</string> + </list> + </value> + </item> + <item> + <key> <string>groups</string> </key> + <value> + <dictionary> + <item> + <key> <string>bottom</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>center</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>left</string> </key> + <value> + <list> + <string>your_cancellation_amount</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>AccountingTransactionModule_viewCreateReversalTransactionListDialog</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>Create Reversal Transactions</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> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewCreateReversalTransactionListDialog/your_cancellation_amount.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewCreateReversalTransactionListDialog/your_cancellation_amount.xml new file mode 100644 index 0000000000000000000000000000000000000000..e874d703f67c02ca560c5e40d379565258f0c855 --- /dev/null +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewCreateReversalTransactionListDialog/your_cancellation_amount.xml @@ -0,0 +1,171 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="CheckBoxField" module="Products.Formulator.StandardFields"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>your_cancellation_amount</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> + </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>editable</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>enabled</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>title</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>editable</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>enabled</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>title</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></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string>Use negated quantity or simply invert debit and credit</string> </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>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>title</string> </key> + <value> <string>Use Negated Quantities</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_createReversalTransaction.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_createReversalTransaction.xml index 0144af8f4065278bf9c6d23abc5b211b73e71572..a99e25397dad68699ada7d2dd1cbeddab096ead4 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_createReversalTransaction.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_createReversalTransaction.xml @@ -53,7 +53,7 @@ </item> <item> <key> <string>_body</string> </key> - <value> <string>""" Create a reversal transaction from current tansaction. """\n + <value> <string>""" Create a reversal transaction from current transaction. """\n \n Base_translateString = context.Base_translateString\n accounting_module = context.getPortalObject().accounting_module\n diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision index 5a30e5affae608896860bb798cf1b9a56cd7fb89..db8b6957791f1d8c1ec59584a196b2eaa9f92f76 100644 --- a/bt5/erp5_accounting/bt/revision +++ b/bt5/erp5_accounting/bt/revision @@ -1 +1 @@ -947 \ No newline at end of file +948 \ No newline at end of file diff --git a/bt5/erp5_accounting/bt/template_action_path_list b/bt5/erp5_accounting/bt/template_action_path_list index ffedd2197105420dc39bd0e902de3b4fe77bff2c..8d0e3ccb1847ac9f8dde9008e1b9fc0d302462d1 100644 --- a/bt5/erp5_accounting/bt/template_action_path_list +++ b/bt5/erp5_accounting/bt/template_action_path_list @@ -18,6 +18,7 @@ Accounting Transaction Module | account_statement_report Accounting Transaction Module | balance_sheet_report Accounting Transaction Module | bank_accounts_report Accounting Transaction Module | create_related_payments +Accounting Transaction Module | create_reversal Accounting Transaction Module | general_ledger_export Accounting Transaction Module | general_ledger_report Accounting Transaction Module | grouping_reference_fast_input