[REF] [stock] removed mx.DateTime from stock module
bzr revid: rvalyi@gmail.com-20100301050514-0dq2xgpypxw52hbj
This commit is contained in:
parent
fca1d230e4
commit
45edbf48b9
|
@ -19,7 +19,8 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
from mx import DateTime
|
||||
from datetime import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
import osv
|
||||
import time
|
||||
|
@ -76,7 +77,7 @@ class report_stock(report_int):
|
|||
"group by date_planned,product_id",(('confirmed','assigned','waiting'),loc_ids ,product_ids,))
|
||||
for (qty, dt, prod_id) in cr.fetchall():
|
||||
if dt<=dt_from:
|
||||
dt= (DateTime.now() + DateTime.RelativeDateTime(days=1)).strftime('%Y-%m-%d')
|
||||
dt= (datetime.now() + relativedelta(days=1)).strftime('%Y-%m-%d')
|
||||
else:
|
||||
dt = dt[:10]
|
||||
products.setdefault(prod_id, [])
|
||||
|
@ -91,7 +92,7 @@ class report_stock(report_int):
|
|||
|
||||
for (qty, dt, prod_id) in cr.fetchall():
|
||||
if dt<=dt_from:
|
||||
dt= (DateTime.now() + DateTime.RelativeDateTime(days=1)).strftime('%Y-%m-%d')
|
||||
dt= (datetime.now() + relativedelta(days=1)).strftime('%Y-%m-%d')
|
||||
else:
|
||||
dt = dt[:10]
|
||||
products.setdefault(prod_id, [])
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
from mx.DateTime import *
|
||||
from pychart import *
|
||||
import pychart.legend
|
||||
import time
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
from mx import DateTime
|
||||
from datetime import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
from osv import fields, osv
|
||||
from tools import config
|
||||
from tools.translate import _
|
||||
|
@ -1169,8 +1171,8 @@ class stock_move(osv.osv):
|
|||
if dest:
|
||||
if dest[1] == 'transparent':
|
||||
self.write(cr, uid, [m.id], {
|
||||
'date_planned': (DateTime.strptime(m.date_planned, '%Y-%m-%d %H:%M:%S') + \
|
||||
DateTime.RelativeDateTime(days=dest[2] or 0)).strftime('%Y-%m-%d'),
|
||||
'date_planned': (datetime.strptime(m.date_planned, '%Y-%m-%d %H:%M:%S') + \
|
||||
relativedelta(days=dest[2] or 0)).strftime('%Y-%m-%d'),
|
||||
'location_dest_id': dest[0].id})
|
||||
else:
|
||||
result.setdefault(m.picking_id, [])
|
||||
|
@ -1206,7 +1208,7 @@ class stock_move(osv.osv):
|
|||
'picking_id': pickid,
|
||||
'state': 'waiting',
|
||||
'move_history_ids': [],
|
||||
'date_planned': (DateTime.strptime(move.date_planned, '%Y-%m-%d %H:%M:%S') + DateTime.RelativeDateTime(days=delay or 0)).strftime('%Y-%m-%d'),
|
||||
'date_planned': (datetime.strptime(move.date_planned, '%Y-%m-%d %H:%M:%S') + relativedelta(days=delay or 0)).strftime('%Y-%m-%d'),
|
||||
'move_history_ids2': []}
|
||||
)
|
||||
self.pool.get('stock.move').write(cr, uid, [move.id], {
|
||||
|
|
Loading…
Reference in New Issue