I'm pretty sure there is a problem with _cumulate and also one with period_ids being an empty list instead of None when no period is selected but dates are filled.
* Sergi Almacellas Abellana [2021-05-24 08:55 +0200]:
>
>Sergi Almacellas Abellana <sergi@koolpi.com> added the comment:
>
>@nicoe could you share the difference between both patches?
Yes I replied in a hurry yesterday.
My patch considers that you use either periods or dates but not both thus it
does not require to change MoveLine.query_get (basicaly you put the complexity
in query_get I put it in get_account). But it misses your change on _cumulate
(which is not related to the issue but is nice anyway because it resets the
context).
I also changed the tests differently (so that we can test on the same
fiscalyear the period before the move are added, the period where they're added
and afterwards).
For me review351991002 is a better solution because it does not alter Move.query_get which is already too complex. And it will require to also include the context reset of review348161002.
But as-is it can not be backported, it should not have a changelog entry and it should work without modification of the scenario (I guess it the modifications are only to test the special case).