Commit 2013b3c9 authored by Vincent Pelletier's avatar Vincent Pelletier

Allow to fallback on a given site codification when the one received is not...

Allow to fallback on a given site codification when the one received is not present in a valid codification set.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17323 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 65061492
...@@ -201,12 +201,16 @@ class BaobabConduit(ERP5Conduit): ...@@ -201,12 +201,16 @@ class BaobabConduit(ERP5Conduit):
from Products.Baobab.Conduit import variation_translate_dict from Products.Baobab.Conduit import variation_translate_dict
from Products.Baobab.Conduit import status_code_to_cash_status from Products.Baobab.Conduit import status_code_to_cash_status
from Products.Baobab.Conduit import former_coin_variation_list from Products.Baobab.Conduit import former_coin_variation_list
from Products.Baobab.Conduit import default_letter_code
from Products.Baobab.Conduit import valid_letter_code_set
except ImportError: except ImportError:
inventory_code_to_path = {} inventory_code_to_path = {}
vault_code_to_path = {} vault_code_to_path = {}
ariation_translate_dict = {} ariation_translate_dict = {}
status_code_to_cash_status = {} status_code_to_cash_status = {}
former_coin_variation_list = [] former_coin_variation_list = []
default_letter_code = None
valid_letter_code_set = ()
""" """
Methods below are tools to use the property_map. Methods below are tools to use the property_map.
...@@ -587,8 +591,12 @@ class BaobabConduit(ERP5Conduit): ...@@ -587,8 +591,12 @@ class BaobabConduit(ERP5Conduit):
category = self.variation_translate_dict.get(kw[base_key], kw[base_key]) category = self.variation_translate_dict.get(kw[base_key], kw[base_key])
else: else:
category = 'not_defined' category = 'not_defined'
elif base_key == 'letter_code':
letter = kw[base_key]
if letter in valid_letter_code_set:
category = letter
else: else:
category = kw[base_key] category = default_letter_code
else: else:
category = 'not_defined' category = 'not_defined'
# We must have at least a category for each axis # We must have at least a category for each axis
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment