summaryrefslogtreecommitdiff
path: root/odoo/tools/config.py
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2018-09-28 10:24:28 +0000
committerNicolas Martinelli <nim@odoo.com>2018-10-10 15:21:24 +0000
commit3c4f8533653d49198a73ab650b5aff24106ebdb1 (patch)
treefec089b8bbcdaf38317636283194ae9284a68a3f /odoo/tools/config.py
parent37d20240a9e85c2a79fae62dc5b8d869fe40549d (diff)
[FIX] account: aged partner report
Let's consider an aged partner balance with a period of 30 days as of 2019-02-08. The specific dates used in the report are: ``` python bisou = datetime.strptime('2019-02-08', "%Y-%m-%d").date() for x in [0, 1, 30, 31, 60, 61, 90, 91, 120, 121]: print(x, bisou + relativedelta(days=-x)) 0 2019-02-08 1 2019-02-07 30 2019-01-09 31 2019-01-08 60 2018-12-10 61 2018-12-09 90 2018-11-10 91 2018-11-09 120 2018-10-11 121 2018-10-10 ``` However, the current periods generated are incorrect: ``` {'name': '0-30', 'stop': '2019-02-08', 'start': '2019-01-09'} {'name': '30-60', 'stop': '2019-01-08', 'start': '2018-12-09'} {'name': '60-90', 'stop': '2018-12-08', 'start': '2018-11-08'} {'name': '90-120', 'stop': '2018-11-07', 'start': '2018-10-08'} {'name': '+120', 'stop': '2018-10-07', 'start': False} ``` There is a clear inconsistency between the name of the period and the date used. Moreover, the name is misleading: 0-30 includes the -0 date, while 30-60 doesn't include the -30 date. After the fix, the name and the periods are consistent. We also change the first period to 1-30 since including 0 would mean to include amounts which are not due yet. ``` {'name': '1-30', 'stop': '2019-02-07', 'start': '2019-01-09'} {'name': '31-60', 'stop': '2019-01-08', 'start': '2018-12-10'} {'name': '61-90', 'stop': '2018-12-09', 'start': '2018-11-10'} {'name': '91-120', 'stop': '2018-11-09', 'start': '2018-10-11'} {'name': '+120', 'stop': '2018-10-10', 'start': False} ``` opw-1886633 closes odoo/odoo#27294
Diffstat (limited to 'odoo/tools/config.py')
0 files changed, 0 insertions, 0 deletions