Ich brauche hier die Methode „get_taxes_after_fp“ in js von POS – Odoo v17

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Ich brauche hier die Methode „get_taxes_after_fp“ in js von POS – Odoo v17

by Guest » 07 Jan 2025, 04:09

Ich habe das folgende Problem, ich habe die Methode get_taxes_after_fp von js, die verwendet wird, um einige Steuern zu erhalten
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
}

},
Ich brauche die Heredate-Methode in js

Top