Tryton - Issues



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

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

msg57911 (view) Author: [hidden] (risto3) Date: 2020-05-09.18:18:34
as indicated in, 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)
Date User Action Args
2020-05-09 18:18:35risto3create

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