From 7e48e1398c73eee17ca3db38af2b0fcc74119395 Mon Sep 17 00:00:00 2001 From: Julien Van Roy Date: Mon, 14 Feb 2022 14:14:15 +0000 Subject: [PATCH] [FIX] partner_autocomplete: VAT not showing in edit mode When using the widget res_partner_many2one (e.g. in the customer invoice form view), the VAT number disappears when being in 'edit' mode. This is caused by the '_getDisplayNameWithoutVAT' function, which was introduced in PR https://github.com/odoo/odoo/pull/29189, because the VAT appeared in edit mode but disappeared when saved at that time. Since the VAT no longer disappears when saved, we no longer need this function removing the VAT from the edit mode. task-2749331 closes odoo/odoo#87843 X-original-commit: 78a5e53a99d9f0f04edf42f1ed8d713fda4de36e Signed-off-by: Laurent Smet Signed-off-by: Julien Van Roy --- .../static/src/js/partner_autocomplete_many2one.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/addons/partner_autocomplete/static/src/js/partner_autocomplete_many2one.js b/addons/partner_autocomplete/static/src/js/partner_autocomplete_many2one.js index 856bcf653e2..2fbeefced4e 100644 --- a/addons/partner_autocomplete/static/src/js/partner_autocomplete_many2one.js +++ b/addons/partner_autocomplete/static/src/js/partner_autocomplete_many2one.js @@ -57,19 +57,6 @@ var PartnerField = FieldMany2One.extend(AutocompleteMixin, { }); }, - /** - * Returns the display_name from a string which contains it but was altered - * as a result of the show_vat option. - * Note that the split is done on a 'figuredash', not a standard dash. - * - * @private - * @param {string} value - * @returns {string} display_name without TaxID - */ - _getDisplayNameWithoutVAT: function (value) { - return value.split(' ‒ ')[0]; - }, - /** * Modify autocomplete results rendering * Add logo in the autocomplete results if logo is provided @@ -104,7 +91,6 @@ var PartnerField = FieldMany2One.extend(AutocompleteMixin, { * @private */ _renderEdit: function (){ - this.m2o_value = this._getDisplayNameWithoutVAT(this.m2o_value); this._super.apply(this, arguments); this._modifyAutompleteRendering(); },