[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 <las@odoo.com>
Signed-off-by: Julien Van Roy <juvr@odoo.com>
This commit is contained in:
Julien Van Roy
2022-04-04 09:24:53 +02:00
parent 82bbafe1cb
commit 7e48e1398c
@@ -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();
},