[IMP] stock: Improved field name. Improvements suggested by buildbot.

bzr revid: uco@tinyerp.com-20101013064057-8cndun3fx00d165o
This commit is contained in:
uco (OpenERP)
2010-10-13 12:10:57 +05:30
parent 0417f582cf
commit 6ea7b8c81c
3 changed files with 7 additions and 37 deletions
+2 -2
View File
@@ -29,7 +29,7 @@ class stock_report_prodlots(osv.osv):
_description = "Stock report by production lots"
_auto = False
_columns = {
'name': fields.float('Quantity', readonly=True),
'qty': fields.float('Quantity', readonly=True),
'location_id': fields.many2one('stock.location', 'Location', readonly=True, select=True),
'product_id': fields.many2one('product.product', 'Product', readonly=True, select=True),
'prodlot_id': fields.many2one('stock.production.lot', 'Production lot', readonly=True, select=True),
@@ -43,7 +43,7 @@ class stock_report_prodlots(osv.osv):
location_id,
product_id,
prodlot_id,
sum(qty) as name
sum(qty) as qty
from (
select -max(sm.id) as id,
sm.location_id,
+4 -32
View File
@@ -25,7 +25,6 @@ from operator import itemgetter
from itertools import groupby
from osv import fields, osv
from tools import config
from tools.translate import _
import netsvc
import tools
@@ -835,7 +834,6 @@ class stock_picking(osv.osv):
""" Gets payment term from partner.
@return: Payment term
"""
partner_obj = self.pool.get('res.partner')
partner = picking.address_id.partner_id
return partner.property_payment_term and partner.property_payment_term.id or False
@@ -1101,8 +1099,6 @@ class stock_picking(osv.osv):
delivery moves with product_id, product_qty, uom
@return: Dictionary of values
"""
import pdb
#pdb.set_trace()
if context is None:
context = {}
else:
@@ -1112,15 +1108,10 @@ class stock_picking(osv.osv):
product_obj = self.pool.get('product.product')
currency_obj = self.pool.get('res.currency')
uom_obj = self.pool.get('product.uom')
price_type_obj = self.pool.get('product.price.type')
sequence_obj = self.pool.get('ir.sequence')
wf_service = netsvc.LocalService("workflow")
partner_id = partial_datas.get('partner_id', False)
address_id = partial_datas.get('address_id', False)
delivery_date = partial_datas.get('delivery_date', False)
for pick in self.browse(cr, uid, ids, context=context):
new_picking = None
new_moves = []
complete, too_many, too_few = [], [], []
move_product_qty = {}
prodlot_ids = {}
@@ -1194,7 +1185,7 @@ class stock_picking(osv.osv):
prodlot_id = prodlot_ids[move.id]
if prodlot_id:
defaults.update(prodlot_id=prodlot_id)
new_obj = move_obj.copy(cr, uid, move.id, defaults)
move_obj.copy(cr, uid, move.id, defaults)
move_obj.write(cr, uid, [move.id],
{
@@ -1306,7 +1297,7 @@ class stock_production_lot(osv.osv):
if locations:
cr.execute('''select
prodlot_id,
sum(name)
sum(qty)
from
stock_report_prodlots
where
@@ -1322,12 +1313,12 @@ class stock_production_lot(osv.osv):
locations = self.pool.get('stock.location').search(cr, uid, [('usage', '=', 'internal')])
cr.execute('''select
prodlot_id,
sum(name)
sum(qty)
from
stock_report_prodlots
where
location_id IN %s group by prodlot_id
having sum(name) '''+ str(args[0][1]) + str(args[0][2]),(tuple(locations),))
having sum(qty) '''+ str(args[0][1]) + str(args[0][2]),(tuple(locations),))
res = cr.fetchall()
ids = [('id', 'in', map(lambda x: x[0], res))]
return ids
@@ -1694,13 +1685,11 @@ class stock_move(osv.osv):
"""
moves = self.browse(cr, uid, ids)
self.write(cr, uid, ids, {'state': 'confirmed'})
i = 0
def create_chained_picking(self, cr, uid, moves, context=None):
new_moves = []
res_obj = self.pool.get('res.company')
picking_obj = self.pool.get('stock.picking')
move_obj = self.pool.get('stock.move')
if context is None:
context = {}
for picking, todo in self._chain_compute(cr, uid, moves, context=context).items():
@@ -1808,7 +1797,6 @@ class stock_move(osv.osv):
def setlast_tracking(self, cr, uid, ids, context=None):
tracking_obj = self.pool.get('stock.tracking')
tracking = context.get('tracking', False)
picking = self.browse(cr, uid, ids)[0].picking_id
if picking:
last_track = [line.tracking_id.id for line in picking.move_lines if line.tracking_id]
@@ -1888,9 +1876,7 @@ class stock_move(osv.osv):
These reference values should possibly be converted before being posted in Journals to adapt to the primary
and secondary currencies of the relevant accounts.
"""
product_obj=self.pool.get('product.product')
product_uom_obj = self.pool.get('product.uom')
price_type_obj = self.pool.get('product.price.type')
# by default the reference currency is that of the move's company
reference_currency_id = move.company_id.currency_id.id
@@ -1957,12 +1943,8 @@ class stock_move(osv.osv):
""" Makes the move done and if all moves are done, it will finish the picking.
@return:
"""
track_flag = False
partial_datas=''
picking_ids = []
product_uom_obj = self.pool.get('product.uom')
price_type_obj = self.pool.get('product.price.type')
product_obj = self.pool.get('product.product')
partial_obj=self.pool.get('stock.partial.picking')
partial_id=partial_obj.search(cr,uid,[])
if partial_id:
@@ -2253,20 +2235,12 @@ class stock_move(osv.osv):
like partner_id, address_id, delivery_date, delivery
moves with product_id, product_qty, uom
"""
import pdb
#pdb.set_trace()
res = {}
picking_obj = self.pool.get('stock.picking')
product_obj = self.pool.get('product.product')
currency_obj = self.pool.get('res.currency')
uom_obj = self.pool.get('product.uom')
price_type_obj = self.pool.get('product.price.type')
sequence_obj = self.pool.get('ir.sequence')
wf_service = netsvc.LocalService("workflow")
partner_id = partial_datas.get('partner_id', False)
address_id = partial_datas.get('address_id', False)
delivery_date = partial_datas.get('delivery_date', False)
new_moves = []
if context is None:
context = {}
@@ -2411,7 +2385,6 @@ class stock_inventory(osv.osv):
location_obj = self.pool.get('stock.location')
for inv in self.browse(cr, uid, ids):
move_ids = []
move_line = []
for line in inv.inventory_line_id:
pid = line.product_id.id
product_context.update(uom=line.product_uom.id)
@@ -2560,7 +2533,6 @@ class stock_picking_move_wizard(osv.osv_memory):
def action_move(self, cr, uid, ids, context=None):
move_obj = self.pool.get('stock.move')
picking_obj = self.pool.get('stock.picking')
account_move_obj = self.pool.get('account.move')
for act in self.read(cr, uid, ids):
move_lines = move_obj.browse(cr, uid, act['move_ids'])
for line in move_lines:
+1 -3
View File
@@ -35,7 +35,6 @@ class stock_partial_picking(osv.osv_memory):
pick_obj = self.pool.get('stock.picking')
if not context:
context={}
moveids = []
for pick in pick_obj.browse(cr, uid, context.get('active_ids', [])):
for m in pick.move_lines:
if m.state in ('done', 'cancel'):
@@ -155,7 +154,6 @@ class stock_partial_picking(osv.osv_memory):
pick_obj = self.pool.get('stock.picking')
if not context:
context={}
moveids = []
if 'date' in fields:
res.update({'date': time.strftime('%Y-%m-%d %H:%M:%S')})
for pick in pick_obj.browse(cr, uid, context.get('active_ids', [])):
@@ -210,7 +208,7 @@ class stock_partial_picking(osv.osv_memory):
'product_price' : getattr(partial, 'move%s_product_price'%(m.id)),
'product_currency': getattr(partial, 'move%s_product_currency'%(m.id)).id
})
res = pick_obj.do_partial(cr, uid, picking_ids, partial_datas, context=context)
pick_obj.do_partial(cr, uid, picking_ids, partial_datas, context=context)
return {}
stock_partial_picking()