No posting of invoices with tax_cash module after upgrade vom 7.0 to 7.8

Hi folks,
after upgrading to version 7.8. from 7.0 when posting a customer invoice, i get a message Only one tax line on cash basis can be without period per move line. with having the module tax_cache installed.
There were no changes in the tax oder on_cash_basis configuration after upgrading the database.
Posting a similar invoice on the 7.0 version of the same database is possible.

Might this be a bug, since i couldn’t find any changed documentation?

Regards Jakob

This is due to this improvement Add SQL constraint to ensure only one tax line without period (ff2db2647e19) · Commits · Tryton / Tryton · GitLab
I guess your setup did not calculate correctly the cash basis before as the calculation can be done only if there is only one tax base on cash per move line.

By the way what is your tax setup that uses 2 cash basis taxes for the same line?

@ced, I do not have a setup where two taxes are used for a line, I use the mds-trytond-account-de-skr04 package. I checked the constraint on the database with

SELECT *
FROM account_tax_line
WHERE on_cash_basis IS TRUE
  AND period IS NULL;

I fixed two lines in the frontend, where I messed up the period, probably because of my other issue with the reporting with the tax_cash module. Bug in account_tax_cash - #7 by Gruenfischer Now I have ZERO lines where the exclude can hit, but still get the error. From my understanding the constraint might only be met inside the transaction where the change is applied.
Maybe I have a general misunderstanding, I am not that good at special database stuff.
My next guess is debugging with the logs, to see where the transactions is rolled back.

Regards Jakob

You do otherwise the constraint will not be triggered.

Of course, this is the principle of database constraint. It prevents to have row that does not respect it.

So I do not know mds-trytond-account-de-skr04 so I can not help you there. But clearly the setup is wrong for cash basis.

OK, found it:
the error says

> Only one tax line on cash basis can be without period per move line.

The reason is, that I configured the tax cash groups in the fiscal year twice. I had a group added twice.
@ced thanks for the hint with the two taxes.

Maybe the error could contain a hint where to look, like ...per move line. Check for duplicate taxes in on cash basis configuration.
Or even a domain could fix the misconfiguration?

Problem solved :slight_smile:
Regards Jakob

There is an open issue to implement what you request:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.