summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorksa (Open ERP) <ksa@tinyerp.co.in>2011-03-24 17:42:21 +0530
committerksa (Open ERP) <ksa@tinyerp.co.in>2011-03-24 17:42:21 +0530
commitfb49ab35b3287dee928003ec7aeef07fcede9fc5 (patch)
tree2d5db996b086ed9ff437af4e74d741e46e1d3358
parentf35a9899814a1c193f7eb296f1d2ee7e2de94e9c (diff)
[FIX]:Validation production lot in inventory
lp bug: https://launchpad.net/bugs/700928 fixed bzr revid: ksa@tinyerp.co.in-20110324121221-tqiy19z2v5aot0o9
-rw-r--r--addons/stock/stock.py4
-rw-r--r--addons/stock/stock_view.xml6
2 files changed, 7 insertions, 3 deletions
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index db5b3f677d3..75de38e2480 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -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()
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index d774d9a2327..bc692d9dcf7 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -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"