From e585b05adcc8b2f76d9b158aaacd1e70b4719ebe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Wed, 22 Aug 2007 16:24:52 +0000
Subject: [PATCH] Refactor the use of Accounting Period. Closing a period will
 new create a balance transaction. Balance Transaction also changed, it now
 uses destination by default, because BalanceTransaction will in the near
 future be catalogued as inventories. Accounting Period workflow was also
 simplified a lot.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15786 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../Balance%20Transaction%20Line/view.xml     |   2 +-
 ...ountingPeriod_createBalanceTransaction.xml | 351 ++++++++++++++++++
 .../AccountingPeriod_view/my_description.xml  |   2 +-
 .../my_translated_simulation_state_title.xml  | 216 ++---------
 ...Period_viewDeliverWorkflowActionDialog.xml | 136 +++++++
 .../my_comment.xml                            | 307 +++++++++++++++
 .../my_workflow_action.xml}                   |  52 +--
 .../your_profit_and_loss_account.xml          | 289 ++++++++++++++
 .../BalanceTransaction_view.xml               |  17 +-
 .../BalanceTransaction_view/listbox.xml       |  61 ++-
 ...box_source.xml => listbox_destination.xml} |   4 +-
 ...bit.xml => listbox_destination_credit.xml} |   4 +-
 ...edit.xml => listbox_destination_debit.xml} |   4 +-
 ...nt.xml => listbox_destination_payment.xml} |   6 +-
 .../listbox_resource.xml                      |   2 +-
 ...e.xml => listbox_source_section_title.xml} |   4 +-
 .../my_destination_reference.xml              | 272 ++++++++++++++
 ...section.xml => my_destination_section.xml} |   2 +-
 .../BalanceTransaction_view/my_resource.xml   | 295 +++++++++++++++
 .../my_translated_portal_type.xml             | 272 ++++++++++++++
 .../my_translated_simulation_state_title.xml  | 272 ++++++++++++++
 ...ccountingPeriod_CheckTransactionsState.xml | 198 ----------
 ...ngPeriod_CheckDates.xml => checkDates.xml} |  43 +--
 ...actions.xml => checkTransactionsState.xml} |  90 ++---
 .../scripts/createBalanceTransaction.xml}     |  55 ++-
 .../states/cancelled.xml                      |  12 +-
 .../states/closing.xml                        |  51 ---
 .../states/delivered.xml                      |   4 +-
 .../states/draft.xml                          |  12 +-
 .../states/{confirmed.xml => started.xml}     |  23 +-
 .../states/{planned.xml => stopped.xml}       |  22 +-
 .../transitions/cancel_action.xml             |   1 -
 .../transitions/close.xml                     |  70 ----
 .../transitions/deliver.xml                   |   2 +-
 .../{close_action.xml => deliver_action.xml}  |  61 ++-
 .../transitions/fail_closing.xml              |  70 ----
 .../{reopen_action.xml => restart_action.xml} |   9 +-
 .../transitions/{confirm.xml => start.xml}    |   4 +-
 .../{plan_action.xml => start_action.xml}     |   9 +-
 .../transitions/{plan.xml => stop.xml}        |   4 +-
 .../{confirm_action.xml => stop_action.xml}   |  11 +-
 .../{zz.xml => profit_and_loss_account.xml}   |  35 +-
 .../scripts/validateTransaction.xml           |  39 +-
 bt5/erp5_accounting/bt/revision               |   2 +-
 44 files changed, 2526 insertions(+), 871 deletions(-)
 create mode 100644 bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_createBalanceTransaction.xml
 create mode 100644 bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_viewDeliverWorkflowActionDialog.xml
 create mode 100644 bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_viewDeliverWorkflowActionDialog/my_comment.xml
 rename bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/{BalanceTransaction_view/simulation_state.xml => AccountingPeriod_viewDeliverWorkflowActionDialog/my_workflow_action.xml} (85%)
 create mode 100644 bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_viewDeliverWorkflowActionDialog/your_profit_and_loss_account.xml
 rename bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/{listbox_source.xml => listbox_destination.xml} (98%)
 rename bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/{listbox_source_debit.xml => listbox_destination_credit.xml} (98%)
 rename bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/{listbox_source_credit.xml => listbox_destination_debit.xml} (98%)
 rename bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/{listbox_source_payment.xml => listbox_destination_payment.xml} (98%)
 rename bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/{listbox_destination_section_title.xml => listbox_source_section_title.xml} (98%)
 create mode 100644 bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_destination_reference.xml
 rename bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/{my_source_section.xml => my_destination_section.xml} (99%)
 create mode 100644 bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_resource.xml
 create mode 100644 bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_translated_portal_type.xml
 create mode 100644 bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_translated_simulation_state_title.xml
 delete mode 100644 bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/AccountingPeriod_CheckTransactionsState.xml
 rename bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/{AccountingPeriod_CheckDates.xml => checkDates.xml} (83%)
 rename bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/{AccountingPeriod_DeliverTransactions.xml => checkTransactionsState.xml} (67%)
 rename bt5/erp5_accounting/{SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_closeByAccountingPeriod.xml => WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/createBalanceTransaction.xml} (69%)
 delete mode 100644 bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/closing.xml
 rename bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/{confirmed.xml => started.xml} (84%)
 rename bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/{planned.xml => stopped.xml} (82%)
 delete mode 100644 bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/close.xml
 rename bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/{close_action.xml => deliver_action.xml} (58%)
 delete mode 100644 bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/fail_closing.xml
 rename bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/{reopen_action.xml => restart_action.xml} (92%)
 rename bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/{confirm.xml => start.xml} (94%)
 rename bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/{plan_action.xml => start_action.xml} (89%)
 rename bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/{plan.xml => stop.xml} (94%)
 rename bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/{confirm_action.xml => stop_action.xml} (86%)
 rename bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/variables/{zz.xml => profit_and_loss_account.xml} (69%)

diff --git a/bt5/erp5_accounting/ActionTemplateItem/portal_types/Balance%20Transaction%20Line/view.xml b/bt5/erp5_accounting/ActionTemplateItem/portal_types/Balance%20Transaction%20Line/view.xml
index 25742d3194..722f0bf71c 100644
--- a/bt5/erp5_accounting/ActionTemplateItem/portal_types/Balance%20Transaction%20Line/view.xml
+++ b/bt5/erp5_accounting/ActionTemplateItem/portal_types/Balance%20Transaction%20Line/view.xml
@@ -81,7 +81,7 @@
       <dictionary>
         <item>
             <key> <string>text</string> </key>
-            <value> <string>string:${object_url}/AccountingTransactionLine_view</string> </value>
+            <value> <string>string:${object_url}/AccountingTransactionLine_viewDestination</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_createBalanceTransaction.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_createBalanceTransaction.xml
new file mode 100644
index 0000000000..c3a4bbefc6
--- /dev/null
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_createBalanceTransaction.xml
@@ -0,0 +1,351 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.PythonScripts.PythonScript</string>
+          <string>PythonScript</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Python_magic</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </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[
+
+"""Creates a balance transaction to open the next period.\n
+\n
+"""\n
+portal = context.getPortalObject()\n
+N_ = portal.Base_translateString\n
+\n
+precision_cache = dict()\n
+def roundCurrency(value, resource_relative_url):\n
+  if resource_relative_url not in precision_cache:\n
+    qty_precision = portal.restrictedTraverse(\n
+                        resource_relative_url).getQuantityPrecision()\n
+    precision_cache[resource_relative_url] = qty_precision\n
+  qty_precision = precision_cache[resource_relative_url]\n
+  return round(value, qty_precision)\n
+\n
+at_date = context.getStopDate()\n
+assert at_date\n
+\n
+section = context.getParentValue()\n
+section_uid = context.getParentUid()\n
+section_currency = section.getPriceCurrency()\n
+\n
+balance_transaction = portal.accounting_module.newContent(\n
+                        portal_type=\'Balance Transaction\',\n
+                        start_date=(at_date + 1).earliestTime(),\n
+                        title=context.getTitle() or N_(\'Balance Transaction\'),\n
+                        destination_section_value=section,\n
+                        resource=section_currency,\n
+                        causality_value=context)\n
+\n
+group_by_node_node_category_list = []\n
+group_by_mirror_section_node_category_list = []\n
+group_by_payment_node_category_list = []\n
+profit_and_loss_node_category_list = []\n
+\n
+node_category_list = portal.portal_categories\\\n
+            .account_type.getCategoryChildValueList()\n
+for node_category in node_category_list:\n
+  node_category_url = node_category.getRelativeUrl()\n
+  if node_category_url in (\n
+      \'account_type/asset/cash/bank\',):\n
+    group_by_payment_node_category_list.append(node_category_url)\n
+  elif node_category_url in (\n
+      \'account_type/asset/receivable\',\n
+      \'account_type/liability/payable\'):\n
+    group_by_mirror_section_node_category_list.append(node_category_url)\n
+  elif node_category_url in (\'account_type/income\', \'account_type/expense\'):\n
+    profit_and_loss_node_category_list.append(node_category_url)\n
+  else:\n
+    group_by_node_node_category_list.append(node_category_url)\n
+\n
+getInventoryList = portal.portal_simulation.getInventoryList\n
+\n
+inventory_param_dict = dict(section_uid=section_uid,\n
+                            simulation_state=(\'delivered\',),\n
+                            portal_type=portal.getPortalAccountingMovementTypeList(),\n
+                            at_date=at_date.latestTime(),)\n
+                            \n
+section_currency_uid = context.getParentValue().getPriceCurrencyUid()\n
+\n
+profit_and_loss_quantity = 0\n
+\n
+for inventory in getInventoryList(\n
+        node_category_strict_membership=group_by_node_node_category_list,\n
+        group_by_node=1,\n
+        group_by_resource=1,\n
+        **inventory_param_dict):\n
+  \n
+  total_price = roundCurrency(inventory.total_price, section_currency)\n
+  quantity = roundCurrency(inventory.total_quantity,\n
+                           inventory.resource_relative_url)\n
+\n
+  if inventory.resource_uid != section_currency_uid:\n
+    if inventory.node_relative_url == profit_and_loss_account:\n
+      raise ValueError(\'Using multiple currencies on profit and loss account \'\n
+                       \'is not supported\')\n
+    profit_and_loss_quantity += total_price\n
+    balance_transaction.newContent(\n
+        portal_type=\'Balance Transaction Line\',\n
+        destination=inventory.node_relative_url,\n
+        resource=inventory.resource_relative_url,\n
+        quantity=quantity,\n
+        destination_total_asset_price=total_price)\n
+  else:\n
+    if total_price != quantity:\n
+      # If this fail for you, your accounting doesn\'t use currencies with\n
+      # consistency\n
+      raise ValueError(\'Different price: %s != %s \' % (\n
+                        total_price, quantity))\n
+    \n
+    if inventory.node_relative_url != profit_and_loss_account:\n
+      profit_and_loss_quantity += total_price\n
+      balance_transaction.newContent(\n
+        portal_type=\'Balance Transaction Line\',\n
+        destination=inventory.node_relative_url,\n
+        quantity=total_price)\n
+\n
+    \n
+for inventory in getInventoryList(\n
+        node_category_strict_membership=group_by_mirror_section_node_category_list,\n
+        group_by_node=1,\n
+        group_by_mirror_section=1,\n
+        group_by_resource=1,\n
+        **inventory_param_dict):\n
+\n
+  total_price = roundCurrency(inventory.total_price, section_currency)\n
+  quantity = roundCurrency(inventory.total_quantity,\n
+                           inventory.resource_relative_url)\n
+  profit_and_loss_quantity += total_price\n
+\n
+  if inventory.resource_uid != section_currency_uid:\n
+    balance_transaction.newContent(\n
+      portal_type=\'Balance Transaction Line\',\n
+      destination=inventory.node_relative_url,\n
+      source_section_uid=inventory.mirror_section_uid,\n
+      resource=inventory.resource_relative_url,\n
+      quantity=quantity,\n
+      destination_total_asset_price=total_price)\n
+  else:\n
+    if total_price != quantity:\n
+      raise ValueError(\'Different price: %s != %s \' % (\n
+                        total_price, quantity))\n
+    balance_transaction.newContent(\n
+      portal_type=\'Balance Transaction Line\',\n
+      destination=inventory.node_relative_url,\n
+      source_section_uid=inventory.mirror_section_uid,\n
+      quantity=total_price)\n
+\n
+\n
+for inventory in getInventoryList(\n
+        node_category_strict_membership=group_by_payment_node_category_list,\n
+        group_by_node=1,\n
+        group_by_payment=1,\n
+        group_by_resource=1,\n
+        **inventory_param_dict):\n
+\n
+  total_price = roundCurrency(inventory.total_price, section_currency)\n
+  quantity = roundCurrency(inventory.total_quantity,\n
+                           inventory.resource_relative_url)\n
+  profit_and_loss_quantity += total_price\n
+\n
+  if inventory.resource_uid != section_currency_uid:\n
+    balance_transaction.newContent(\n
+      portal_type=\'Balance Transaction Line\',\n
+      destination=inventory.node_relative_url,\n
+      resource=inventory.resource_relative_url,\n
+      quantity=quantity,\n
+      destination_payment_uid=inventory.payment_uid,\n
+      destination_total_asset_price=total_price)\n
+  else:\n
+    if total_price != quantity:\n
+      raise ValueError(\'Different price: %s != %s \' % (\n
+                        total_price, quantity))\n
+    balance_transaction.newContent(\n
+      portal_type=\'Balance Transaction Line\',\n
+      destination=inventory.node_relative_url,\n
+      destination_payment_uid=inventory.payment_uid,\n
+      quantity=total_price)\n
+\n
+# add a final line for p&l\n
+balance_transaction.newContent(\n
+          portal_type=\'Balance Transaction Line\',\n
+          destination=profit_and_loss_account,\n
+          quantity=-profit_and_loss_quantity)\n
+\n
+# and go to delivered state directly (the user is not supposed to edit this document)\n
+balance_transaction.stop()\n
+balance_transaction.deliver()\n
+
+
+]]></string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_filepath</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>profit_and_loss_account=None</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>1</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>profit_and_loss_account</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>portal</string>
+                            <string>N_</string>
+                            <string>dict</string>
+                            <string>precision_cache</string>
+                            <string>roundCurrency</string>
+                            <string>at_date</string>
+                            <string>AssertionError</string>
+                            <string>section</string>
+                            <string>section_uid</string>
+                            <string>section_currency</string>
+                            <string>balance_transaction</string>
+                            <string>group_by_node_node_category_list</string>
+                            <string>group_by_mirror_section_node_category_list</string>
+                            <string>group_by_payment_node_category_list</string>
+                            <string>profit_and_loss_node_category_list</string>
+                            <string>node_category_list</string>
+                            <string>_getiter_</string>
+                            <string>node_category</string>
+                            <string>node_category_url</string>
+                            <string>getInventoryList</string>
+                            <string>inventory_param_dict</string>
+                            <string>section_currency_uid</string>
+                            <string>profit_and_loss_quantity</string>
+                            <string>_apply_</string>
+                            <string>inventory</string>
+                            <string>total_price</string>
+                            <string>quantity</string>
+                            <string>ValueError</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <tuple>
+                <none/>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>AccountingPeriod_createBalanceTransaction</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/AccountingPeriod_view/my_description.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_view/my_description.xml
index 53d6d02109..25e69b7359 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_view/my_description.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_view/my_description.xml
@@ -263,7 +263,7 @@
                 </item>
                 <item>
                     <key> <string>title</string> </key>
-                    <value> <string>Comments</string> </value>
+                    <value> <string>Description</string> </value>
                 </item>
                 <item>
                     <key> <string>unicode</string> </key>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_view/my_translated_simulation_state_title.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_view/my_translated_simulation_state_title.xml
index 8683bd78eb..8e6d27a02c 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_view/my_translated_simulation_state_title.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_view/my_translated_simulation_state_title.xml
@@ -4,14 +4,26 @@
     <pickle>
       <tuple>
         <tuple>
-          <string>Products.Formulator.StandardFields</string>
-          <string>StringField</string>
+          <string>Products.ERP5Form.ProxyField</string>
+          <string>ProxyField</string>
         </tuple>
         <none/>
       </tuple>
     </pickle>
     <pickle>
       <dictionary>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>delegated_list</string> </key>
+            <value>
+              <list/>
+            </value>
+        </item>
         <item>
             <key> <string>id</string> </key>
             <value> <string>my_translated_simulation_state_title</string> </value>
@@ -24,14 +36,6 @@
                     <key> <string>external_validator_failed</string> </key>
                     <value> <string>The input failed the external validator.</string> </value>
                 </item>
-                <item>
-                    <key> <string>required_not_found</string> </key>
-                    <value> <string>Input is required but no input given.</string> </value>
-                </item>
-                <item>
-                    <key> <string>too_long</string> </key>
-                    <value> <string>Too much input was given.</string> </value>
-                </item>
               </dictionary>
             </value>
         </item>
@@ -40,71 +44,15 @@
             <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>
+                    <key> <string>field_id</string> </key>
                     <value> <string></string> </value>
                 </item>
                 <item>
-                    <key> <string>external_validator</string> </key>
+                    <key> <string>form_id</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>max_length</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>required</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>title</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>truncate</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>unicode</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>whitespace_preserve</string> </key>
+                    <key> <string>target</string> </key>
                     <value> <string></string> </value>
                 </item>
               </dictionary>
@@ -115,71 +63,15 @@
             <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>
+                    <key> <string>field_id</string> </key>
                     <value> <string></string> </value>
                 </item>
                 <item>
-                    <key> <string>display_width</string> </key>
+                    <key> <string>form_id</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>max_length</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>required</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>title</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>truncate</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>unicode</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>whitespace_preserve</string> </key>
+                    <key> <string>target</string> </key>
                     <value> <string></string> </value>
                 </item>
               </dictionary>
@@ -190,72 +82,16 @@
             <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> <int>20</int> </value>
-                </item>
-                <item>
-                    <key> <string>editable</string> </key>
-                    <value> <int>0</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>max_length</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>required</string> </key>
-                    <value> <int>0</int> </value>
-                </item>
-                <item>
-                    <key> <string>title</string> </key>
-                    <value> <string>State</string> </value>
-                </item>
-                <item>
-                    <key> <string>truncate</string> </key>
-                    <value> <int>0</int> </value>
+                    <key> <string>field_id</string> </key>
+                    <value> <string>my_translated_workflow_state_title</string> </value>
                 </item>
                 <item>
-                    <key> <string>unicode</string> </key>
-                    <value> <int>0</int> </value>
+                    <key> <string>form_id</string> </key>
+                    <value> <string>Base_viewFieldLibrary</string> </value>
                 </item>
                 <item>
-                    <key> <string>whitespace_preserve</string> </key>
-                    <value> <int>0</int> </value>
+                    <key> <string>target</string> </key>
+                    <value> <string>Click to edit the target</string> </value>
                 </item>
               </dictionary>
             </value>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_viewDeliverWorkflowActionDialog.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_viewDeliverWorkflowActionDialog.xml
new file mode 100644
index 0000000000..d0638fd8bf
--- /dev/null
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_viewDeliverWorkflowActionDialog.xml
@@ -0,0 +1,136 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.ERP5Form.Form</string>
+          <string>ERP5Form</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </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/>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_objects</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>action</string> </key>
+            <value> <string>Workflow_statusModify</string> </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>
+              </list>
+            </value>
+        </item>
+        <item>
+            <key> <string>groups</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>left</string> </key>
+                    <value>
+                      <list>
+                        <string>my_comment</string>
+                        <string>my_workflow_action</string>
+                        <string>your_profit_and_loss_account</string>
+                      </list>
+                    </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>AccountingPeriod_viewDeliverWorkflowActionDialog</string> </value>
+        </item>
+        <item>
+            <key> <string>method</string> </key>
+            <value> <string>POST</string> </value>
+        </item>
+        <item>
+            <key> <string>name</string> </key>
+            <value> <string>Base_viewWorkflowActionDialog</string> </value>
+        </item>
+        <item>
+            <key> <string>pt</string> </key>
+            <value> <string>form_view_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>Validate Workflow Action</string> </value>
+        </item>
+        <item>
+            <key> <string>uid</string> </key>
+            <value>
+              <none/>
+            </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>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_viewDeliverWorkflowActionDialog/my_comment.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_viewDeliverWorkflowActionDialog/my_comment.xml
new file mode 100644
index 0000000000..e063434a27
--- /dev/null
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_viewDeliverWorkflowActionDialog/my_comment.xml
@@ -0,0 +1,307 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.Formulator.StandardFields</string>
+          <string>TextAreaField</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>my_comment</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>line_too_long</string> </key>
+                    <value> <string>A line was too long.</string> </value>
+                </item>
+                <item>
+                    <key> <string>required_not_found</string> </key>
+                    <value> <string>Input is required but no input given.</string> </value>
+                </item>
+                <item>
+                    <key> <string>too_long</string> </key>
+                    <value> <string>You entered too many characters.</string> </value>
+                </item>
+                <item>
+                    <key> <string>too_many_lines</string> </key>
+                    <value> <string>You entered too many lines.</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>height</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>max_linelength</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>max_lines</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>width</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>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </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>height</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>max_linelength</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>max_lines</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>width</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> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></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>height</string> </key>
+                    <value> <int>10</int> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>max_linelength</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>max_lines</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Comment</string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
+                <item>
+                    <key> <string>width</string> </key>
+                    <value> <int>80</int> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.Formulator.TALESField</string>
+          <string>TALESMethod</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string>python: \'\'</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/simulation_state.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_viewDeliverWorkflowActionDialog/my_workflow_action.xml
similarity index 85%
rename from bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/simulation_state.xml
rename to bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_viewDeliverWorkflowActionDialog/my_workflow_action.xml
index 3cb75db0c7..406edd58b0 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/simulation_state.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_viewDeliverWorkflowActionDialog/my_workflow_action.xml
@@ -14,7 +14,7 @@
       <dictionary>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>simulation_state</string> </value>
+            <value> <string>my_workflow_action</string> </value>
         </item>
         <item>
             <key> <string>message_values</string> </key>
@@ -217,23 +217,7 @@
                 </item>
                 <item>
                     <key> <string>editable</string> </key>
-                    <value> <int>0</int> </value>
-                </item>
-                <item>
-                    <key> <string>editable_expression</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>editable_permission</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>editable_role</string> </key>
-                    <value>
-                      <list/>
-                    </value>
+                    <value> <int>1</int> </value>
                 </item>
                 <item>
                     <key> <string>enabled</string> </key>
@@ -249,27 +233,19 @@
                 </item>
                 <item>
                     <key> <string>hidden</string> </key>
-                    <value> <int>0</int> </value>
+                    <value> <int>1</int> </value>
                 </item>
                 <item>
                     <key> <string>max_length</string> </key>
                     <value> <string></string> </value>
                 </item>
-                <item>
-                    <key> <string>not_viewable</string> </key>
-                    <value> <int>0</int> </value>
-                </item>
-                <item>
-                    <key> <string>read_only</string> </key>
-                    <value> <int>1</int> </value>
-                </item>
                 <item>
                     <key> <string>required</string> </key>
-                    <value> <int>0</int> </value>
+                    <value> <int>1</int> </value>
                 </item>
                 <item>
                     <key> <string>title</string> </key>
-                    <value> <string>State</string> </value>
+                    <value> <string></string> </value>
                 </item>
                 <item>
                     <key> <string>truncate</string> </key>
@@ -279,22 +255,6 @@
                     <key> <string>unicode</string> </key>
                     <value> <int>0</int> </value>
                 </item>
-                <item>
-                    <key> <string>viewable_expression</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>viewable_permission</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>viewable_role</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
                 <item>
                     <key> <string>whitespace_preserve</string> </key>
                     <value> <int>0</int> </value>
@@ -319,7 +279,7 @@
       <dictionary>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string>python: here.portal_workflow.getInfoFor(here, \'simulation_state\')</string> </value>
+            <value> <string>request/workflow_action | nothing</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_viewDeliverWorkflowActionDialog/your_profit_and_loss_account.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_viewDeliverWorkflowActionDialog/your_profit_and_loss_account.xml
new file mode 100644
index 0000000000..4cf32d2b17
--- /dev/null
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_viewDeliverWorkflowActionDialog/your_profit_and_loss_account.xml
@@ -0,0 +1,289 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.Formulator.StandardFields</string>
+          <string>ListField</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>your_profit_and_loss_account</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>required_not_found</string> </key>
+                    <value> <string>Input is required but no input given.</string> </value>
+                </item>
+                <item>
+                    <key> <string>unknown_selection</string> </key>
+                    <value> <string>You selected an item that was not in the list.</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>extra_item</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>first_item</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>items</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>size</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</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>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>extra_item</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>first_item</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>items</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>size</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</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></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> <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>extra_item</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>first_item</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>items</string> </key>
+                    <value>
+                      <list/>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
+                <item>
+                    <key> <string>size</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Profit And Loss Account</string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.Formulator.TALESField</string>
+          <string>TALESMethod</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string>here/AccountingTransactionLine_getNodeItemList</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view.xml
index 12c290e41f..28c331e15f 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view.xml
@@ -91,12 +91,12 @@
                     <key> <string>hidden</string> </key>
                     <value>
                       <list>
-                        <string>listbox_source_payment</string>
                         <string>listbox_resource</string>
-                        <string>listbox_source</string>
-                        <string>listbox_source_debit</string>
-                        <string>listbox_source_credit</string>
-                        <string>listbox_destination_section_title</string>
+                        <string>listbox_source_section_title</string>
+                        <string>listbox_destination</string>
+                        <string>listbox_destination_credit</string>
+                        <string>listbox_destination_debit</string>
+                        <string>listbox_destination_payment</string>
                       </list>
                     </value>
                 </item>
@@ -104,8 +104,10 @@
                     <key> <string>left</string> </key>
                     <value>
                       <list>
-                        <string>my_source_section</string>
+                        <string>my_destination_section</string>
+                        <string>my_destination_reference</string>
                         <string>my_title</string>
+                        <string>my_resource</string>
                       </list>
                     </value>
                 </item>
@@ -115,7 +117,8 @@
                       <list>
                         <string>my_start_date</string>
                         <string>my_description</string>
-                        <string>simulation_state</string>
+                        <string>my_translated_portal_type</string>
+                        <string>my_translated_simulation_state_title</string>
                       </list>
                     </value>
                 </item>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox.xml
index 359aba7b60..8f830ec005 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox.xml
@@ -338,15 +338,15 @@
                           <string>ID</string>
                         </tuple>
                         <tuple>
-                          <string>source</string>
+                          <string>destination</string>
                           <string>Account</string>
                         </tuple>
                         <tuple>
-                          <string>source_payment</string>
+                          <string>destination_payment</string>
                           <string>Bank Account</string>
                         </tuple>
                         <tuple>
-                          <string>getDestinationSectionTitle</string>
+                          <string>source_section_title</string>
                           <string>Third Party</string>
                         </tuple>
                         <tuple>
@@ -354,11 +354,11 @@
                           <string>Currency</string>
                         </tuple>
                         <tuple>
-                          <string>source_debit</string>
+                          <string>destination_debit</string>
                           <string>Debit</string>
                         </tuple>
                         <tuple>
-                          <string>source_credit</string>
+                          <string>destination_credit</string>
                           <string>Credit</string>
                         </tuple>
                       </list>
@@ -405,11 +405,11 @@
                     <value>
                       <list>
                         <tuple>
-                          <string>source</string>
+                          <string>destination</string>
                           <string>Account</string>
                         </tuple>
                         <tuple>
-                          <string>source_payment</string>
+                          <string>destination_payment</string>
                           <string>Bank Account</string>
                         </tuple>
                         <tuple>
@@ -417,11 +417,11 @@
                           <string>Currency</string>
                         </tuple>
                         <tuple>
-                          <string>source_debit</string>
+                          <string>destination_debit</string>
                           <string>Debit</string>
                         </tuple>
                         <tuple>
-                          <string>source_credit</string>
+                          <string>destination_credit</string>
                           <string>Credit</string>
                         </tuple>
                       </list>
@@ -454,12 +454,7 @@
                 <item>
                     <key> <string>global_attributes</string> </key>
                     <value>
-                      <list>
-                        <tuple>
-                          <string>source_section</string>
-                          <string>source_section</string>
-                        </tuple>
-                      </list>
+                      <list/>
                     </value>
                 </item>
                 <item>
@@ -468,7 +463,7 @@
                 </item>
                 <item>
                     <key> <string>lines</string> </key>
-                    <value> <int>20</int> </value>
+                    <value> <int>30</int> </value>
                 </item>
                 <item>
                     <key> <string>list_action</string> </key>
@@ -552,12 +547,23 @@
                 <item>
                     <key> <string>stat_columns</string> </key>
                     <value>
-                      <list/>
+                      <list>
+                        <tuple>
+                          <string>destination_debit</string>
+                          <string>AccountingTransactionLine_statSourceCredit</string>
+                        </tuple>
+                        <tuple>
+                          <string>destination_credit</string>
+                          <string>AccountingTransactionLine_statSourceDebit</string>
+                        </tuple>
+                      </list>
                     </value>
                 </item>
                 <item>
                     <key> <string>stat_method</string> </key>
-                    <value> <string></string> </value>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+                    </value>
                 </item>
                 <item>
                     <key> <string>title</string> </key>
@@ -610,4 +616,23 @@
       </dictionary>
     </pickle>
   </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.Formulator.MethodField</string>
+          <string>Method</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>method_name</string> </key>
+            <value> <string>AccountingTransaction_getInvoiceTransactionLineList</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
 </ZopeData>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_source.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_destination.xml
similarity index 98%
rename from bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_source.xml
rename to bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_destination.xml
index 5a47862c30..d3c9e936a0 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_source.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_destination.xml
@@ -14,7 +14,7 @@
       <dictionary>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>listbox_source</string> </value>
+            <value> <string>listbox_destination</string> </value>
         </item>
         <item>
             <key> <string>message_values</string> </key>
@@ -251,7 +251,7 @@
                 </item>
                 <item>
                     <key> <string>title</string> </key>
-                    <value> <string>listbox_source</string> </value>
+                    <value> <string>Destination</string> </value>
                 </item>
                 <item>
                     <key> <string>unicode</string> </key>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_source_debit.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_destination_credit.xml
similarity index 98%
rename from bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_source_debit.xml
rename to bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_destination_credit.xml
index 30487e6dda..9c91dcf608 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_source_debit.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_destination_credit.xml
@@ -14,7 +14,7 @@
       <dictionary>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>listbox_source_debit</string> </value>
+            <value> <string>listbox_destination_credit</string> </value>
         </item>
         <item>
             <key> <string>message_values</string> </key>
@@ -233,7 +233,7 @@
                 </item>
                 <item>
                     <key> <string>title</string> </key>
-                    <value> <string>listbox_source_debit</string> </value>
+                    <value> <string>Credit</string> </value>
                 </item>
                 <item>
                     <key> <string>whitespace_preserve</string> </key>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_source_credit.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_destination_debit.xml
similarity index 98%
rename from bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_source_credit.xml
rename to bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_destination_debit.xml
index 81bf8eaffc..8e71c7b0c0 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_source_credit.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_destination_debit.xml
@@ -14,7 +14,7 @@
       <dictionary>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>listbox_source_credit</string> </value>
+            <value> <string>listbox_destination_debit</string> </value>
         </item>
         <item>
             <key> <string>message_values</string> </key>
@@ -233,7 +233,7 @@
                 </item>
                 <item>
                     <key> <string>title</string> </key>
-                    <value> <string>listbox_source_credit</string> </value>
+                    <value> <string>Debit</string> </value>
                 </item>
                 <item>
                     <key> <string>whitespace_preserve</string> </key>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_source_payment.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_destination_payment.xml
similarity index 98%
rename from bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_source_payment.xml
rename to bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_destination_payment.xml
index acb8b96408..83d9570c57 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_source_payment.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_destination_payment.xml
@@ -14,7 +14,7 @@
       <dictionary>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>listbox_source_payment</string> </value>
+            <value> <string>listbox_destination_payment</string> </value>
         </item>
         <item>
             <key> <string>message_values</string> </key>
@@ -251,7 +251,7 @@
                 </item>
                 <item>
                     <key> <string>title</string> </key>
-                    <value> <string>listbox_source_payment</string> </value>
+                    <value> <string>Payment</string> </value>
                 </item>
                 <item>
                     <key> <string>unicode</string> </key>
@@ -281,7 +281,7 @@
       <dictionary>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string>python: cell.getObject().AccountingTransaction_getSourcePaymentItemList()</string> </value>
+            <value> <string>python: cell.getObject().AccountingTransaction_getDestinationPaymentItemList()</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_resource.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_resource.xml
index 5a4faea2f9..5962e18565 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_resource.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_resource.xml
@@ -251,7 +251,7 @@
                 </item>
                 <item>
                     <key> <string>title</string> </key>
-                    <value> <string>listbox_resource</string> </value>
+                    <value> <string>Currency</string> </value>
                 </item>
                 <item>
                     <key> <string>unicode</string> </key>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_destination_section_title.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_source_section_title.xml
similarity index 98%
rename from bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_destination_section_title.xml
rename to bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_source_section_title.xml
index 802eb24e6b..5f3374425b 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_destination_section_title.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/listbox_source_section_title.xml
@@ -14,7 +14,7 @@
       <dictionary>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>listbox_destination_section_title</string> </value>
+            <value> <string>listbox_source_section_title</string> </value>
         </item>
         <item>
             <key> <string>message_values</string> </key>
@@ -243,7 +243,7 @@
                 </item>
                 <item>
                     <key> <string>title</string> </key>
-                    <value> <string>listbox_destination_section_title</string> </value>
+                    <value> <string>Third Party</string> </value>
                 </item>
                 <item>
                     <key> <string>truncate</string> </key>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_destination_reference.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_destination_reference.xml
new file mode 100644
index 0000000000..0ddf0ed99f
--- /dev/null
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_destination_reference.xml
@@ -0,0 +1,272 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.Formulator.StandardFields</string>
+          <string>StringField</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>my_destination_reference</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>required_not_found</string> </key>
+                    <value> <string>Input is required but no input given.</string> </value>
+                </item>
+                <item>
+                    <key> <string>too_long</string> </key>
+                    <value> <string>Too much input was 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>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>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</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>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>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</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></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> <int>20</int> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <int>0</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>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Transaction Reference</string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_source_section.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_destination_section.xml
similarity index 99%
rename from bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_source_section.xml
rename to bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_destination_section.xml
index 83be4c20da..523262b9b4 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_source_section.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_destination_section.xml
@@ -14,7 +14,7 @@
       <dictionary>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>my_source_section</string> </value>
+            <value> <string>my_destination_section</string> </value>
         </item>
         <item>
             <key> <string>message_values</string> </key>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_resource.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_resource.xml
new file mode 100644
index 0000000000..d925231ec2
--- /dev/null
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_resource.xml
@@ -0,0 +1,295 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.Formulator.StandardFields</string>
+          <string>ListField</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>my_resource</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>required_not_found</string> </key>
+                    <value> <string>Input is required but no input given.</string> </value>
+                </item>
+                <item>
+                    <key> <string>unknown_selection</string> </key>
+                    <value> <string>You selected an item that was not in the list.</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>extra_item</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>first_item</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>items</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>size</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</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>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>extra_item</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>first_item</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>items</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>size</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</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></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> <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>extra_item</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>first_item</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>items</string> </key>
+                    <value>
+                      <list/>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>size</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Currency</string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.Formulator.TALESField</string>
+          <string>TALESMethod</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string>python:here.CurrencyModule_getCurrencyItemList()</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_translated_portal_type.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_translated_portal_type.xml
new file mode 100644
index 0000000000..8bcaee65b1
--- /dev/null
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_translated_portal_type.xml
@@ -0,0 +1,272 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.Formulator.StandardFields</string>
+          <string>StringField</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>my_translated_portal_type</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>required_not_found</string> </key>
+                    <value> <string>Input is required but no input given.</string> </value>
+                </item>
+                <item>
+                    <key> <string>too_long</string> </key>
+                    <value> <string>Too much input was 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>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>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</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>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>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</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></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> <int>20</int> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <int>0</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>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Transaction Type</string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_translated_simulation_state_title.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_translated_simulation_state_title.xml
new file mode 100644
index 0000000000..d2a9155baa
--- /dev/null
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BalanceTransaction_view/my_translated_simulation_state_title.xml
@@ -0,0 +1,272 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.Formulator.StandardFields</string>
+          <string>StringField</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>my_translated_simulation_state_title</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>required_not_found</string> </key>
+                    <value> <string>Input is required but no input given.</string> </value>
+                </item>
+                <item>
+                    <key> <string>too_long</string> </key>
+                    <value> <string>Too much input was 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>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>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</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>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>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</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></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> <int>20</int> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <int>0</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>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>State</string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/AccountingPeriod_CheckTransactionsState.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/AccountingPeriod_CheckTransactionsState.xml
deleted file mode 100644
index 04ec499673..0000000000
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/AccountingPeriod_CheckTransactionsState.xml
+++ /dev/null
@@ -1,198 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <tuple>
-        <tuple>
-          <string>Products.PythonScripts.PythonScript</string>
-          <string>PythonScript</string>
-        </tuple>
-        <none/>
-      </tuple>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>Python_magic</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>Script_magic</string> </key>
-            <value> <int>3</int> </value>
-        </item>
-        <item>
-            <key> <string>__ac_local_roles__</string> </key>
-            <value>
-              <none/>
-            </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.DCWorkflow.DCWorkflow import ValidationFailed\n
-\n
-closing_period = state_change[\'object\']\n
-portal = closing_period.getPortalObject()\n
-N_ = portal.Base_translateString\n
-accounting_module = portal.accounting_module\n
-valid_states = [\'cancelled\', \'stopped\', \'delivered\']\n
-\n
-start_date = closing_period.getStartDate()\n
-stop_date = closing_period.getStopDate()\n
-\n
-search_params = { \'delivery.start_date\': \'>= %s\' % start_date\n
-                , \'delivery.stop_date\' : \'<= %s\' % stop_date\n
-                , \'simulation_state\'   : [\'draft\', \'planned\', \'confirmed\'] \n
-                }\n
-transaction_list = accounting_module.searchFolder( **search_params )\n
-\n
-organisation_section = closing_period.getParentValue()\n
-for transaction in transaction_list:\n
-  transaction = transaction.getObject()\n
-  # we only take into account transaction that are related to this\n
-  # organisation. \n
-  # FIXME: this approach is not compatible with categories as section.\n
-  # FIXME: and not compatible with 100 000 transactions, but as we only search\n
-  # for draft, planned or confirmed transactions, it should be ok.\n
-  if organisation_section.getUid() in [ transaction.getSourceSectionUid()\n
-                                      , transaction.getDestinationSectionUid()]:\n
-    if transaction.getSimulationState() not in valid_states:\n
-      raise ValidationFailed, N_(\n
-           "Transaction <a href=\'${url}\'>${path}</a> is in invalid state (${state})",\n
-           mapping = { \'url\'  : transaction.absolute_url()\n
-                     , \'path\' : transaction.getPath()\n
-                     , \'state\': unicode(transaction.getTranslatedSimulationStateTitle(), \'utf8\')\n
-                     }\n
-          )\n
-
-
-]]></string> </value>
-        </item>
-        <item>
-            <key> <string>_code</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>_filepath</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>_params</string> </key>
-            <value> <string>state_change</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>1</int> </value>
-                    </item>
-                    <item>
-                        <key> <string>co_varnames</string> </key>
-                        <value>
-                          <tuple>
-                            <string>state_change</string>
-                            <string>Products.DCWorkflow.DCWorkflow</string>
-                            <string>ValidationFailed</string>
-                            <string>_getitem_</string>
-                            <string>closing_period</string>
-                            <string>_getattr_</string>
-                            <string>portal</string>
-                            <string>N_</string>
-                            <string>accounting_module</string>
-                            <string>valid_states</string>
-                            <string>start_date</string>
-                            <string>stop_date</string>
-                            <string>search_params</string>
-                            <string>_apply_</string>
-                            <string>transaction_list</string>
-                            <string>organisation_section</string>
-                            <string>_getiter_</string>
-                            <string>transaction</string>
-                            <string>unicode</string>
-                          </tuple>
-                        </value>
-                    </item>
-                  </dictionary>
-                </state>
-              </object>
-            </value>
-        </item>
-        <item>
-            <key> <string>func_defaults</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>AccountingPeriod_CheckTransactionsState</string> </value>
-        </item>
-        <item>
-            <key> <string>warnings</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/AccountingPeriod_CheckDates.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkDates.xml
similarity index 83%
rename from bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/AccountingPeriod_CheckDates.xml
rename to bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkDates.xml
index 1f8de30d40..907b75e206 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/AccountingPeriod_CheckDates.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkDates.xml
@@ -71,48 +71,43 @@
             <value> <string encoding="cdata"><![CDATA[
 
 from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
+from Products.ERP5Type.Message import Message\n
 \n
 closing_period = state_change[\'object\']\n
 portal = closing_period.getPortalObject()\n
-N_ = portal.Base_translateString\n
-valid_states = [\'planned\', \'confirmed\', \'delivered\']\n
+N_ = lambda msg, **kw: Message(\'erp5_ui\', msg, **kw)\n
+valid_state_list = [\'started\', \'stopped\', \'delivered\']\n
 \n
 start_date = closing_period.getStartDate()\n
 stop_date = closing_period.getStopDate()\n
 \n
-if start_date > stop_date :\n
+if start_date > stop_date:\n
   raise ValidationFailed, N_("Start Date is After Stop Date")\n
 \n
 period_list = closing_period.getParentValue().searchFolder(\n
-                  simulation_state = valid_states,\n
-                  sort_on = [(\'delivery.start_date\', \'asc\')],\n
-                  portal_type = \'Accounting Period\')\n
+                              simulation_state=valid_state_list,\n
+                              sort_on=[(\'delivery.start_date\', \'asc\')],\n
+                              portal_type=\'Accounting Period\')\n
 \n
-for period in period_list :\n
+for period in period_list:\n
   period = period.getObject()\n
-  portal.log("AccountingPeriod_CheckDates", "id:%s start:%s stop:%s" % (\n
-                                period.getId(),\n
-                                period.getStartDate(),\n
-                                period.getStopDate()))\n
-  if period.getSimulationState() in valid_states :\n
-    if start_date <= period.getStopDate() :\n
+  if period.getSimulationState() in valid_state_list:\n
+    if start_date <= period.getStopDate():\n
       raise ValidationFailed, N_(\n
           "${date} is already in an opened accounting period",\n
-          mapping = {\'date\': period.Base_FormatDate(start_date)})\n
+          mapping={\'date\': start_date})\n
           \n
-if len(period_list) > 1 :\n
+if len(period_list) > 1:\n
   last_period  = period_list[-1].getObject()\n
-  if last_period.getId() == closing_period.getId() :\n
+  if last_period.getId() == closing_period.getId():\n
     last_period  = period_list[-2].getObject()\n
   if (start_date - last_period.getStopDate()) > 1:\n
-      raise ValidationFailed, N_(\n
+    raise ValidationFailed, N_(\n
         "Last opened period ends on ${last_openned_date},"+\n
         " this period starts on ${this_period_start_date}."+\n
         " Accounting Periods must be consecutive.",\n
-          mapping = { \'last_openned_date\' :\n
-                        period.Base_FormatDate(last_period.getStopDate()),\n
-                      \'this_period_start_date\' :\n
-                        period.Base_FormatDate(start_date) } )\n
+          mapping = { \'last_openned_date\': last_period.getStopDate(),\n
+                      \'this_period_start_date\': start_date } )\n
 
 
 ]]></string> </value>
@@ -160,12 +155,14 @@ if len(period_list) > 1 :\n
                             <string>state_change</string>
                             <string>Products.DCWorkflow.DCWorkflow</string>
                             <string>ValidationFailed</string>
+                            <string>Products.ERP5Type.Message</string>
+                            <string>Message</string>
                             <string>_getitem_</string>
                             <string>closing_period</string>
                             <string>_getattr_</string>
                             <string>portal</string>
                             <string>N_</string>
-                            <string>valid_states</string>
+                            <string>valid_state_list</string>
                             <string>start_date</string>
                             <string>stop_date</string>
                             <string>period_list</string>
@@ -189,7 +186,7 @@ if len(period_list) > 1 :\n
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>AccountingPeriod_CheckDates</string> </value>
+            <value> <string>checkDates</string> </value>
         </item>
         <item>
             <key> <string>warnings</string> </key>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/AccountingPeriod_DeliverTransactions.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkTransactionsState.xml
similarity index 67%
rename from bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/AccountingPeriod_DeliverTransactions.xml
rename to bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkTransactionsState.xml
index 11ac3120c8..1fad691da8 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/AccountingPeriod_DeliverTransactions.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkTransactionsState.xml
@@ -68,43 +68,41 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string encoding="cdata"><![CDATA[
-
-from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
+            <value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
+from Products.ERP5Type.Message import Message\n
+from Products.ZSQLCatalog.SQLCatalog import Query\n
+from Products.ZSQLCatalog.SQLCatalog import ComplexQuery\n
 \n
-closing_period = state_change[\'object\']\n
-portal = closing_period.getPortalObject()\n
-N_ = portal.Base_translateString\n
-accounting_module = portal.accounting_module\n
-valid_states = [\'cancelled\', \'stopped\']\n
+period = state_change[\'object\']\n
+portal = period.getPortalObject()\n
+N_ = lambda msg, **kw: Message(\'erp5_ui\', msg, **kw)\n
 \n
-start_date = closing_period.getStartDate()\n
-stop_date = closing_period.getStopDate()\n
 \n
-search_params = { \'delivery.start_date\' : \'>= %s\' % start_date,\n
-                                \'delivery.stop_date\'  : \'<= %s\' % stop_date,\n
-                                \'simulation_state\' : \'stopped\' }\n
-transaction_list = accounting_module.searchFolder( **search_params )\n
+valid_simulation_state_list = [\'cancelled\', \'delivered\', \'delivered\']\n
+all_state_list = [x[1] for x in\n
+  portal.Base_getTranslatedWorkflowStateItemList(wf_id=\'accounting_workflow\')]\n
+invalid_simulation_state_list = [state for state in all_state_list\n
+                                 if state not in valid_simulation_state_list]\n
 \n
-comment=N_("Closing period ${period_title}",\n
-                    mapping={\'period_title\': unicode(closing_period.getTitle(), \'utf8\')})\n
+section_uid = period.getParentUid()\n
+search_params = {\n
+  \'delivery.start_date\': dict(query=period.getStartDate(),\n
+                              range=\'min\'),\n
+  \'delivery.stop_date\': dict(query=period.getStopDate(),\n
+                             range=\'ngt\'),\n
+  \'simulation_state\': invalid_simulation_state_list,\n
+  \'portal_type\': portal.getPortalAccountingTransactionTypeList(),\n
+  \'query\': ComplexQuery(Query(source_section_uid=section_uid),\n
+                        Query(destination_section_uid=section_uid),\n
+                        operator=\'OR\')\n
+}\n
 \n
-section_uid = closing_period.getParentValue().getUid()\n
-for transaction in transaction_list :\n
-  transaction = transaction.getObject()\n
-  # FIXME: this approach is not compatible with categories as sections.\n
-  if transaction.getSourceSectionUid() == section_uid or \\\n
-             transaction.getDestinationSectionUid() == section_uid :\n
-    transaction.activate().AccountingTransaction_closeByAccountingPeriod(\n
-               comment = comment, closing_period_path = closing_period.getPath() )\n
-\n
-# if a transaction validation fails, it puts the Closing Period object back to confirmed state\n
-closing_period.activate( \n
-         after_method_id = [\'AccountingTransaction_closeByAccountingPeriod\']\n
-    ).deliver()\n
-
-
-]]></string> </value>
+transaction_list = portal.portal_catalog.searchResults(**search_params)\n
+if transaction_list:\n
+  raise ValidationFailed, N_(\n
+    "All Accounting Transactions for this organisation during the period have"\n
+    " to be closed first")\n
+</string> </value>
         </item>
         <item>
             <key> <string>_code</string> </key>
@@ -149,23 +147,29 @@ closing_period.activate( \n
                             <string>state_change</string>
                             <string>Products.DCWorkflow.DCWorkflow</string>
                             <string>ValidationFailed</string>
+                            <string>Products.ERP5Type.Message</string>
+                            <string>Message</string>
+                            <string>Products.ZSQLCatalog.SQLCatalog</string>
+                            <string>Query</string>
+                            <string>ComplexQuery</string>
                             <string>_getitem_</string>
-                            <string>closing_period</string>
+                            <string>period</string>
                             <string>_getattr_</string>
                             <string>portal</string>
                             <string>N_</string>
-                            <string>accounting_module</string>
-                            <string>valid_states</string>
-                            <string>start_date</string>
-                            <string>stop_date</string>
+                            <string>valid_simulation_state_list</string>
+                            <string>append</string>
+                            <string>$append0</string>
+                            <string>_getiter_</string>
+                            <string>x</string>
+                            <string>all_state_list</string>
+                            <string>state</string>
+                            <string>invalid_simulation_state_list</string>
+                            <string>section_uid</string>
+                            <string>dict</string>
                             <string>search_params</string>
                             <string>_apply_</string>
                             <string>transaction_list</string>
-                            <string>unicode</string>
-                            <string>comment</string>
-                            <string>section_uid</string>
-                            <string>_getiter_</string>
-                            <string>transaction</string>
                           </tuple>
                         </value>
                     </item>
@@ -182,7 +186,7 @@ closing_period.activate( \n
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>AccountingPeriod_DeliverTransactions</string> </value>
+            <value> <string>checkTransactionsState</string> </value>
         </item>
         <item>
             <key> <string>warnings</string> </key>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_closeByAccountingPeriod.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/createBalanceTransaction.xml
similarity index 69%
rename from bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_closeByAccountingPeriod.xml
rename to bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/createBalanceTransaction.xml
index 1be1052cec..eeae2c5e59 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_closeByAccountingPeriod.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/createBalanceTransaction.xml
@@ -68,25 +68,17 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>"""Deliver the transaction and \'notify\' the closing_period on failure."""\n
+            <value> <string>"""Create a balance transaction\n
+"""\n
+from DateTime import DateTime\n
 \n
-from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
-N_ = context.Base_translateString\n
+accounting_period = sci[\'object\']\n
+portal = accounting_period.getPortalObject()\n
+profit_and_loss_account = portal.portal_workflow.getInfoFor(\n
+                            accounting_period, \'profit_and_loss_account\')\n
 \n
-try : \n
-  context.portal_workflow.doActionFor( context,\n
-                     \'deliver_action\', \n
-                     skip_period_validation = 1,\n
-                     comment=comment )\n
-except ValidationFailed, message :\n
-  closing_period = context.getPortalObject().restrictedTraverse(closing_period_path)\n
-  if closing_period.getSimulationState() != \'confirmed\' :\n
-    closing_period.failClosing()\n
-    closing_period.portal_workflow.doActionFor( closing_period,\n
-                     \'edit_action\', \n
-                     comment=N_(\'unable to deliver ${transaction_path} : ${error_message}\',\n
-                       mapping={\'transaction_path\':context.getPath(),\n
-                                          \'error_message\': unicode(str(message), \'utf8\') } ))\n
+accounting_period.AccountingPeriod_createBalanceTransaction(\n
+                       profit_and_loss_account=profit_and_loss_account)\n
 </string> </value>
         </item>
         <item>
@@ -101,9 +93,15 @@ except ValidationFailed, message :\n
               <none/>
             </value>
         </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>comment, closing_period_path, **kw</string> </value>
+            <value> <string>sci</string> </value>
         </item>
         <item>
             <key> <string>errors</string> </key>
@@ -123,24 +121,19 @@ except ValidationFailed, message :\n
                   <dictionary>
                     <item>
                         <key> <string>co_argcount</string> </key>
-                        <value> <int>2</int> </value>
+                        <value> <int>1</int> </value>
                     </item>
                     <item>
                         <key> <string>co_varnames</string> </key>
                         <value>
                           <tuple>
-                            <string>comment</string>
-                            <string>closing_period_path</string>
-                            <string>kw</string>
-                            <string>Products.DCWorkflow.DCWorkflow</string>
-                            <string>ValidationFailed</string>
+                            <string>sci</string>
+                            <string>DateTime</string>
+                            <string>_getitem_</string>
+                            <string>accounting_period</string>
                             <string>_getattr_</string>
-                            <string>context</string>
-                            <string>N_</string>
-                            <string>message</string>
-                            <string>closing_period</string>
-                            <string>unicode</string>
-                            <string>str</string>
+                            <string>portal</string>
+                            <string>profit_and_loss_account</string>
                           </tuple>
                         </value>
                     </item>
@@ -157,7 +150,7 @@ except ValidationFailed, message :\n
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>AccountingTransaction_closeByAccountingPeriod</string> </value>
+            <value> <string>createBalanceTransaction</string> </value>
         </item>
         <item>
             <key> <string>warnings</string> </key>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/cancelled.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/cancelled.xml
index dcc0270e1b..b0a1b7245c 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/cancelled.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/cancelled.xml
@@ -20,7 +20,7 @@
         </item>
         <item>
             <key> <string>description</string> </key>
-            <value> <string></string> </value>
+            <value> <string>The Accounting Period is cancelled, a new one should be defined.</string> </value>
         </item>
         <item>
             <key> <string>id</string> </key>
@@ -42,6 +42,12 @@
               <tuple/>
             </value>
         </item>
+        <item>
+            <key> <string>type_list</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
       </dictionary>
     </pickle>
   </record>
@@ -77,9 +83,7 @@
                 <item>
                     <key> <string>Modify portal content</string> </key>
                     <value>
-                      <tuple>
-                        <string>Manager</string>
-                      </tuple>
+                      <tuple/>
                     </value>
                 </item>
                 <item>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/closing.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/closing.xml
deleted file mode 100644
index 2fc159849d..0000000000
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/closing.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <tuple>
-        <tuple>
-          <string>Products.DCWorkflow.States</string>
-          <string>StateDefinition</string>
-        </tuple>
-        <none/>
-      </tuple>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__ac_local_roles__</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>description</string> </key>
-            <value> <string>Closing is the state used when the activity of delivering transaction happens.</string> </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>closing</string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string>Closing</string> </value>
-        </item>
-        <item>
-            <key> <string>transitions</string> </key>
-            <value>
-              <tuple>
-                <string>deliver</string>
-                <string>fail_closing</string>
-              </tuple>
-            </value>
-        </item>
-        <item>
-            <key> <string>type_list</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/delivered.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/delivered.xml
index b6120497b7..f2fa553a55 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/delivered.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/delivered.xml
@@ -20,7 +20,9 @@
         </item>
         <item>
             <key> <string>description</string> </key>
-            <value> <string></string> </value>
+            <value> <string>The Accounting Period is closed.\r\n
+\r\n
+It is no longer possible to add accounting transactions in this period. A balance transaction has been created.</string> </value>
         </item>
         <item>
             <key> <string>id</string> </key>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/draft.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/draft.xml
index c5e92fc8aa..cec29bb560 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/draft.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/draft.xml
@@ -20,7 +20,7 @@
         </item>
         <item>
             <key> <string>description</string> </key>
-            <value> <string></string> </value>
+            <value> <string>The Accounting Period is not openned yet.</string> </value>
         </item>
         <item>
             <key> <string>id</string> </key>
@@ -42,11 +42,17 @@
               <tuple>
                 <string>cancel</string>
                 <string>cancel_action</string>
-                <string>plan</string>
-                <string>plan_action</string>
+                <string>start</string>
+                <string>start_action</string>
               </tuple>
             </value>
         </item>
+        <item>
+            <key> <string>type_list</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
       </dictionary>
     </pickle>
   </record>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/confirmed.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/started.xml
similarity index 84%
rename from bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/confirmed.xml
rename to bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/started.xml
index 39d8f0b656..2e3c03d36f 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/confirmed.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/started.xml
@@ -18,13 +18,21 @@
               <none/>
             </value>
         </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
         <item>
             <key> <string>description</string> </key>
-            <value> <string></string> </value>
+            <value> <string>The Accounting Period is openned.\r\n
+\r\n
+It is therefore possible to post accounting accounting transactions with dates during this period.</string> </value>
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>confirmed</string> </value>
+            <value> <string>started</string> </value>
         </item>
         <item>
             <key> <string>permission_roles</string> </key>
@@ -34,16 +42,14 @@
         </item>
         <item>
             <key> <string>title</string> </key>
-            <value> <string>Temporally Closed Accounting Period</string> </value>
+            <value> <string>Openned</string> </value>
         </item>
         <item>
             <key> <string>transitions</string> </key>
             <value>
               <tuple>
-                <string>close</string>
-                <string>close_action</string>
-                <string>plan</string>
-                <string>reopen_action</string>
+                <string>stop</string>
+                <string>stop_action</string>
               </tuple>
             </value>
         </item>
@@ -80,7 +86,6 @@
                         <string>Assignor</string>
                         <string>Associate</string>
                         <string>Auditor</string>
-                        <string>Author</string>
                         <string>Manager</string>
                       </tuple>
                     </value>
@@ -99,9 +104,7 @@
                         <string>Assignor</string>
                         <string>Associate</string>
                         <string>Auditor</string>
-                        <string>Author</string>
                         <string>Manager</string>
-                        <string>Member</string>
                       </tuple>
                     </value>
                 </item>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/planned.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/stopped.xml
similarity index 82%
rename from bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/planned.xml
rename to bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/stopped.xml
index 6267aa113b..af926ffc0d 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/planned.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/states/stopped.xml
@@ -18,13 +18,20 @@
               <none/>
             </value>
         </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
         <item>
             <key> <string>description</string> </key>
-            <value> <string></string> </value>
+            <value> <string>The Accounting Period is temporary closed, but can be openned back.\r\n
+In this state it is not possible to post transactions during this period.</string> </value>
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>planned</string> </value>
+            <value> <string>stopped</string> </value>
         </item>
         <item>
             <key> <string>permission_roles</string> </key>
@@ -34,14 +41,16 @@
         </item>
         <item>
             <key> <string>title</string> </key>
-            <value> <string>Open</string> </value>
+            <value> <string>Temporary Closed</string> </value>
         </item>
         <item>
             <key> <string>transitions</string> </key>
             <value>
               <tuple>
-                <string>confirm</string>
-                <string>confirm_action</string>
+                <string>deliver</string>
+                <string>deliver_action</string>
+                <string>restart_action</string>
+                <string>start</string>
               </tuple>
             </value>
         </item>
@@ -78,7 +87,6 @@
                         <string>Assignor</string>
                         <string>Associate</string>
                         <string>Auditor</string>
-                        <string>Author</string>
                         <string>Manager</string>
                       </tuple>
                     </value>
@@ -97,9 +105,7 @@
                         <string>Assignor</string>
                         <string>Associate</string>
                         <string>Auditor</string>
-                        <string>Author</string>
                         <string>Manager</string>
-                        <string>Member</string>
                       </tuple>
                     </value>
                 </item>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/cancel_action.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/cancel_action.xml
index 4382c19ef6..d300f348a2 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/cancel_action.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/cancel_action.xml
@@ -84,7 +84,6 @@
             <value>
               <tuple>
                 <string>Assignor</string>
-                <string>Manager</string>
                 <string>Owner</string>
               </tuple>
             </value>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/close.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/close.xml
deleted file mode 100644
index bf8d257ad8..0000000000
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/close.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <tuple>
-        <tuple>
-          <string>Products.DCWorkflow.Transitions</string>
-          <string>TransitionDefinition</string>
-        </tuple>
-        <none/>
-      </tuple>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__ac_local_roles__</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>actbox_category</string> </key>
-            <value> <string>workflow</string> </value>
-        </item>
-        <item>
-            <key> <string>actbox_name</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>actbox_url</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>after_script_name</string> </key>
-            <value> <string>AccountingPeriod_DeliverTransactions</string> </value>
-        </item>
-        <item>
-            <key> <string>description</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>guard</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>close</string> </value>
-        </item>
-        <item>
-            <key> <string>new_state_id</string> </key>
-            <value> <string>closing</string> </value>
-        </item>
-        <item>
-            <key> <string>script_name</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>trigger_type</string> </key>
-            <value> <int>2</int> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/deliver.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/deliver.xml
index 3eeba3f51f..eb7b3cf974 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/deliver.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/deliver.xml
@@ -32,7 +32,7 @@
         </item>
         <item>
             <key> <string>after_script_name</string> </key>
-            <value> <string></string> </value>
+            <value> <string>createBalanceTransaction</string> </value>
         </item>
         <item>
             <key> <string>description</string> </key>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/close_action.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/deliver_action.xml
similarity index 58%
rename from bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/close_action.xml
rename to bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/deliver_action.xml
index 6a1343c51a..e770a20d0c 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/close_action.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/deliver_action.xml
@@ -18,6 +18,12 @@
               <none/>
             </value>
         </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
         <item>
             <key> <string>actbox_category</string> </key>
             <value> <string>workflow</string> </value>
@@ -28,25 +34,25 @@
         </item>
         <item>
             <key> <string>actbox_url</string> </key>
-            <value> <string>%(content_url)s/Base_viewWorkflowActionDialog?workflow_action=close_action</string> </value>
+            <value> <string>%(content_url)s/AccountingPeriod_viewDeliverWorkflowActionDialog?workflow_action=deliver_action</string> </value>
         </item>
         <item>
             <key> <string>after_script_name</string> </key>
-            <value> <string>close</string> </value>
+            <value> <string>deliver</string> </value>
         </item>
         <item>
             <key> <string>description</string> </key>
-            <value> <string>Closing accounting period is made in an activity. if it fails, the Accounting Period object remains in confirmed state, otherwise it goes to delivered state, depending on the result of passing workflow transitions.</string> </value>
+            <value> <string></string> </value>
         </item>
         <item>
             <key> <string>guard</string> </key>
             <value>
-              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+              <none/>
             </value>
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>close_action</string> </value>
+            <value> <string>deliver_action</string> </value>
         </item>
         <item>
             <key> <string>new_state_id</string> </key>
@@ -54,7 +60,7 @@
         </item>
         <item>
             <key> <string>script_name</string> </key>
-            <value> <string></string> </value>
+            <value> <string>checkTransactionsState</string> </value>
         </item>
         <item>
             <key> <string>title</string> </key>
@@ -64,6 +70,12 @@
             <key> <string>trigger_type</string> </key>
             <value> <int>1</int> </value>
         </item>
+        <item>
+            <key> <string>var_exprs</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
       </dictionary>
     </pickle>
   </record>
@@ -71,8 +83,8 @@
     <pickle>
       <tuple>
         <tuple>
-          <string>Products.DCWorkflow.Guard</string>
-          <string>Guard</string>
+          <string>Persistence</string>
+          <string>PersistentMapping</string>
         </tuple>
         <none/>
       </tuple>
@@ -80,15 +92,38 @@
     <pickle>
       <dictionary>
         <item>
-            <key> <string>roles</string> </key>
+            <key> <string>_container</string> </key>
             <value>
-              <tuple>
-                <string>Assignor</string>
-                <string>Manager</string>
-              </tuple>
+              <dictionary>
+                <item>
+                    <key> <string>profit_and_loss_account</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+                    </value>
+                </item>
+              </dictionary>
             </value>
         </item>
       </dictionary>
     </pickle>
   </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.CMFCore.Expression</string>
+          <string>Expression</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>kwargs/profit_and_loss_account | nothing</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
 </ZopeData>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/fail_closing.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/fail_closing.xml
deleted file mode 100644
index 96eda90e69..0000000000
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/fail_closing.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <tuple>
-        <tuple>
-          <string>Products.DCWorkflow.Transitions</string>
-          <string>TransitionDefinition</string>
-        </tuple>
-        <none/>
-      </tuple>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__ac_local_roles__</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>actbox_category</string> </key>
-            <value> <string>workflow</string> </value>
-        </item>
-        <item>
-            <key> <string>actbox_name</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>actbox_url</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>after_script_name</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>description</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>guard</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>fail_closing</string> </value>
-        </item>
-        <item>
-            <key> <string>new_state_id</string> </key>
-            <value> <string>confirmed</string> </value>
-        </item>
-        <item>
-            <key> <string>script_name</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>trigger_type</string> </key>
-            <value> <int>2</int> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/reopen_action.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/restart_action.xml
similarity index 92%
rename from bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/reopen_action.xml
rename to bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/restart_action.xml
index 32316a8316..78b99d40eb 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/reopen_action.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/restart_action.xml
@@ -28,11 +28,11 @@
         </item>
         <item>
             <key> <string>actbox_url</string> </key>
-            <value> <string>%(content_url)s/Base_viewWorkflowActionDialog?workflow_action=reopen_action</string> </value>
+            <value> <string>%(content_url)s/Base_viewWorkflowActionDialog?workflow_action=restart_action</string> </value>
         </item>
         <item>
             <key> <string>after_script_name</string> </key>
-            <value> <string>plan</string> </value>
+            <value> <string></string> </value>
         </item>
         <item>
             <key> <string>description</string> </key>
@@ -46,11 +46,11 @@
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>reopen_action</string> </value>
+            <value> <string>restart_action</string> </value>
         </item>
         <item>
             <key> <string>new_state_id</string> </key>
-            <value> <string></string> </value>
+            <value> <string>started</string> </value>
         </item>
         <item>
             <key> <string>script_name</string> </key>
@@ -84,7 +84,6 @@
             <value>
               <tuple>
                 <string>Assignor</string>
-                <string>Manager</string>
               </tuple>
             </value>
         </item>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/confirm.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/start.xml
similarity index 94%
rename from bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/confirm.xml
rename to bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/start.xml
index 3bd201c433..0a789f067e 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/confirm.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/start.xml
@@ -46,11 +46,11 @@
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>confirm</string> </value>
+            <value> <string>start</string> </value>
         </item>
         <item>
             <key> <string>new_state_id</string> </key>
-            <value> <string>confirmed</string> </value>
+            <value> <string>started</string> </value>
         </item>
         <item>
             <key> <string>script_name</string> </key>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/plan_action.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/start_action.xml
similarity index 89%
rename from bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/plan_action.xml
rename to bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/start_action.xml
index 15df35d256..ea1f57918e 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/plan_action.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/start_action.xml
@@ -28,11 +28,11 @@
         </item>
         <item>
             <key> <string>actbox_url</string> </key>
-            <value> <string>%(content_url)s/Base_viewWorkflowActionDialog?workflow_action=plan_action</string> </value>
+            <value> <string>%(content_url)s/Base_viewWorkflowActionDialog?workflow_action=start_action</string> </value>
         </item>
         <item>
             <key> <string>after_script_name</string> </key>
-            <value> <string>plan</string> </value>
+            <value> <string>start</string> </value>
         </item>
         <item>
             <key> <string>description</string> </key>
@@ -46,7 +46,7 @@
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>plan_action</string> </value>
+            <value> <string>start_action</string> </value>
         </item>
         <item>
             <key> <string>new_state_id</string> </key>
@@ -54,7 +54,7 @@
         </item>
         <item>
             <key> <string>script_name</string> </key>
-            <value> <string>AccountingPeriod_CheckDates</string> </value>
+            <value> <string>checkDates</string> </value>
         </item>
         <item>
             <key> <string>title</string> </key>
@@ -84,7 +84,6 @@
             <value>
               <tuple>
                 <string>Assignor</string>
-                <string>Manager</string>
               </tuple>
             </value>
         </item>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/plan.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/stop.xml
similarity index 94%
rename from bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/plan.xml
rename to bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/stop.xml
index 00c5477576..bfeb37c774 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/plan.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/stop.xml
@@ -46,11 +46,11 @@
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>plan</string> </value>
+            <value> <string>stop</string> </value>
         </item>
         <item>
             <key> <string>new_state_id</string> </key>
-            <value> <string>planned</string> </value>
+            <value> <string>stopped</string> </value>
         </item>
         <item>
             <key> <string>script_name</string> </key>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/confirm_action.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/stop_action.xml
similarity index 86%
rename from bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/confirm_action.xml
rename to bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/stop_action.xml
index 07089eefed..dc075d16f2 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/confirm_action.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/transitions/stop_action.xml
@@ -24,15 +24,15 @@
         </item>
         <item>
             <key> <string>actbox_name</string> </key>
-            <value> <string>Temporally Close Accounting Period</string> </value>
+            <value> <string>Temporary Close Accounting Period</string> </value>
         </item>
         <item>
             <key> <string>actbox_url</string> </key>
-            <value> <string>%(content_url)s/Base_viewWorkflowActionDialog?workflow_action=confirm_action</string> </value>
+            <value> <string>%(content_url)s/Base_viewWorkflowActionDialog?workflow_action=stop_action</string> </value>
         </item>
         <item>
             <key> <string>after_script_name</string> </key>
-            <value> <string>confirm</string> </value>
+            <value> <string>stop</string> </value>
         </item>
         <item>
             <key> <string>description</string> </key>
@@ -46,7 +46,7 @@
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>confirm_action</string> </value>
+            <value> <string>stop_action</string> </value>
         </item>
         <item>
             <key> <string>new_state_id</string> </key>
@@ -54,7 +54,7 @@
         </item>
         <item>
             <key> <string>script_name</string> </key>
-            <value> <string>AccountingPeriod_CheckTransactionsState</string> </value>
+            <value> <string>checkTransactionsState</string> </value>
         </item>
         <item>
             <key> <string>title</string> </key>
@@ -84,7 +84,6 @@
             <value>
               <tuple>
                 <string>Assignor</string>
-                <string>Manager</string>
               </tuple>
             </value>
         </item>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/variables/zz.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/variables/profit_and_loss_account.xml
similarity index 69%
rename from bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/variables/zz.xml
rename to bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/variables/profit_and_loss_account.xml
index 138f7f52d5..f5d19399bb 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/variables/zz.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/variables/profit_and_loss_account.xml
@@ -18,15 +18,21 @@
               <none/>
             </value>
         </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
         <item>
             <key> <string>default_expr</string> </key>
             <value>
-              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+              <none/>
             </value>
         </item>
         <item>
             <key> <string>default_value</string> </key>
-            <value> <string>Associate</string> </value>
+            <value> <string></string> </value>
         </item>
         <item>
             <key> <string>description</string> </key>
@@ -38,11 +44,11 @@
         </item>
         <item>
             <key> <string>for_status</string> </key>
-            <value> <int>0</int> </value>
+            <value> <int>1</int> </value>
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>zz</string> </value>
+            <value> <string>profit_and_loss_account</string> </value>
         </item>
         <item>
             <key> <string>info_guard</string> </key>
@@ -52,26 +58,7 @@
         </item>
         <item>
             <key> <string>update_always</string> </key>
-            <value> <int>1</int> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-  <record id="2" aka="AAAAAAAAAAI=">
-    <pickle>
-      <tuple>
-        <tuple>
-          <string>Products.CMFCore.Expression</string>
-          <string>Expression</string>
-        </tuple>
-        <none/>
-      </tuple>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>text</string> </key>
-            <value> <string>python:[\'Order Assignee\', \'Invoice Assignee\']</string> </value>
+            <value> <int>0</int> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransaction.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransaction.xml
index 5ffb27c2c9..ca79eee73d 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransaction.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransaction.xml
@@ -79,7 +79,7 @@ from Products.ERP5Type.Message import Message\n
 transaction = state_change[\'object\']\n
 N_ = lambda msg, **kw: Message(\'erp5_ui\', msg, **kw)\n
 \n
-# do we have to check transaction is in openned periods ?\n
+# do we have to check transaction is in openned periods ? \n
 skip_period_validation = state_change[\'kwargs\'].get(\n
                               \'skip_period_validation\', 0)\n
 transition = state_change[\'transition\']\n
@@ -94,36 +94,34 @@ check_destination = (transaction.getPortalType() in\n
 source_section = transaction.getSourceSectionValue(\n
                        portal_type=[\'Organisation\', \'Person\'])\n
 if source_section is None:\n
-  raise ValidationFailed(\'Source Section is not Defined.\')\n
+  raise ValidationFailed(N_(\'Source Section is not Defined.\'))\n
 \n
 destination_section = transaction.getDestinationSectionValue(\n
                 portal_type=[\'Organisation\', \'Person\'])\n
 # if it\'s not an invoice, then we can validate without destination\n
 if destination_section is None and check_destination :\n
-  raise ValidationFailed(\'Destination Section is not Defined.\')\n
+  raise ValidationFailed(N_(\'Destination Section is not Defined.\'))\n
 \n
 currency = transaction.getResource(portal_type = \'Currency\')\n
 if not currency :\n
-  raise ValidationFailed(\'Currency is not Defined.\')\n
+  raise ValidationFailed(N_(\'Currency is not Defined.\'))\n
 \n
 # XXX manually default start date to stop date\n
 if not transaction.getStartDate() and transaction.getStopDate():\n
   transaction.setStartDate(transaction.getStopDate())\n
 \n
 if not transaction.getStartDate() :\n
-  raise ValidationFailed(\'Date is not Defined\')\n
+  raise ValidationFailed(N_(\'Date is not Defined\'))\n
 else:\n
   if not skip_period_validation :\n
     valid_date = False\n
     # check the date is in an opened period\n
-    transaction_date = DateTime( transaction.getStartDate().year(),\n
-                                 transaction.getStartDate().month(),\n
-                                 transaction.getStartDate().day(),\n
-                                 # we don\'t care about hour:minutes\n
-                               )\n
+    transaction_date = transaction.getStartDate().earliestTime()\n
+\n
     openned_accounting_period_list = source_section.searchFolder(\n
-                               portal_type = "Accounting Period",\n
-                               simulation_state = "planned")\n
+                               portal_type="Accounting Period",\n
+                               # planned is for b/w compatibility\n
+                               simulation_state=("planned", \'started\'))\n
     if len(openned_accounting_period_list) == 0 :\n
       # if the entity doesn\'t have any accounting period, we can\n
       # consider that they do not want to use accounting periods or\n
@@ -134,19 +132,15 @@ else:\n
       if apd.getStartDate().Date() <= transaction_date.Date() <= apd.getStopDate().Date():\n
         valid_date = True\n
     if not valid_date :\n
-      raise ValidationFailed("Date is not in an openned Accounting Period "\n
-                             "for source section")\n
+      raise ValidationFailed(N_("Date is not in an opened Accounting Period "\n
+                                "for source section"))\n
     # do the same for destination section \n
     if check_destination :\n
       valid_date = False\n
-      transaction_date = DateTime( transaction.getStopDate().year(),\n
-                                   transaction.getStopDate().month(),\n
-                                   transaction.getStopDate().day(),\n
-                                   # we don\'t care about hour:minutes\n
-                                 )\n
+      transaction_date = transaction.getStopDate().earliestTime()\n
       openned_accounting_period_list = destination_section.searchFolder(\n
                                  portal_type = "Accounting Period",\n
-                                 simulation_state = "planned")\n
+                                 simulation_state = (\'planned\', \'started\'))\n
       if len(openned_accounting_period_list) == 0:\n
         valid_date = True\n
       for apd in openned_accounting_period_list:\n
@@ -154,8 +148,8 @@ else:\n
         if apd.getStartDate().Date() <= transaction_date.Date() <= apd.getStopDate().Date():\n
           valid_date = True\n
       if not valid_date :\n
-        raise ValidationFailed("Date is not in an openned Accounting Period "\n
-                               "for destination section")\n
+        raise ValidationFailed(N_("Date is not in an opened Accounting Period "\n
+                                  "for destination section"))\n
 
 
 ]]></string> </value>
@@ -236,7 +230,6 @@ else:\n
                             <string>currency</string>
                             <string>False</string>
                             <string>valid_date</string>
-                            <string>DateTime</string>
                             <string>transaction_date</string>
                             <string>openned_accounting_period_list</string>
                             <string>len</string>
diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision
index a99c3866eb..c4c828bd4e 100644
--- a/bt5/erp5_accounting/bt/revision
+++ b/bt5/erp5_accounting/bt/revision
@@ -1 +1 @@
-380
\ No newline at end of file
+386
\ No newline at end of file
-- 
2.30.9