Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2232 Widoki

Good evening I need your help as I am new to odoo development, I want to calculate the total amount of payments filtered by journal.

this is my code:

@api.depends('amount','journal_id') 

    def valorespago(self): 

    for record in self: 

        if record.move_id.journal_id == 'Efectivo':

         record.pago = record.amount

Awatar
Odrzuć
Najlepsza odpowiedź

Dear Carlos Castillo,

The above code you are filter by journal name not id. So you need to small modification on the code.

 if record.move_id.journal_id.name == 'Efectivo':

Awatar
Odrzuć