Good afternoon community, I have a problem since I am trying to calculate the total amount paid with a specific newspaper as cash but nothing returns.
this is my code:
class cierre_caja(models.Model):
_name = 'cierre_caja.cierre_caja'
_inherit='account.payment'
pagos_d = fields.Monetary(string="Pago",compute='valorespago')
@api.depends('amount','journal_id','move_id','name')
def valorespago(self):
pago = self.env['account.payment'] f
or record in self:
payment_journal = 0
pago_id = pago.search([('journal_id', '=', '7')])
if pago_id:
for pago in pago_id:
payment_journal += pago.amount r
ecord.pago_id = record.balance + payment_journal