Created on 2021-12-15.12:22:35 by acaubet, last changed 3 months ago by roundup-bot.
File name | Uploaded | Type | Details |
---|---|---|---|
scenario_close_fiscalyear.rst | acaubet, 2021-12-15.12:22:35 | text/x-rst | view |
New changeset 756754b57ae9 by Cédric Krier in branch '6.2': Compute deferral balance by cumulating children account https://hg.tryton.org/modules/account/rev/756754b57ae9 New changeset 5b9ee9781a0f by Cédric Krier in branch '6.0': Compute deferral balance by cumulating children account https://hg.tryton.org/modules/account/rev/5b9ee9781a0f New changeset 226b2fb53672 by Cédric Krier in branch '5.0': Compute deferral balance by cumulating children account https://hg.tryton.org/modules/account/rev/226b2fb53672
New changeset 9544fc428fb6 by Cédric Krier in branch 'default': Compute deferral balance by cumulating children account https://hg.tryton.org/tryton-env/rev/9544fc428fb6 New changeset e2f4c2e9f023 by Cédric Krier in branch 'default': Add test scenario for closing fiscal year https://hg.tryton.org/tryton-env/rev/e2f4c2e9f023
New changeset 5457ef491963 by Cédric Krier in branch 'default': Compute deferral balance by cumulating children account https://hg.tryton.org/modules/account/rev/5457ef491963 New changeset 543d8eabc6ee by Cédric Krier in branch 'default': Add test scenario for closing fiscal year https://hg.tryton.org/modules/account/rev/543d8eabc6ee
I updated the review376391002 to show that we could compute the cumulate in the get_balance
of Deferral.
On 2022-01-04 18:10, Sergi Almacellas Abellana wrote: > > I still do not uderstand why the code can not be placed in get_balance. > > > Then we do not understand each other. > > On my first attempt I tried to follow your advice and make the get_balance sum the children accounts, but this does not fix the issue because it does not exist any deferral record related to the parent account, so the cumulate function does not find it so the children sum in get_balance is useless. I do not understand why you can do it in your review and not in get_balance. It is exactly the same code.
I still do not uderstand why the code can not be placed in get_balance.
Then we do not understand each other.
On my first attempt I tried to follow your advice and make the get_balance sum the children accounts, but this does not fix the issue because it does not exist any deferral record related to the parent account, so the cumulate function does not find it so the children sum in get_balance is useless.
On 2022-01-04 18:05, Sergi Almacellas Abellana wrote: > > I do not understand why it can not be done in the Deferral.get_balance. > > Because we [do not create a deferral record for accounts that do not have any type](https://hg.tryton.org/modules/account/file/5a15561b28ce/fiscalyear.py#l245). So the search of the deferral records fails for parent accounts. > > > Indeed the same code could be written in this function if it is changed > into a classmethod. > > This requires to have a deferral record for all accounts which is not the case. I still do not uderstand why the code can not be placed in get_balance.
I do not understand why it can not be done in the Deferral.get_balance.
Because we do not create a deferral record for accounts that do not have any type. So the search of the deferral records fails for parent accounts.
Indeed the same code could be written in this function if it is changed
into a classmethod.
This requires to have a deferral record for all accounts which is not the case.
On 2022-01-04 11:58, Sergi Almacellas Abellana wrote: > It is not possible to do it on the deferral computation as the parent accounts does not have any deferral record, but we can include the children account values on the `_cumulate` function for balance. I do not understand why it can not be done in the Deferral.get_balance. Indeed the same code could be written in this function if it is changed into a classmethod.
Here is review376391002 which cumulates the children amounts on balance.
It is not possible to do it on the deferral computation as the parent accounts does not have any deferral record, but we can include the children account values on the _cumulate
function for balance.
For me it is the wrong solution msg72549 because the deferrals are also used to compute debit and credit which are not summing children.
Indeed I think the proper solution is that get_balance
of Account Deferral should sum the children.
For the record, on newsletter or where you consider we should warn to reopen and close the fiscal years to recompute.
Don't know since this happens, but at least we found on 6.0 and following so it should be backported.
The issue comes from the credit/debit computation which does not compute values for parent accounts. The computation is done on the balance (thanks to parent left/right).
To have a proper computation we need to store such values, so I guess we can add a context flag to enable computation also for parents records and activate it on the BalanceNonDeferral computation.
If a equity account (A) have sub-accounts/childs (A.1) on closing the fiscal year it doesn't store the debit/credit of A, causing wrong computation of the balance.
I don't know if maybe it's normal that A is not saved instead balance of A should return the childs sum.
The steps could be reproduced by the attached scenario.
I'm starting to check where the problem could be.
Any help is appreciated as account module and accounting in general could be complex.
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-02-07 23:34:21 | roundup-bot | set | keyword:
- backport messages: + msg73927 |
2022-02-03 22:22:10 | roundup-bot | set | messages: + msg73760 |
2022-02-03 22:21:54 | roundup-bot | set | messages:
+ msg73759 nosy: + roundup-bot status: testing -> resolved |
2022-01-24 17:43:58 | reviewbot | set | messages: + msg73510 |
2022-01-15 23:49:28 | reviewbot | set | messages: + msg73254 |
2022-01-15 23:47:00 | ced | set | assignedto: pokoli -> ced messages: + msg73253 |
2022-01-04 18:44:32 | ced | set | messages: + msg73097 |
2022-01-04 18:10:49 | pokoli | set | messages: + msg73096 |
2022-01-04 18:07:13 | ced | set | messages: + msg73095 |
2022-01-04 18:05:13 | pokoli | set | messages: + msg73094 |
Showing 10 items. Show all history (warning: this could be VERY long)