Compute clearing reconciled of Payment (Migration from 6.2 to 6.4)

Hi everyone

I’m getting an error message when clearing reconciled of Payment
Thanks for your help

(tryton64) exol@accounting-srvr:~/app/tryton64$ trytond-console -c $HOME/app/tryton64/trytond.conf -d ExolErp
Tryton 6.4.5, Python 3.8.10 (default, Nov 14 2022, 12:59:47)
[GCC 9.4.0] on linux
>>> Payment = pool.get('account.payment')
>>> Payment.update_reconciled(Payment.search([]))
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/exol/app/tryton64/lib/python3.8/site-packages/trytond/modules/account_payment_clearing/payment.py", line 305, in update_reconciled
    cls.save(payments)
  File "/home/exol/app/tryton64/lib/python3.8/site-packages/trytond/model/descriptors.py", line 33, in newfunc
    return self.func(owner, *args, **kwargs)
  File "/home/exol/app/tryton64/lib/python3.8/site-packages/trytond/model/modelstorage.py", line 1921, in save
    cls.write(*sum(
  File "/home/exol/app/tryton64/lib/python3.8/site-packages/trytond/model/modelsql.py", line 161, in wrapper
    return func(cls, *args, **kwargs)
  File "/home/exol/app/tryton64/lib/python3.8/site-packages/trytond/model/modelsql.py", line 1140, in write
    cls._validate(sub_records, field_names=all_field_names)
  File "/home/exol/app/tryton64/lib/python3.8/site-packages/trytond/model/modelstorage.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "/home/exol/app/tryton64/lib/python3.8/site-packages/trytond/model/modelstorage.py", line 1332, in _validate
    validate_domain(field)
  File "/home/exol/app/tryton64/lib/python3.8/site-packages/trytond/model/modelstorage.py", line 1255, in validate_domain
    validate_relation_domain(
  File "/home/exol/app/tryton64/lib/python3.8/site-packages/trytond/model/modelstorage.py", line 1315, in validate_relation_domain
    raise DomainValidationError(msg)
trytond.model.modelstorage.DomainValidationError: La valeur du champ « Ligne » sur « Paiement » n'est pas valide selon son domaine. -

Maybe you have made payment for a line that is no more on an account of type receivable or payable.

To know exactly you need to find the exact payment which is triggering the error (in 6.6 it appears in the error message).

You are right, it was a payment that was created in our testing database.
After upgrading to 6.6 I found the paiment that trigred the error.
All is OK now
Thanks