From 171621a2a33550224c8c9d281fef6a611f3bda77 Mon Sep 17 00:00:00 2001 From: Vincent Pelletier <vincent@nexedi.com> Date: Tue, 24 Jul 2007 08:03:31 +0000 Subject: [PATCH] Externalize definition of former_coin_variation_list. Check thet getFormer matches requirement, to avoid the case where a former coin would match in a current coin search. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15285 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5SyncML/Conduit/BaobabConduit.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/product/ERP5SyncML/Conduit/BaobabConduit.py b/product/ERP5SyncML/Conduit/BaobabConduit.py index 8f461ea127..f835dcc056 100644 --- a/product/ERP5SyncML/Conduit/BaobabConduit.py +++ b/product/ERP5SyncML/Conduit/BaobabConduit.py @@ -200,11 +200,13 @@ class BaobabConduit(ERP5Conduit): from Products.Baobab.Conduit import vault_code_to_path from Products.Baobab.Conduit import variation_translate_dict from Products.Baobab.Conduit import status_code_to_cash_status + from Products.Baobab.Conduit import former_coin_variation_list except ImportError: inventory_code_to_path = {} vault_code_to_path = {} ariation_translate_dict = {} status_code_to_cash_status = {} + former_coin_variation_list = [] """ Methods below are tools to use the property_map. @@ -540,10 +542,10 @@ class BaobabConduit(ERP5Conduit): currency_name not in (None, '') and \ currency_cash.getBasePrice() == base_price and \ currency_cash.getPriceCurrencyId() == currency_name: - if currency_portal_type == 'Coin' and kw.get('variation', None) == 'ANC' and \ - not currency_cash.getFormer(): - # If we are searching for an 'ANC' variation of a coin, getFormer - # must be true for the currency cash to match. + # getFormer value must match searched coin variation. + if currency_portal_type == 'Coin' and \ + (kw.get('variation', None) in former_coin_variation_list) != \ + bool(currency_cash.getFormer()): continue line_currency_cash = currency_cash break -- 2.30.9