[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:
@@ -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);
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user