[REF] l10n_pe_pos: remove inheritance to handle errors in partner editions

Now, point_of_sale handles errors in partner editions, so it is not
required inheriting the method to add the functionality.

closes odoo/odoo#160389

Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
This commit is contained in:
rolandojduartem
2024-04-04 08:18:55 +00:00
parent b1b836856c
commit f7f2c93eb7
@@ -1,6 +1,5 @@
/** @odoo-module */
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { PartnerListScreen } from "@point_of_sale/app/screens/partner_list/partner_list";
import { patch } from "@web/core/utils/patch";
@@ -21,24 +20,4 @@ patch(PartnerListScreen.prototype, {
];
return res;
},
/**
* Now, vat is required by Peruvian Localization and it is important to display errors during partners creation,
* mainly, if they are related to the format of the vat
* https://github.com/odoo/odoo/blob/6e8e3e63/addons/base_vat/models/res_partner.py#L267
*/
async saveChanges(processedChanges) {
let partnerId;
try {
partnerId = await this.orm.call("res.partner", "create_from_ui", [processedChanges]);
} catch (error) {
return this.env.services.popup.add(ErrorPopup, {
title: error.message,
body: error.data.message,
});
}
if (partnerId) {
processedChanges.id = partnerId;
}
await super.saveChanges(...arguments);
},
});