[15.0][IMP] account_financial_report: Add grouping by analytical account in Trial balance#1151
Conversation
82d8c9a to
513fbe2
Compare
513fbe2 to
0073e67
Compare
|
Ping @pedrobaeza |
pedrobaeza
left a comment
There was a problem hiding this comment.
On a test on runboat, all the groups by analytic accounting are putting the "Undistributed loss/gain results" with value 0 (account 129 in Spanish CoA, 9999999 in the sample CoA), and even more as I checked the option "Hide accounts at 0" (but it should be independent - it mustn't never appear).
766f929 to
f5c4d74
Compare
b654537 to
954c0ae
Compare
|
Changes done. Complete refactoring and added the option of grouping by analytical account in an extra commit. |
035ed43 to
f797579
Compare
55f272e to
5ea6a1f
Compare
|
Finally all changes are done and tested in a customer use case. |
pedrobaeza
left a comment
There was a problem hiding this comment.
The refactoring is not successful, as the idea is to reduce the number or methods and arguments, and I still see a lot of both. When I told you #1151 (comment), it was to remove all the parameters except one. And I think most of the domains can be shared and reduced, as it's the same over and over...
| trial_balance = res_data["trial_balance"] | ||
| check_partner_receivable = self.check_partner_in_report( | ||
| self.account100.id, self.partner.id, total_amount | ||
| self.account100.id, self.partner.id, trial_balance |
There was a problem hiding this comment.
Can you use fixed amounts? These tests are wicked this way.
There was a problem hiding this comment.
Fixed amounts? This was (and is) trying to pull the corresponding report line filtering by some data (account and partner).
5ea6a1f to
f25125a
Compare
This refactoring is not enough? If you prefer i can delete the report completely and do it again, or change it as much as you want with many more hours, but the problem will always be the same, there is NOT enough data (neither in the tests nor creating them manually) to test that all the use cases work correctly and nothing is broken, so you always have to test these changes in "real environments", the same happens with other reports, it is absolutely frustrating. |
9216b90 to
7d678a9
Compare
…Trial Balance report TT48969
7d678a9 to
40c2975
Compare
|
New approach done (3rd) with a clear objective: not to change the existing behavior, only to add a new one. Changes done (and the reason):
|
| <t t-call="account_financial_report.report_trial_balance_filters" /> | ||
| <div class="act_as_table list_table" style="margin-top: 10px;" /> | ||
| <!-- Display account lines --> | ||
| <t t-set="aml_domain_extra" t-value="[]" /> |
There was a problem hiding this comment.
Instead of having to add this extra domain everywhere, can't we add the extra bits in the already present domain variable?
There was a problem hiding this comment.
I have changed to add aml_domain_extra only where it is really needed.
Just for clarification, you want to then add all this code:
<t
t-set="aml_domain_extra"
t-if="grouped_item['id'] > 0"
t-value="[('analytic_account_id', '=', grouped_item['id'])]"
/>
<t
t-set="aml_domain_extra"
t-else=""
t-value="[('analytic_account_id', '=', False)]"
/>
in the 7 places where aml_domain_extra is currently added (in this case I have set global variable precisely to reduce code and do the same thing that aml_domain_common does for example).
|
Hello, Functionally it is correct. I have tested it. Greetings |
… Trial balance TT48969
40c2975 to
950a214
Compare
|
Ping @pedrobaeza |
|
This PR looks fantastic, let's merge it! |
|
Congratulations, your PR was merged at 259ab9f. Thanks a lot for contributing to OCA. ❤️ |
Changes done:
Please @pedrobaeza can you review it?
@Tecnativa TT48969