You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

16 lines
505 B

# Copyright 2020 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
class ResPartner(models.Model):
_inherit = "res.partner"
def _get_contact_name(self, partner, name):
if self.env.context.get("_two_lines_partner_address"):
return "{}\n {}".format(
partner.commercial_company_name or partner.parent_id.name, name
)
else:
return super()._get_contact_name(partner, name)