Ich habe das folgende Problem, weil ich Probleme habe, wenn ich die folgende Überschreibung durchführe Mit dem Aufruf der Methode „get_tax_ids_after_fiscal_position_pos“ scheint es, dass die Informationen die Methode in js nicht erreichen, obwohl sie die Werte der richtigen Methode zurückgibt. Ich denke, das liegt möglicherweise daran, dass ich sie nicht verwende wait, aber es erlaubt mir nicht, die Methode zu erben. Wie kann ich dafür sorgen, dass sie Daten von einer .py-Methode mitbringt?
meine Methode:
Code: Select all
patch(PosStore.prototype, {
get_taxes_after_fp(taxIds, fpos, partner=false) {
const originalTaxes = super.get_taxes_after_fp(...arguments);
const mappedTaxes = [];
// const taxes_fp = this.get_metodo_prueba(taxIds, fpos);
const taxes_fp = this.orm.call('pos.order', 'get_tax_ids_after_fiscal_position_pos', [0, this.company.id, taxIds, fpos.id]);
console.log("RETURN TAXES_FP", taxes_fp)
if (taxes_fp) {
for (const taxMap of taxes_fp) {
const mappedTax = this.taxes_by_id[taxMap];
if (mappedTax) {
mappedTaxes.push(mappedTax);
}
}
}
if (mappedTaxes) {
console.log('INGRESA AL IFF', mappedTaxes)
return uniqueBy(mappedTaxes, (tax) => tax.id);
} else {
return originalTaxes
}
},