[FIX]:Validation production lot in inventory

lp bug: https://launchpad.net/bugs/700928 fixed

bzr revid: ksa@tinyerp.co.in-20110324121221-tqiy19z2v5aot0o9
This commit is contained in:
ksa (Open ERP)
2011-03-24 17:42:21 +05:30
parent f35a989981
commit fb49ab35b3
2 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -2643,6 +2643,7 @@ class stock_inventory_line(osv.osv):
'company_id': fields.related('inventory_id','company_id',type='many2one',relation='res.company',string='Company',store=True, select=True, readonly=True),
'prod_lot_id': fields.many2one('stock.production.lot', 'Production Lot', domain="[('product_id','=',product_id)]"),
'state': fields.related('inventory_id','state',type='char',string='State',readonly=True),
'lot_id': fields.boolean('Track Lots'),
}
def on_change_product_id(self, cr, uid, ids, location_id, product, uom=False, to_date=False):
@@ -2657,8 +2658,9 @@ class stock_inventory_line(osv.osv):
if not uom:
prod = self.pool.get('product.product').browse(cr, uid, [product], {'uom': uom})[0]
uom = prod.uom_id.id
track_prod = prod.track_production
amount = self.pool.get('stock.location')._product_get(cr, uid, location_id, [product], {'uom': uom, 'to_date': to_date})[product]
result = {'product_qty': amount, 'product_uom': uom}
result = {'product_qty': amount, 'product_uom': uom, 'lot_id':track_prod}
return {'value': result}
stock_inventory_line()
+4 -2
View File
@@ -120,7 +120,8 @@
<field context="location=location_id,uom=product_uom,to_date=parent.date" name="product_id" on_change="on_change_product_id(location_id,product_id,product_uom,parent.date)" domain="[('type','&lt;&gt;','service')]"/>
<field name="product_qty"/>
<field name="product_uom"/>
<field name="prod_lot_id" groups="base.group_extended"/>
<field name="lot_id"/>
<field name="prod_lot_id" groups="base.group_extended" attrs="{'required':[('lot_id','=',True)]}"/>
<button name="%(stock.action_view_stock_inventory_line_split)d"
string="Split inventory lines" groups="base.group_extended"
type="action" icon="terp-stock_effects-object-colorize" states="draft,confirm"/>
@@ -133,7 +134,7 @@
<field name="product_qty"/>
<field name="product_uom"/>
<group colspan="2" col="4">
<field name="prod_lot_id" groups="base.group_extended"/>
<field name="prod_lot_id" groups="base.group_extended" attrs="{'required':[('lot_id','=',True)]}"/>
<button name="%(stock.action_view_stock_inventory_line_split)d"
string="Split inventory lines" groups="base.group_extended"
type="action" icon="terp-stock_effects-object-colorize"/>
@@ -1463,6 +1464,7 @@
<field name="prodlot_id" groups="base.group_extended"
context="{'location_id':location_id, 'product_id':product_id}"
domain="[('product_id','=?',product_id)]"
attrs="{'required':[('lot_id','=',True)]}"
on_change="onchange_lot_id(prodlot_id,product_qty, location_id, product_id, product_uom)" colspan="3"/>
<button name="%(track_line)d"
groups="base.group_extended"