odooapps/account_payment_portal/models/account_payment.py
madmooose e2492df90e
Some checks failed
pre-commit / pre-commit (push) Failing after 2m39s
tests / Detect unreleased dependencies (push) Successful in 5s
tests / test with OCB (push) Successful in 3m32s
tests / test with Odoo (push) Successful in 2m34s
account_payment_portal
* [WIP] account_payment_portal: first draft

* [ADD] account_payment_portal

* [IMP] account_payment_portal: Fix user rights and add test

---------

Co-authored-by: Niels Göttsch <ng@ife.de>
2026-06-08 20:36:22 +02:00

14 lines
430 B
Python

from odoo import api, fields, models
class AccountPayment(models.Model):
_inherit = "account.payment"
payment_count = fields.Integer(compute="_compute_count_payment")
@api.depends("partner_id")
def _compute_count_payment(self):
for payment in self:
payment.payment_count = self.env["account.payment"].search_count(
[("partner_id", "=", payment.partner_id.id)]
)