[ADD] add button to set inventory lines checked quantity to 0.
bzr revid: tpa@tinyerp.com-20130827102649-z9uvu8hw15hktjaf
This commit is contained in:
@@ -1691,6 +1691,12 @@ class stock_inventory(osv.osv):
|
||||
'location_id': _default_stock_location,
|
||||
}
|
||||
|
||||
def set_checked_qty(self , cr ,uid ,ids ,context=None):
|
||||
inventory = self.browse(cr, uid, ids[0], context=context)
|
||||
line_ids = [line.id for line in inventory.line_ids]
|
||||
self.pool.get('stock.inventory.line').write(cr, uid, line_ids, {'product_qty': 0})
|
||||
return True
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
if default is None:
|
||||
default = {}
|
||||
|
||||
@@ -131,6 +131,7 @@
|
||||
<field name="move_ids_exist" invisible="1"/>
|
||||
<notebook>
|
||||
<page string="Inventory Details" attrs="{'invisible':[('state','=','draft')]}">
|
||||
<button name="set_checked_qty" states="confirm" icon="gtk-go-forward" string="Set Checked Quantity to 0" type="object" class="oe_link oe_right" groups="stock.group_stock_user"/>
|
||||
<field name="line_ids" string="Inventory Details">
|
||||
<tree string="Inventory Details" editable="bottom" colors="blue: product_qty != real_qty">
|
||||
<field context="{'location':location_id, 'uom':product_uom_id, 'to_date':parent.date}" name="product_id" on_change="on_change_product_id(location_id,product_id,product_uom_id,parent.date)" domain="[('type','=','product')]"/>
|
||||
|
||||
Reference in New Issue
Block a user