stock_planning module create period wizard datetime object wrong usage

Bug #692899 reported by Jacara
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Medium
OpenERP R&D Addons Team 2

Bug Description

addons/stock_planning/wizard/stock_planning_create_periods.py line 38 : _get_new_period_start method

- period_start = datetime(last_date,"%Y-%m-%d %H:%M:%S")+ relativedelta(days=1)

+ period_start = datetime.strptime(last_date,"%Y-%m-%d %H:%M:%S")+ relativedelta(days=1)

Revision history for this message
Jacara (baskhuujacara) wrote :

More Error :

addons/stock_planning/wizard/stock_planning_create_periods.py line 74, 83, 92 :

- ds = ds + relativedelta(days=interval) + 1

+ ds = ds + relativedelta(days=interval + 1)

Revision history for this message
Azazahmed Saiyed (OpenERP) (saz-openerp) wrote :

Related Traceback is as Follows:

[2010-12-21 15:49:49,326][test] ERROR:web-services:Uncaught exception
Traceback (most recent call last):
  File "/home/tiny/trunk/openobject-server/bin/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/tiny/trunk/openobject-server/bin/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/tiny/trunk/openobject-server/bin/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/tiny/trunk/openobject-addons/stock_planning/wizard/stock_planning_create_periods.py", line 74, in create_stock_periods
    ds = ds + relativedelta(days=interval) + 1
TypeError: unsupported operand type(s) for +: 'datetime.datetime' and 'int'
[2010-12-21 15:50:21,702][test] ERROR:web-services:Uncaught exception
Traceback (most recent call last):
  File "/home/tiny/trunk/openobject-server/bin/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/tiny/trunk/openobject-server/bin/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/tiny/trunk/openobject-server/bin/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/tiny/trunk/openobject-addons/stock_planning/wizard/stock_planning_create_periods.py", line 83, in create_stock_periods
    ds = ds + relativedelta(days=interval) + 1
TypeError: unsupported operand type(s) for +: 'datetime.datetime' and 'int'

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Rohan Nayani(Open ERP) (ron-tinyerp) wrote :

Hello Jacara,
It has already fixed in lp:~openerp-dev/openobject-addons/ron-dev-addons2
Revision ID: <email address hidden>
Revision num: 5087.

It will be available in trunk soon,

Changed in openobject-addons:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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