[IMP] res_partner_address, display_address: improved help tooltip on address_format + made private the function _display_address as it's not usable through direct RPC requests + added context=None in the signature of this function, for future needs

bzr revid: qdp-launchpad@openerp.com-20111201162747-gcbh995k1pu8ql7m
This commit is contained in:
Quentin (OpenERP) 2011-12-01 17:27:47 +01:00
parent dd436b075b
commit c900059a3e
3 changed files with 9 additions and 4 deletions

View File

@ -31,8 +31,13 @@ class Country(osv.osv):
'code': fields.char('Country Code', size=2,
help='The ISO country code in two chars.\n'
'You can use this field for quick search.', required=True),
'address_format': fields.text('Address Format', help="You can state here the usual format to use for the \
addresses belonging to this country."),
'address_format': fields.text('Address Format', help="""You can state here the usual format to use for the \
addresses belonging to this country.\n\nYou can use the python-style string patern with all the field of the address \
(for example, use '%(street)s' to display the field 'street') plus
\n%(state_name)s: the name of the state
\n%(state_code)s: the code of the state
\n%(country_name)s: the name of the country
\n%(country_code)s: the code of the country"""),
}
_sql_constraints = [
('name_uniq', 'unique (name)',

View File

@ -356,7 +356,7 @@ class res_partner_address(osv.osv):
def get_city(self, cr, uid, id):
return self.browse(cr, uid, id).city
def display_address(self, cr, uid, address):
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
standards of the country where it belongs.

View File

@ -315,7 +315,7 @@ class rml_parse(object):
return res
def display_address(self, address_browse_record):
return self.pool.get('res.partner.address').display_address(self.cr, self.uid, address_browse_record)
return self.pool.get('res.partner.address')._display_address(self.cr, self.uid, address_browse_record)
def repeatIn(self, lst, name,nodes_parent=False):
ret_lst = []