* [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>
14 lines
430 B
Python
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)]
|
|
)
|