[FIX] website_sale: use commercial_partner_id instead of parent_id to have the company name of the artner in the checkout form

If the user is portal, its partner is a company and has a parent: a security rule prevent to read the parent_id
and the company which should be displayed is the closest company of the partner in the hierarchy, and, in this case, itself.

bzr revid: dle@openerp.com-20140410095814-x7hqymfelspvjdsw
This commit is contained in:
Denis Ledoux 2014-04-10 11:58:14 +02:00
parent 3f33b1e716
commit 694fb63dda
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ class CheckoutInfo(object):
result = dict((prefix + field_name, getattr(partner, field_name)) for field_name in self.string_billing_fields if getattr(partner, field_name))
result[prefix + 'state_id'] = partner.state_id and partner.state_id.id or ''
result[prefix + 'country_id'] = partner.country_id and partner.country_id.id or ''
result[prefix + 'company'] = partner.parent_id and partner.parent_id.name or ''
result[prefix + 'company'] = partner.commercial_partner_id and partner.commercial_partner_id.is_company and partner.commercial_partner_id.name or ''
return result
def from_post(self, post):