diff --git a/bt5/erp5_banking_cash/PortalTypePropertySheetTemplateItem/property_sheet_list.xml b/bt5/erp5_banking_cash/PortalTypePropertySheetTemplateItem/property_sheet_list.xml index 83c9c24e0ca702f741f3a92e6245b418deaec19f..7bae9b8f5b9d6b07895d374259ab969119a8c4ad 100644 --- a/bt5/erp5_banking_cash/PortalTypePropertySheetTemplateItem/property_sheet_list.xml +++ b/bt5/erp5_banking_cash/PortalTypePropertySheetTemplateItem/property_sheet_list.xml @@ -12,6 +12,7 @@ <item>Amount</item> </portal_type> <portal_type id="Cash Movement"> + <item>CashMovement</item> <item>Price</item> </portal_type> <portal_type id="Cash Sorting"> diff --git a/bt5/erp5_banking_cash/PropertySheetTemplateItem/CashMovement.py b/bt5/erp5_banking_cash/PropertySheetTemplateItem/CashMovement.py new file mode 100644 index 0000000000000000000000000000000000000000..f844fc92f9c387c55f9eb68906fe48b67e815eb4 --- /dev/null +++ b/bt5/erp5_banking_cash/PropertySheetTemplateItem/CashMovement.py @@ -0,0 +1,40 @@ +############################################################################## +# +# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved. +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +class CashMovement: + """ + PropertySheetTemplate properties for all ERP5 objects + """ + + _properties = ( + { 'id' : 'currency_handover', + 'description' : 'If we send currency ressources outside', + 'type' : 'boolean', + 'mode' : 'w' }, + ) + + diff --git a/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashMovement_view.xml b/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashMovement_view.xml index 0c37c0c81fc48477ac65031b7bd755b7fafc4899..5230c2bb0bb956b6d637c5099a90ae5a5e57fa16 100644 --- a/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashMovement_view.xml +++ b/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashMovement_view.xml @@ -110,6 +110,7 @@ <string>my_source</string> <string>my_resource</string> <string>my_source_total_asset_price</string> + <string>my_currency_handover</string> </list> </value> </item> diff --git a/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashMovement_view/my_currency_handover.xml b/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashMovement_view/my_currency_handover.xml new file mode 100644 index 0000000000000000000000000000000000000000..b7a293d30cc945689f6bf9b6babfa7b3b01721eb --- /dev/null +++ b/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashMovement_view/my_currency_handover.xml @@ -0,0 +1,177 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="CheckBoxField" module="Products.Formulator.StandardFields"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_owner</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>my_currency_handover</string> </value> + </item> + <item> + <key> <string>message_values</string> </key> + <value> + <dictionary> + <item> + <key> <string>external_validator_failed</string> </key> + <value> <string>The input failed the external validator.</string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>overrides</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Currency Handover</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_movement_workflow/scripts/validateDestinationCounterDate.xml b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_movement_workflow/scripts/validateDestinationCounterDate.xml index 92c2cdd4a4b1c64caa6e0a90f4fee66481e808fa..bed5ea05f12ded795e63fda8b4561dc5e7be9dca 100644 --- a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_movement_workflow/scripts/validateDestinationCounterDate.xml +++ b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_movement_workflow/scripts/validateDestinationCounterDate.xml @@ -72,8 +72,9 @@ transaction = state_change[\'object\']\n \n vaultDestination = transaction.getDestination()\n \n -# check again that we are in the good accounting date in site destination\n -transaction.Baobab_checkCounterDateOpen(site=vaultDestination, date=transaction.getStopDate())\n +if not transaction.isCurrencyHandover():\n + # check again that we are in the good accounting date in site destination\n + transaction.Baobab_checkCounterDateOpen(site=vaultDestination, date=transaction.getStopDate())\n </string> </value> </item> <item> diff --git a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_movement_workflow/scripts/validateVaultBalance.xml b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_movement_workflow/scripts/validateVaultBalance.xml index 33fdd5fb928ff5d69ecfb76e03b2fee9bf2544b8..f71928b63293d8d8dc39f4dc77e2cbc1a99762c4 100644 --- a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_movement_workflow/scripts/validateVaultBalance.xml +++ b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_movement_workflow/scripts/validateVaultBalance.xml @@ -75,6 +75,19 @@ transaction = state_change[\'object\']\n vault = transaction.getSource()\n vaultDestination = transaction.getDestination()\n \n +if transaction.isCurrencyHandover() and vaultDestination is not None:\n + msg = Message(domain="ui", \n + message="Sorry, you must not set a destination in case of currency handover.")\n + raise ValidationFailed, (msg,)\n +\n +if vault is None:\n + msg = Message(domain="ui", \n + message="Sorry, you must define a source.")\n + raise ValidationFailed, (msg,)\n +\n +if not transaction.isCurrencyHandover() and vaultDestination is not None:\n + msg = Message(domain="ui", \n + message="Sorry, you must define a destination.")\n \n # use of the constraint : Test source and destination\n vliste = transaction.checkConsistency()\n @@ -164,17 +177,17 @@ elif resource <> 0 :\n <string>_getattr_</string> <string>vault</string> <string>vaultDestination</string> + <string>None</string> + <string>msg</string> <string>vliste</string> <string>len</string> <string>portal_type_with_no_space</string> <string>getattr</string> - <string>None</string> <string>check_path_script</string> <string>message</string> <string>resource</string> <string>amount</string> <string>total_price</string> - <string>msg</string> </tuple> </value> </item> diff --git a/bt5/erp5_banking_cash/bt/revision b/bt5/erp5_banking_cash/bt/revision index 9d3f41701a871134f2381d2782da8d0ba0d63bbf..2da432533140eaf6c69faa66982fee3287473121 100644 --- a/bt5/erp5_banking_cash/bt/revision +++ b/bt5/erp5_banking_cash/bt/revision @@ -1 +1 @@ -455 \ No newline at end of file +457 \ No newline at end of file diff --git a/bt5/erp5_banking_cash/bt/template_portal_type_property_sheet_list b/bt5/erp5_banking_cash/bt/template_portal_type_property_sheet_list index 742cb2119410e7d91dab0c22a8f819051291aefb..92606521b3bdd3dd983d95fdb7df353cc02a5df5 100644 --- a/bt5/erp5_banking_cash/bt/template_portal_type_property_sheet_list +++ b/bt5/erp5_banking_cash/bt/template_portal_type_property_sheet_list @@ -6,6 +6,7 @@ Cash Exchange | Amount Cash Exchange | Price Cash Exchange | Resource Cash Exchange | Simulation +Cash Movement | CashMovement Cash Movement | Price Cash Sorting | Price Cash To Currency Purchase | Amount diff --git a/bt5/erp5_banking_cash/bt/template_property_sheet_id_list b/bt5/erp5_banking_cash/bt/template_property_sheet_id_list index 6021703f42d90857289ab3341233331370d928e7..625ee8cab562c195924142dc911911a2741e8be5 100644 --- a/bt5/erp5_banking_cash/bt/template_property_sheet_id_list +++ b/bt5/erp5_banking_cash/bt/template_property_sheet_id_list @@ -1 +1,2 @@ -MonetaryDestruction \ No newline at end of file +MonetaryDestruction +CashMovement \ No newline at end of file