[IMP] Only do partial operations for available moves, domain on lot, fix group moves in purchase procurement group

bzr revid: jco@openerp.com-20130918153204-ettifcuet4sysbac
This commit is contained in:
Josse Colpaert 2013-09-18 17:32:04 +02:00
parent 2e088579c0
commit 0a158cf672
3 changed files with 3 additions and 3 deletions

View File

@ -739,7 +739,7 @@ class purchase_order(osv.osv):
stock_move = self.pool.get('stock.move')
new_group = False
if any([(x.group_id == False) for x in order_lines]):
if any([(not x.group_id) for x in order_lines]):
new_group = self.pool.get("procurement.group").create(cr, uid, {'name':order.name, 'partner_id': order.partner_id.id}, context=context)

View File

@ -831,7 +831,7 @@ class stock_picking(osv.osv):
#Find moves that correspond
if ops.product_id:
#TODO: Should have order such that things with lots and packings are searched first
move_ids = move_obj.search(cr, uid, [('picking_id','=',picking.id), ('product_id', '=', ops.product_id.id), ('remaining_qty', '>', 0.0)], context=context)
move_ids = move_obj.search(cr, uid, [('picking_id','=',picking.id), ('product_id', '=', ops.product_id.id), ('remaining_qty', '>', 0.0), ('state', '=', ['assigned'])], context=context)
qty_to_do = ops.product_qty
while qty_to_do > 0 and move_ids:
move = move_obj.browse(cr, uid, move_ids.pop(), context=context)

View File

@ -597,7 +597,7 @@
<tree editable="top">
<field name="product_id"/>
<field name="product_uom_id" groups="product.group_uom"/>
<field name="lot_id" groups="stock.group_production_lot"/>
<field name="lot_id" domain="[('product_id','=?', product_id)]" context="{'product_id': product_id}" groups="stock.group_production_lot"/>
<field name="package_id" groups="stock.group_tracking_lot"/>
<field name="owner_id" groups="stock.group_tracking_owner"/>
<field name="product_qty" attrs="{'required': [('product_id', '!=', False)]}"/>