From a61f7ce8d1d89801fd42bf2305c9bf36603b6da9 Mon Sep 17 00:00:00 2001 From: "Sbh (Openerp)" Date: Fri, 30 Mar 2012 10:27:52 +0530 Subject: [PATCH] [IMP]:base/res : remove type from display address bzr revid: sbh@tinyerp.com-20120330045752-m9d9vgt92uro6fle --- openerp/addons/base/res/res_partner.py | 8 +------- openerp/report/report_sxw.py | 6 +++--- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/openerp/addons/base/res/res_partner.py b/openerp/addons/base/res/res_partner.py index 4ec49699269..6f04c3483cd 100644 --- a/openerp/addons/base/res/res_partner.py +++ b/openerp/addons/base/res/res_partner.py @@ -391,7 +391,7 @@ class res_partner(osv.osv): ('name','=','main_partner')])[0], ).res_id - def _display_address(self, cr, uid, address, type='', context=None): + def _display_address(self, cr, uid, address, context=None): ''' The purpose of this function is to build and return an address formatted accordingly to the @@ -403,12 +403,6 @@ class res_partner(osv.osv): :rtype: string ''' - if type: - if address.is_company and address.child_ids: - for child_id in address.child_ids: - if child_id.type == type: - address = child_id - # get the information that will be injected into the display format # get the address format address_format = address.country_id and address.country_id.address_format or \ diff --git a/openerp/report/report_sxw.py b/openerp/report/report_sxw.py index 7cd9516c099..27bd5fa5394 100644 --- a/openerp/report/report_sxw.py +++ b/openerp/report/report_sxw.py @@ -299,7 +299,7 @@ class rml_parse(object): parse_format = DEFAULT_SERVER_DATETIME_FORMAT if isinstance(value, basestring): # FIXME: the trimming is probably unreliable if format includes day/month names - # and those would need to be translated anyway. + # and those would need to be translated anyway. date = datetime.strptime(value[:get_date_length(parse_format)], parse_format) elif isinstance(value, time.struct_time): date = datetime(*value[:6]) @@ -320,8 +320,8 @@ class rml_parse(object): res='%s %s'%(currency_obj.symbol, res) return res - def display_address(self, address_browse_record, type=''): - return self.pool.get('res.partner')._display_address(self.cr, self.uid, address_browse_record, type) + def display_address(self, address_browse_record): + return self.pool.get('res.partner')._display_address(self.cr, self.uid, address_browse_record) def repeatIn(self, lst, name,nodes_parent=False): ret_lst = []