Commit ee822169 authored by Sebastien Robin's avatar Sebastien Robin

fixed a typo error

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7828 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cfb303ac
...@@ -51,7 +51,7 @@ class BaobabConduit(ERP5Conduit): ...@@ -51,7 +51,7 @@ class BaobabConduit(ERP5Conduit):
- for each properties that comes from sql, we have one ore more - for each properties that comes from sql, we have one ore more
properties in ERP5 properties in ERP5
Most importants method defined here are : Most importants method defined here are :
- constructContent : it is used when a new set of data comes from - constructContent : it is used when a new set of data comes from
the sql table, then constructContent must decide the sql table, then constructContent must decide
wich kind of object must be created in ERP5 wich kind of object must be created in ERP5
...@@ -72,17 +72,17 @@ class BaobabConduit(ERP5Conduit): ...@@ -72,17 +72,17 @@ class BaobabConduit(ERP5Conduit):
### This data structure associate a xml property to an ERP5 object property in certain conditions ### This data structure associate a xml property to an ERP5 object property in certain conditions
property_map = { property_map = {
# For example, in the sql export, we use for the first name of a person the # For example, in the sql export, we use for the first name of a person the
# property 'nom', in ERP5 we use the property first_name # property 'nom', in ERP5 we use the property first_name
'nom':[{ 'nom':[{
'erp5_property': 'first_name' 'erp5_property': 'first_name'
, 'conditions' : {'erp5_portal_type':'Person'} , 'conditions' : {'erp5_portal_type':'Person'}
} }
, { , {
'erp5_property': 'title' 'erp5_property': 'title'
, 'conditions' : {'erp5_portal_type':'Organisation'} , 'conditions' : {'erp5_portal_type':'Organisation'}
}], }],
# For example, in the sql export, we use for the name of an organisation the # For example, in the sql export, we use for the name of an organisation the
# property 'nom', in ERP5 we use the property title # property 'nom', in ERP5 we use the property title
'adresse': [{ 'adresse': [{
'erp5_property': 'default_address_street_address' 'erp5_property': 'default_address_street_address'
...@@ -220,7 +220,7 @@ class BaobabConduit(ERP5Conduit): ...@@ -220,7 +220,7 @@ class BaobabConduit(ERP5Conduit):
def findObjectFromSpecialPortalType(special_portal_type): def findObjectFromSpecialPortalType(special_portal_type):
# The first part or portal type, for example "Mandataire" # The first part or portal type, for example "Mandataire"
source_portal_type = special_portal_type.split('_')[0] source_portal_type = special_portal_type.split('_')[0]
# The place where we should build, # The place where we should build,
# [1:] is used to takes the full list except the first element # [1:] is used to takes the full list except the first element
# [::-1] is used in order to reverse the order # [::-1] is used in order to reverse the order
# construction_location will be for example 40/Z000900001 # construction_location will be for example 40/Z000900001
...@@ -234,6 +234,8 @@ class BaobabConduit(ERP5Conduit): ...@@ -234,6 +234,8 @@ class BaobabConduit(ERP5Conduit):
try: try:
# Get the object with the path # Get the object with the path
parent_object = object.restrictedTraverse(parent_object_path) parent_object = object.restrictedTraverse(parent_object_path)
if parent_object is not None:
break
except ConflictError: except ConflictError:
raise raise
except: except:
...@@ -514,6 +516,10 @@ class BaobabConduit(ERP5Conduit): ...@@ -514,6 +516,10 @@ class BaobabConduit(ERP5Conduit):
if k == 'currency' : currency_id = v if k == 'currency' : currency_id = v
if k == 'account_number': bank_account_number = v if k == 'account_number': bank_account_number = v
# try to find the bank account # try to find the bank account
LOG( 'bank_account_number:'
, 200
, bank_account_number
)
if bank_account_number != None: if bank_account_number != None:
bank_account_object = None bank_account_object = None
# We use here the catalog in order to find very quickly # We use here the catalog in order to find very quickly
...@@ -522,6 +528,10 @@ class BaobabConduit(ERP5Conduit): ...@@ -522,6 +528,10 @@ class BaobabConduit(ERP5Conduit):
bank_account_list = [x.getObject() for x in object.portal_catalog( bank_account_list = [x.getObject() for x in object.portal_catalog(
portal_type=('Bank Account'), portal_type=('Bank Account'),
reference='%%%s%%' % bank_account_number)] reference='%%%s%%' % bank_account_number)]
LOG( 'bank_account_list:'
, 200
, bank_account_list
)
# Make sure we have found the right bank account # Make sure we have found the right bank account
for bank_account in bank_account_list: for bank_account in bank_account_list:
if bank_account.getBankAccountNumber() == bank_account_number: if bank_account.getBankAccountNumber() == bank_account_number:
...@@ -576,7 +586,7 @@ class BaobabConduit(ERP5Conduit): ...@@ -576,7 +586,7 @@ class BaobabConduit(ERP5Conduit):
# get the method itself # get the method itself
method = getattr(object, method_id) method = getattr(object, method_id)
# This call the method, this exactly the same thing # This call the method, this exactly the same thing
# as calling directly : object.setTitle(v) # as calling directly : object.setTitle(v)
method(v) method(v)
else: else:
LOG( 'BaobabConduit:' LOG( 'BaobabConduit:'
...@@ -603,7 +613,7 @@ class BaobabConduit(ERP5Conduit): ...@@ -603,7 +613,7 @@ class BaobabConduit(ERP5Conduit):
# get the method itself # get the method itself
method = getattr(self, method_id) method = getattr(self, method_id)
# This call the method, this exactly the same thing # This call the method, this exactly the same thing
# as calling directly : self.editClientNatureEconomique(object,v) # as calling directly : self.editClientNatureEconomique(object,v)
method(object, v) method(object, v)
else: else:
LOG( 'BaobabConduit:' LOG( 'BaobabConduit:'
...@@ -683,8 +693,8 @@ class BaobabConduit(ERP5Conduit): ...@@ -683,8 +693,8 @@ class BaobabConduit(ERP5Conduit):
def editClientCode(self, document, value): def editClientCode(self, document, value):
pass pass
### BankAccount-related-properties functions ### BankAccount-related-properties functions
...@@ -846,7 +856,7 @@ class BaobabConduit(ERP5Conduit): ...@@ -846,7 +856,7 @@ class BaobabConduit(ERP5Conduit):
# Get the site path corresponding to the inventory type # Get the site path corresponding to the inventory type
inventory_path = None inventory_path = None
agency_site_object = site_object agency_site_object = site_object
# Parse the category tree (from the level of the agency) in order to # Parse the category tree (from the level of the agency) in order to
# find the category corresponding to the inventory # find the category corresponding to the inventory
for agency_sub_item in agency_site_object.getCategoryChildItemList(base=1)[1:]: for agency_sub_item in agency_site_object.getCategoryChildItemList(base=1)[1:]:
agency_sub_item_path = agency_sub_item[1] agency_sub_item_path = agency_sub_item[1]
...@@ -864,9 +874,9 @@ class BaobabConduit(ERP5Conduit): ...@@ -864,9 +874,9 @@ class BaobabConduit(ERP5Conduit):
# Get the site path corresponding to the vault code # Get the site path corresponding to the vault code
vault_path = None vault_path = None
vault_site_object = agency_sub_item_object vault_site_object = agency_sub_item_object
# Parse the category tree (from the level of the inventory) in order to # Parse the category tree (from the level of the inventory) in order to
# find the category corresponding to the vault # find the category corresponding to the vault
for vault_sub_item in vault_site_object.getCategoryChildtemList(base=1)[1:]: for vault_sub_item in vault_site_object.getCategoryChildItemList(base=1)[1:]:
vault_sub_item_path = vault_sub_item[1] vault_sub_item_path = vault_sub_item[1]
vault_sub_item_object = category_tool.resolveCategory(vault_sub_item_path) vault_sub_item_object = category_tool.resolveCategory(vault_sub_item_path)
vault_sub_item_code = vault_sub_item_object.getCodification() vault_sub_item_code = vault_sub_item_object.getCodification()
...@@ -880,7 +890,7 @@ class BaobabConduit(ERP5Conduit): ...@@ -880,7 +890,7 @@ class BaobabConduit(ERP5Conduit):
currency_title = currency_object.getTitle() currency_title = currency_object.getTitle()
currency_vault_path = None currency_vault_path = None
vault_object = vault_sub_item_object vault_object = vault_sub_item_object
# Parse the category tree (from the level of the vault) in order to # Parse the category tree (from the level of the vault) in order to
# find the category corresponding to the currency # find the category corresponding to the currency
for currency_vault_item in vault_object.getCategoryChildItemList(base=1)[1:]: for currency_vault_item in vault_object.getCategoryChildItemList(base=1)[1:]:
currency_vault_item_path = currency_vault_item[1] currency_vault_item_path = currency_vault_item[1]
......
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