[IMP]:Stock:Set Button Check Qty

bzr revid: sunilsharma.sharma07@gmail.com-20130827100638-kh8qmle7fab9nkff
This commit is contained in:
Sunil Sharma (OpenERP Trainee) 2013-08-27 15:36:38 +05:30
parent 5b85b245b5
commit bfb37ae966
2 changed files with 7 additions and 0 deletions

View File

@ -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 = {}

View File

@ -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" 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">
<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')]"/>