[REF] base: remove checks on non existent context keys

Those keys have no match in the codebase.

closes odoo/odoo#112613

Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
This commit is contained in:
Aaron Bohy
2023-02-14 13:14:01 +01:00
parent b8b42d5a49
commit dad8de3863
-11
View File
@@ -131,14 +131,7 @@ class PartnerCategory(models.Model):
def name_get(self):
""" Return the categories' display name, including their direct
parent by default.
If ``context['partner_category_display']`` is ``'short'``, the short
version of the category name (without the direct parent) is used.
The default is the long version.
"""
if self._context.get('partner_category_display') == 'short':
return super(PartnerCategory, self).name_get()
res = []
for category in self:
names = []
@@ -814,8 +807,6 @@ class Partner(models.Model):
name = dict(self.fields_get(['type'])['type']['selection'])[partner.type]
if not partner.is_company:
name = self._get_contact_name(partner, name)
if self._context.get('show_address_only'):
name = partner._display_address(without_company=True)
if self._context.get('show_address'):
name = name + "\n" + partner._display_address(without_company=True)
name = name.replace('\n\n', '\n')
@@ -827,8 +818,6 @@ class Partner(models.Model):
name = ", ".join([n for n in splitted_names if n.strip()])
if self._context.get('show_email') and partner.email:
name = "%s <%s>" % (name, partner.email)
if self._context.get('html_format'):
name = name.replace('\n', '<br/>')
if self._context.get('show_vat') and partner.vat:
name = "%s ‒ %s" % (name, partner.vat)
return name