[FIX] base: ignore context key in compute_display_name for res_partner

If you create a partner with a e.g. the key show_vat, it will be stored on
the partner while we would like to have this information only in the name_get.

After this commit, we will stop to save partner in our production database
with the vat number stored in the name because we create the partner (with vat)
from the invoice, where partner_id have a context with show_vat.

closes odoo/odoo#33492

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit is contained in:
Jeremy Kersten
2019-05-20 13:52:20 +00:00
parent 09af3fac39
commit 659ff0da13
+1 -1
View File
@@ -249,7 +249,7 @@ class Partner(models.Model):
@api.depends('is_company', 'name', 'parent_id.name', 'type', 'company_name')
def _compute_display_name(self):
diff = dict(show_address=None, show_address_only=None, show_email=None)
diff = dict(show_address=None, show_address_only=None, show_email=None, html_format=None, show_vat=False)
names = dict(self.with_context(**diff).name_get())
for partner in self:
partner.display_name = names.get(partner.id)