[Regression] Account : wrong reference of library

Bug #651889 reported by Douwe Wullink (Dypalio)
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned

Bug Description

in account/report/account_report.py trunk revision 4139
on line 135 - TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'int'

determined that this is because of change from mx.datetime to datetime
mx.datetime allows int arithmetic while datetime does not.

suggested fix:
account/report/account_report.py, line 134.....

OLD:
                LIST_RANGES.append(today + " to " + last_month_date.strftime('%Y-%m-%d'))
                today = (last_month_date- 1).strftime('%Y-%m-%d')
                last_month_date = datetime.strptime(today, '%Y-%m-%d') - relativedelta(months=1)

NEW:
                LIST_RANGES.append(today + " to " + last_month_date.strftime('%Y-%m-%d'))
                today = (last_month_date - relativedelta(days=1)).strftime('%Y-%m-%d')
                last_month_date = datetime.strptime(today, '%Y-%m-%d') - relativedelta(months=1)

Related branches

Revision history for this message
Cristian Salamea (ovnicraft) wrote :

I confirm this bug, way to reproduced too is updating the account module from console

Changed in openobject-addons:
status: New → Confirmed
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Thanks for reporting guys.
It has been fixed by revision 4152 <email address hidden>.

summary: - account/report/account_report.py TypeError: unsupported operand type(s)
- for -: 'datetime.datetime' and 'int'
+ [Regression] Account : wrong reference of library
Changed in openobject-addons:
status: Confirmed → Fix Released
milestone: none → 6.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.