-
-
Notifications
You must be signed in to change notification settings - Fork 623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[15.0][IMP][account_financial_report]: add custom intervals for aged partner report #1083
[15.0][IMP][account_financial_report]: add custom intervals for aged partner report #1083
Conversation
WIP |
9a73417
to
7dfbf94
Compare
@pedrobaeza could you please check it now? Thanks |
name = fields.Char(required=True) | ||
code = fields.Char(required=True) | ||
account_age_report_config_id = fields.Many2one("account.age.report.configuration") | ||
lower_limit = fields.Integer() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We talked here about putting only one value, so no need to check overlappings and missing gaps:
Configuration 1:
- 15
- 30
- 60
It means the first interval is from 0 to 15, the second from 16 to 30, and the third is 61+.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
class ResCompany(models.Model): | ||
_inherit = "res.company" | ||
|
||
age_partner_config_id = fields.Many2one( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't store this in company.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
default_age_partner_config_id = fields.Many2one( | ||
"account.age.report.configuration", | ||
related="company_id.age_partner_config_id", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't mix related and default_*
. A default is for all companies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -14,3 +14,5 @@ currency used in account move lines is properly shown. | |||
|
|||
In case that in an account has not been configured a second currency foreign | |||
currency balances are not available. | |||
|
|||
Invoicing / Settings / Invoicing / OCA Aged Report Configuration you will be able to set dynamic intervals that will appear on the Aged Partner Balance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go better redacted on CONFIGURE.rst. And please respect 80 cols limit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
return { | ||
0: {"header": _("Partner"), "field": "name", "width": 70}, | ||
1: { | ||
"header": _("Residual"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Residual and current columns should be respected, no matter the configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
"field_final_balance": "older", | ||
} | ||
if not report.age_partner_config_id: | ||
report_columns.update( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's better to use a hidden configuration (with active=False) with all these lines, and prevent its removal than hardcode all these lines. What do you think?
<div class="act_as_cell" style="width: 9.64%;">91 - 120 d.</div> | ||
<!--## older--> | ||
<div class="act_as_cell" style="width: 9.64%;">> 120 d.</div> | ||
<t t-if="not age_partner_config"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, it shouldn't be needed the if
, as it should be already got in the Python structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is not added, it will show all columns and it is not correct.
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}" | ||
/> | ||
</div> | ||
<t t-if="not age_partner_config"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same here: you shouldn't put an if.
@@ -216,30 +232,38 @@ | |||
</div> | |||
<!--## amount_residual--> | |||
<div class="act_as_cell" style="width: 6.00%;">Residual</div> | |||
<t t-if="not age_partner_config"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same...
> | ||
<t | ||
t-out="line['current']" | ||
<t t-if="not age_partner_config"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the same...
0c1f43c
to
fae7499
Compare
fae7499
to
6827961
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you resolve conflicts @carolinafernandez-tecnativa ?
af155c6
to
1b815a0
Compare
Done! |
a583107
to
0d75c78
Compare
New conflicts :( When you can @carolinafernandez-tecnativa |
0d75c78
to
36931c3
Compare
Thanks! |
a225669
to
c23b261
Compare
Tested on runboat, the limits are not working well. Check the example in http://oca-account-financial-reporting-15-0-pr1083-c23b2616a35d.runboat.odoo-community.org with "Test customer", that has an invoice with due date 2024-03-27, and when reporting for that date, the amount appears in both the "Current" column and in "5 days" one. And you have to overpass 10 days to see the amount in the column "10 days". I think that the computation is still based on superior limit, not on inferior one. |
0df362e
to
060727c
Compare
060727c
to
736c524
Compare
6242c40
to
441927a
Compare
Hi @pilarvargas-tecnativa could you please help us to validate? thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have run the test in runbot and the ranges in which the overdue invoices appear in the report are correct. Thanks 👍
441927a
to
7e08953
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally!
/ocabot merge minor
This PR has the |
1 similar comment
This PR has the |
On my way to merge this fine PR! |
Congratulations, your PR was merged at 351f10e. Thanks a lot for contributing to OCA. ❤️ |
@Tecnativa TT45574