openerp-dev-web team mailing list archive
-
openerp-dev-web team
-
Mailing list archive
-
Message #04585
[Merge] lp:~openerp-dev/openobject-addons/trunk-bug-700928-ksa into lp:openobject-addons
Kirti Savalia(OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/trunk-bug-700928-ksa into lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
Related bugs:
Bug #700928 in OpenERP Addons: "Validation production lot in inventory"
https://bugs.launchpad.net/openobject-addons/+bug/700928
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-700928-ksa/+merge/54691
https://bugs.launchpad.net/openobject-addons/+bug/700928
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-700928-ksa/+merge/54691
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-bug-700928-ksa.
=== modified file 'stock/stock.py'
--- stock/stock.py 2011-03-17 17:33:16 +0000
+++ stock/stock.py 2011-03-24 12:18:38 +0000
@@ -2643,6 +2643,7 @@
'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 @@
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()
=== modified file 'stock/stock_view.xml'
--- stock/stock_view.xml 2011-01-31 04:55:23 +0000
+++ stock/stock_view.xml 2011-03-24 12:18:38 +0000
@@ -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','<>','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"
Follow ups