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

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