Commit ceb811bb authored by Łukasz Nowak's avatar Łukasz Nowak

Reintroduce scripts for accounting removal.

parent 583853fe
...@@ -51,8 +51,9 @@ ...@@ -51,8 +51,9 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>accounting_module = context.getParentValue()\n <value> <string>accounting_module = context.getParentValue()\n
if accounting_module.getPortalType() != \'Accounting Transaction Module\':\n \n
raise ValueError(\'%s is not children of Accounting Transaction Module\')\n assert accounting_module.getPortalType() == \'Accounting Transaction Module\'\n
\n
accounting_module.deleteContent(context.getId())\n accounting_module.deleteContent(context.getId())\n
</string> </value> </string> </value>
</item> </item>
......
...@@ -52,8 +52,11 @@ ...@@ -52,8 +52,11 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>context.getPortalObject().portal_catalog.searchAndActivate(\n <value> <string>context.getPortalObject().portal_catalog.searchAndActivate(\n
parent_uid=context.getPortalObject().accounting_module.getUid(),\n parent_uid=context.getPortalObject().accounting_module.getUid(),\n
method_id=\'AccountingTransaction_delete\'\n method_id=\'AccountingTransaction_delete\',\n
activate_kw={\'tag\': \'AccountingTransaction_delete\'}\n
)\n )\n
\n
return \'Deletion initiated.\'\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -62,7 +65,7 @@ ...@@ -62,7 +65,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>AccountingModule_initiateDelete</string> </value> <value> <string>ERP5Site_initiateAccountingModuleRemoval</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -50,10 +50,22 @@ ...@@ -50,10 +50,22 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>simulation_tool = context.getParentValue()\n <value> <string>portal = context.getPortalObject()\n
if simulation_tool.getPortalType() != \'Simulation Tool\':\n \n
raise ValueError(\'%s is not children of Simulation Tool\')\n rule_uid_list = [\n
simulation_tool.deleteContent(context.getId())\n portal.portal_rules.vifib_invoice_simulation_rule.getUid(),\n
portal.portal_rules.vifib_invoice_root_simulation_rule.getUid()\n
]\n
\n
portal.portal_catalog.searchAndActivate(\n
portal_type=\'Applied Rule\',\n
specialise_uid=rule_uid_list,\n
method_id=\'InvoiceAppliedRule_delete\',\n
method_kw={\'rule_uid_list\': rule_uid_list},\n
activate_kw={\'tag\': \'InvoiceAppliedRule_delete\'}\n
)\n
\n
return \'Invoice Applied Rule deletion initated.\'\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -62,7 +74,7 @@ simulation_tool.deleteContent(context.getId())\n ...@@ -62,7 +74,7 @@ simulation_tool.deleteContent(context.getId())\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>RootAppliedRule_delete</string> </value> <value> <string>ERP5Site_initiateInvoiceAppliedRuleDeletion</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -50,19 +50,18 @@ ...@@ -50,19 +50,18 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>context.getPortalObject().portal_catalog.searchAndActivate(\n <value> <string>assert context.getSpecialiseUid() in rule_uid_list\n
parent_uid=context.getPortalObject().portal_simulation.getUid(),\n \n
method_id=\'RootAppliedRule_delete\'\n context.getParentValue().deleteContent(context.getId())\n
)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>rule_uid_list</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>SimulationTool_initiateDelete</string> </value> <value> <string>InvoiceAppliedRule_delete</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
152 153
\ 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