[Fix] stock_location: Fixed pylint warnings

bzr revid: sbh@tinyerp.com-20101007042919-y4cq1qlpm59e210s
This commit is contained in:
sbh (Open ERP)
2010-10-07 09:59:19 +05:30
parent 73255bf09e
commit fa99a1d9c0
+7 -11
View File
@@ -18,13 +18,8 @@
#
##############################################################################
from osv import fields,osv
import tools
import ir
import pooler
from osv import osv
import netsvc
from mx import DateTime
import time
from tools.translate import _
class procurement_order(osv.osv):
@@ -56,6 +51,7 @@ class procurement_order(osv.osv):
proc_obj = self.pool.get('procurement.order')
move_obj = self.pool.get('stock.move')
location_obj = self.pool.get('stock.location')
picking_obj=self.pool.get('stock.picking')
wf_service = netsvc.LocalService("workflow")
for proc in proc_obj.browse(cr, uid, ids, context=context):
line = None
@@ -64,7 +60,7 @@ class procurement_order(osv.osv):
break
assert line, 'Line can not be False if we are on this state of the workflow'
origin = (proc.origin or proc.name or '').split(':')[0] +':'+line.name
picking_id = self.pool.get('stock.picking').create(cr, uid, {
picking_id =picking_obj.create(cr, uid, {
'origin': origin,
'company_id': line.company_id and line.company_id.id or False,
'type': line.picking_type,
@@ -74,7 +70,7 @@ class procurement_order(osv.osv):
'note': line.name, # TODO: note on procurement ?
'invoice_state': line.invoice_state,
})
move_id = self.pool.get('stock.move').create(cr, uid, {
move_id =move_obj.create(cr, uid, {
'name': line.name,
'picking_id': picking_id,
'company_id': line.company_id and line.company_id.id or False,
@@ -96,10 +92,10 @@ class procurement_order(osv.osv):
'note': line.name, # TODO: same as above
})
if proc.move_id and proc.move_id.state in ('confirmed'):
self.pool.get('stock.move').write(cr,uid, [proc.move_id.id], {
move_obj.write(cr,uid, [proc.move_id.id], {
'state':'waiting'
}, context=context)
proc_id = self.pool.get('procurement.order').create(cr, uid, {
proc_id = proc_obj.create(cr, uid, {
'name': line.name,
'origin': origin,
'company_id': line.company_id and line.company_id.id or False,
@@ -119,7 +115,7 @@ class procurement_order(osv.osv):
wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
if proc.move_id:
self.pool.get('stock.move').write(cr, uid, [proc.move_id.id],
move_obj.write(cr, uid, [proc.move_id.id],
{'location_id':proc.location_id.id})
self.write(cr, uid, [proc.id], {'state':'running','message':_('Moved from other location')})