diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getAccountForSite.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getAccountForSite.xml index a4e439e0b268f3200b0bed45c8206547e6fe324d..36155781fb0d92fc4be6ede661795e563d94f3ad 100644 --- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getAccountForSite.xml +++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getAccountForSite.xml @@ -65,10 +65,11 @@ </item> <item> <key> <string>_body</string> </key> - <value> <string>organisation_list = [x.getObject() for x in context.portal_catalog(portal_type=\'Organisation\', site_uid=site.getUid()) if x.getObject().getRole()==\'internal\']\n -if len(organisation_list) != 1:\n - raise ValueError, \'Must not get %d organisation for the site %s\' %(len(organisation_list),site.getTitle())\n -organisation = organisation_list[0]\n + <value> <string>if isinstance(site, str):\n + site = context.portal_categories.site.restrictedTraverse(site)\n +orga_id = "site_%3s" %(site.getCodification())\n +organisation = context.organisation_module[orga_id]\n +\n account_list = [x for x in organisation.objectValues(portal_type=\'Bank Account\') if x.getValidationState() == \'valid\']\n if len(account_list)!=1:\n raise ValueError, \'Must not get %d account for the organisation %s\' %(len(account_list),organisation.getTitle())\n @@ -122,18 +123,20 @@ return account_list[0]\n <value> <tuple> <string>site</string> + <string>isinstance</string> + <string>str</string> + <string>_getattr_</string> + <string>context</string> + <string>orga_id</string> + <string>_getitem_</string> + <string>organisation</string> <string>append</string> <string>$append0</string> <string>_getiter_</string> - <string>_getattr_</string> -<string>context</string> <string>x</string> - <string>organisation_list</string> + <string>account_list</string> <string>len</string> <string>ValueError</string> - <string>_getitem_</string> - <string>organisation</string> - <string>account_list</string> </tuple> </value> </item> diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getAgencyForSite.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getAgencyForSite.xml new file mode 100644 index 0000000000000000000000000000000000000000..0f3f1630b66eb29d168dc9a466f49aa2a113a11c --- /dev/null +++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getAgencyForSite.xml @@ -0,0 +1,158 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + <tuple/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>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>if isinstance(site, str):\n + site = context.portal_categories.site.restrictedTraverse(site)\n +\n +orga_id = "site_%3s" %(site.getCodification())\n +org = context.organisation_module[orga_id]\n +\n +return org\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>site</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>site</string> + <string>isinstance</string> + <string>str</string> + <string>_getattr_</string> +<string>context</string> + <string>orga_id</string> + <string>_getitem_</string> + <string>org</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>Baobab_getAgencyForSite</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_callContainerReportDialog.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_callContainerReportDialog.xml index 08e6f28c7a227fdf6af9e4992de01b3905001bc1..d07b995cba19da2c0d1c4548f5c0ae1eab2a85db 100644 --- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_callContainerReportDialog.xml +++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_callContainerReportDialog.xml @@ -67,6 +67,7 @@ <key> <string>_body</string> </key> <value> <string>from DateTime import DateTime\n node = context.REQUEST.form[\'vault\']\n +\n container_portal_type_list = ["Monetary Reception",]\n \n base_price_dict = {}\n diff --git a/bt5/erp5_banking_core/bt/revision b/bt5/erp5_banking_core/bt/revision index 8d4011ad25d82168b3b8377030f4c232fe2a4118..511fa83dfa3be29e929664165b2228c4fbd9ff3e 100644 --- a/bt5/erp5_banking_core/bt/revision +++ b/bt5/erp5_banking_core/bt/revision @@ -1 +1 @@ -412 \ No newline at end of file +414 \ No newline at end of file