Tryton - Issues

 

Issue9318

Title aged balance has problem with months
Priority bug Status unread
Superseder Nosy List risto3
Type Components
Assigned To Keywords
Reviews

Created on 2020-05-09.18:18:35 by risto3, last changed by risto3.

Messages
msg57911 (view) Author: [hidden] (risto3) Date: 2020-05-09.18:18:34
as indicated in https://discuss.tryton.org/t/how-to-print-balance-by-party-by-account/1976/5, there appears to be a problem with dates at least when using months.

The following applied to get_unit_factor() seems to easily fix the issue:
@@ -2194,9 +2194,9 @@ class AgedBalance(ModelSQL, ModelView):
         context = Transaction().context
         unit = context.get('unit', 'day')
         if unit == 'month':
-            return datetime.timedelta(days=30)
+            return relativedelta(months=1)
         elif unit == 'day':
-            return datetime.timedelta(days=1)
+            return relativedelta(days=1)
History
Date User Action Args
2020-05-09 18:18:35risto3create

Showing 10 items. Show all history (warning: this could be VERY long)