Skip to Content
Menu
This question has been flagged
1 Reply
1482 Views

Hi guys, I have a  problem I am trying to add a new field in the account.payment template called collection invoice is a fairly simple code as it just inherits from another field however I get this error: .​

Traceback (most recent call last):
  File "/odoo15/odoo-server/odoo/http.py", line 643, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/odoo15/odoo-server/odoo/http.py", line 301, in _handle_exception
    raise exception.with_traceback(None) from new_cause
RecursionError: maximum recursion depth exceeded while calling a Python object

This is my code:


from odoo import models, fields, apiimportlogging_logger=logging.getLogger(__name__)

classaccount_payment_inherit(models.Model):_inherit='account.payment'
collection_invoice= fields.Many2many(comodel_name='account.move', string='Factura de origen', compute='_compute_collection_invoice' , store=True)def_compute_collection_invoice(self):forpaymentinself:ifpayment.reconciled_invoice_ids:payment.collection_invoice = [(6, 0, payment.reconciled_invoice_ids.ids)]else:payment.collection_invoice = [(5, 0, 0)]

Avatar
Discard
Best Answer

Hello

try this

from sys import setrecursionlimit

setrecursionlimit($limit)

with limit > 1000

I have the same problem odoo doens't support recursive call with more than 10000 calls

Avatar
Discard