diff --git a/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashMovementNewNotEmitted_getBaobabDestination.xml b/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashMovementNewNotEmitted_getBaobabDestination.xml index 7f2c680dc6e35bdd6886882c38ab76e697eeaa2f..4ab11b97dee2d360e6d693b8adc2abc72a7ab9df 100644 --- a/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashMovementNewNotEmitted_getBaobabDestination.xml +++ b/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashMovementNewNotEmitted_getBaobabDestination.xml @@ -70,11 +70,29 @@ destination = context.getDestinationSection()\n context.log(source, destination)\n if source is None or destination is None:\n return None\n -if source.split("/")[-1] == destination.split("/")[-1] or "transit" not in source:\n +\n +has_banknote = 0\n +has_coin = 0\n +\n +for movement in context.getMovementList():\n + resource_portal_type = movement.getResourceValue().getPortalType()\n + if resource_portal_type == \'Coin\':\n + has_coin = 1\n + break\n + elif resource_portal_type == \'Banknote\':\n + has_banknote = 1\n + break\n +\n +if has_banknote == 1:\n + if source.split("/")[-1] == destination.split("/")[-1] or "transit" not in source:\n + destination = "%s/caveau/serre/encaisse_des_billets_neufs_non_emis" % destination\n + else:\n + destination = "%s/caveau/serre/encaisse_des_billets_neufs_non_emis_en_transit_allant_a/%s" % (destination, source.split("/")[-1])\n +elif has_coin == 1:\n destination = "%s/caveau/serre/encaisse_des_billets_neufs_non_emis" % destination\n else:\n - destination = "%s/caveau/serre/encaisse_des_billets_neufs_non_emis_en_transit_allant_a/%s" % (destination, source.split("/")[-1])\n - \n + destination = None\n +\n return destination\n </string> </value> </item> @@ -100,6 +118,14 @@ return destination\n <key> <string>_params</string> </key> <value> <string>*args, **kw</string> </value> </item> + <item> + <key> <string>_proxy_roles</string> </key> + <value> + <tuple> + <string>Manager</string> + </tuple> + </value> + </item> <item> <key> <string>errors</string> </key> <value> @@ -131,6 +157,11 @@ return destination\n <string>source</string> <string>destination</string> <string>None</string> + <string>has_banknote</string> + <string>has_coin</string> + <string>_getiter_</string> + <string>movement</string> + <string>resource_portal_type</string> <string>_getitem_</string> </tuple> </value> diff --git a/bt5/erp5_banking_cash/bt/revision b/bt5/erp5_banking_cash/bt/revision index 4ffc0cd9c1f9fafe9804d9a4a13d96d0ac13cfda..c029c62fcaf809a6aa3432ebfe1d5ced2dd8c929 100644 --- a/bt5/erp5_banking_cash/bt/revision +++ b/bt5/erp5_banking_cash/bt/revision @@ -1 +1 @@ -670 \ No newline at end of file +672 \ No newline at end of file