Tryton - Issues

 

Issue8073

Title can't validate an invoice in fiscal year N-1 in N if account_tax_cash
Priority bug Status invalid
Superseder Nosy List ced, risto3
Type Components account_tax_cash
Assigned To Keywords
Reviews

Created on 2019-02-05.15:31:40 by risto3, last changed by ced.

Messages
msg48589 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-04-06.18:47:45
The reason is explained is msg48586.
So we are not going to change that. We do not complicate code for use case that should never exist and for which workaround exists.
msg48588 (view) Author: [hidden] (risto3) Date: 2019-04-06.18:45:40
This is not registering a payment but validating the invoice.
current period has nothing to do here as only invoice date has any relevance being a mandatory field.

The only potention issue is if the period containing invoice date is closed, then the first non closed period thereafter should be used (that is, general accounting rules). 

Only if no such period exists then and only then should an error be raised.
msg48586 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-04-06.18:35:51
I do not consider it as a bug. account_tax_cash search a period for the current date in case it has to register a payment. This is needed to have good performance. So it just requires to open the period for the current date which is something that should be done any way. Also the error message is a user error so nothing to worry the user.
msg46735 (view) Author: [hidden] (risto3) Date: 2019-02-05.16:00:34
same error with cancel
msg46734 (view) Author: [hidden] (risto3) Date: 2019-02-05.15:31:39
With nothing yet created for 2019, I try to validate an supplier invoice in 2018 after
activating account_tax_cash, I get the following:

Traceback (most recent call last):
  File "/opt/trytond/trytond/protocols/dispatcher.py", line 176, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/opt/trytond/trytond/model/modelview.py", line 665, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/opt/trytond/trytond/model/workflow.py", line 36, in wrapper
    result = func(cls, filtered, *args, **kwargs)
  File "/opt/trytond/trytond/modules/account_invoice/invoice.py", line 1353, in validate_invoice
    cls.save(invoices_in)
  File "/opt/trytond/trytond/model/descriptors.py", line 33, in newfunc
    return self.func(owner, *args, **kwargs)
  File "/opt/trytond/trytond/model/modelstorage.py", line 1539, in save
    (([r], save_values[r]) for r in to_write), ()))
  File "/opt/trytond/trytond/modules/account_tax_cash/account.py", line 288, in write
    invoice.company.id, date=date)
  File "/opt/trytond/trytond/modules/account/period.py", line 201, in find
    cls.raise_user_error('no_period_date', lang.strftime(date))
  File "/opt/trytond/trytond/error.py", line 74, in raise_user_error
    raise UserError(error)
trytond.exceptions.UserError: ('UserError', ('Pas de période de définie pour la date «\xa005.02.2019\xa0».', ''))
History
Date User Action Args
2019-04-06 18:47:45cedsetstatus: chatting -> invalid
messages: + msg48589
2019-04-06 18:45:40risto3setstatus: invalid -> chatting
messages: + msg48588
2019-04-06 18:35:52cedsetstatus: chatting -> invalid
nosy: + ced
messages: + msg48586
2019-02-05 16:00:34risto3setstatus: unread -> chatting
messages: + msg46735
2019-02-05 15:31:40risto3create

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