Tryton - Issues



Title cron task for "posting clearing move" failed
Priority bug Status chatting
Superseder Nosy List pokoli, semarie
Type crash Components account_payment_clearing
Assigned To Keywords

Created on 2019-01-16.14:14:45 by semarie, last changed by semarie.

msg45993 (view) Author: [hidden] (semarie) Date: 2019-01-16.19:58:44
I found the problem regarding the absence of move associated to the payment: I only set the party and not the account too. I expected it will use the default account associated to the party, and it seems it isn't the case.

Regarding the cron task error, I can't trigger it again. I will keep an eyes on it.
msg45989 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2019-01-16.14:53:38
If you fail the payment you will be able to success it another time and tryton will try to recreate the clearing move if required (if you have the accounts properly configured on the jounral). 

So if the issue is about creating the clearing_move some message will be raised
msg45988 (view) Author: [hidden] (semarie) Date: 2019-01-16.14:39:28
here, for each payment of the group, payment.clearing_move is None whereas payment.state = 'succeeded' (I check it with proteus too).

the cron job is enabled for the company.

I will try to reproduce using a scenario to share.
msg45987 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2019-01-16.14:28:02
The move is created when the payment is succeed [1] and it will be posted when the cron job is executed [2]. If the cron job failed you should have a draft move for the clearing move. Did you tried to post it manually?

Is the cron job enabled for your company? There is a companies field on the cron form, you should see your company there. 

Normally you can use the test scenario as reference of functionality.

msg45986 (view) Author: [hidden] (semarie) Date: 2019-01-16.14:14:44
I have a payment journal for SEPA using clearing.

I created several Payments *without* associated invoices (the related invoices are recorded in 2018 in another accounting program, and the moves will be imported with the closing balance of 2018, later).

I created a Payment Group, generated the SEPA message, and send it to my bank. The bank makes the move, and I have a Statement Line with the Payment Group.

When I posted the Statement, the payments in the PaymentGroup switched to "succeed" state, but no move for the payments has been created (I expected to see a move of clearingAccount/party). Only the one for PaymentGroup (clearingAccount/bankAccount) is here.

Next, I received a mail from trytond with the following backtrace:

Subject: L'action planifiée a échouée

L'action suivante n'a pas pu s'exécuter correctement: « Poster les mouvements de compensation »

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/trytond/model/", line 396, in __getattr__
    return self._values[name]
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/trytond/model/", line 1263, in __getattr__
    return super(ModelStorage, self).__getattr__(name)
  File "/usr/local/lib/python3.6/site-packages/trytond/model/", line 399, in __getattr__
    % (self.__name__, name, self._values))
AttributeError: 'ir.configuration' Model has no attribute 'language': None

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/trytond/ir/", line 171, in run
  File "/usr/local/lib/python3.6/site-packages/trytond/model/", line 31, in newfunc
    return self.func(owner, [instance], *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/trytond/model/", line 665, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/trytond/modules/company/", line 31, in run_once
    super(Cron, cls).run_once([cron])
  File "/usr/local/lib/python3.6/site-packages/trytond/model/", line 33, in newfunc
    return self.func(owner, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/trytond/model/", line 665, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/trytond/ir/", line 151, in run_once
    getattr(Model, cron.function)(*args)
  File "/usr/local/lib/python3.6/site-packages/trytond/modules/account_payment_clearing/", line 51, in cron_post_clearing_moves
  File "/usr/local/lib/python3.6/site-packages/trytond/model/", line 665, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/trytond/modules/analytic_account/", line 173, in post
  File "/usr/local/lib/python3.6/site-packages/trytond/modules/analytic_account/", line 270, in set_analytic_state
    ('parent', '=', None),
  File "/usr/local/lib/python3.6/site-packages/trytond/model/", line 1199, in search
    forder = field.convert_order(oexpr, tables, cls)
  File "/usr/local/lib/python3.6/site-packages/trytond/model/fields/", line 467, in convert_order
    language = Transaction().language
  File "/usr/local/lib/python3.6/site-packages/trytond/", line 251, in language
    return self.context.get('language') or get_language()
  File "/usr/local/lib/python3.6/site-packages/trytond/", line 249, in get_language
    return Config.get_language()
  File "/usr/local/lib/python3.6/site-packages/trytond/ir/", line 27, in get_language
    language = config.language
  File "/usr/local/lib/python3.6/site-packages/trytond/model/fields/", line 298, in __get__
    return inst.__getattr__(
  File "/usr/local/lib/python3.6/site-packages/trytond/model/", line 1265, in __getattr__
    if is None or < 0:
  File "/usr/local/lib/python3.6/site-packages/trytond/model/fields/", line 295, in __get__
    assert is not None

I dunno about the order: if the cron task failed and so no move were created, or if no moves were created (because of no invoice ?) and so the cron task failed, or if the backtrace is unrelated.

I am interested to know if the Move associated to payments when succeeded should be created automatically or not
Date User Action Args
2019-01-16 19:58:44semariesetmessages: + msg45993
2019-01-16 14:53:38pokolisetmessages: + msg45989
2019-01-16 14:39:28semariesetmessages: + msg45988
2019-01-16 14:28:02pokolisetstatus: unread -> chatting
nosy: + pokoli
messages: + msg45987
2019-01-16 14:14:45semariecreate

Showing 10 items. Show all history (warning: this could be VERY long)