[IMP] Merged SSU's branch for stock module improvements
bzr revid: pso@tinyerp.com-20120829110740-c5323h72k16r9l3m
This commit is contained in:
@@ -970,7 +970,7 @@
|
||||
|
||||
<record id="view_picking_out_tree" model="ir.ui.view">
|
||||
<field name="name">stock.picking.out.tree</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="model">stock.picking.out</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="blue:state == 'draft';grey:state == 'cancel';red:state not in ('cancel', 'done') and min_date < current_date" string="Delivery Orders">
|
||||
<field name="name"/>
|
||||
|
||||
@@ -38,7 +38,6 @@ class stock_partial_picking_line(osv.TransientModel):
|
||||
res[tracklot.id] = tracking
|
||||
return res
|
||||
|
||||
|
||||
_name = "stock.partial.picking.line"
|
||||
_rec_name = 'product_id'
|
||||
_columns = {
|
||||
@@ -56,6 +55,21 @@ class stock_partial_picking_line(osv.TransientModel):
|
||||
'tracking': fields.function(_tracking, string='Tracking', type='boolean'),
|
||||
}
|
||||
|
||||
def onchange_product_id(self, cr, uid, ids, product_id, context=None):
|
||||
uom_id = False
|
||||
if product_id:
|
||||
product = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
|
||||
uom_id = product.uom_id.id
|
||||
return {'value': {'product_uom': uom_id}}
|
||||
|
||||
def _get_product_uom(self, cr, uid, context=None):
|
||||
product_uom = self.pool.get('ir.model.data').get_object(cr, uid, 'product', 'product_uom_unit')
|
||||
return product_uom.id
|
||||
|
||||
_defaults = {
|
||||
'product_uom': _get_product_uom,
|
||||
}
|
||||
|
||||
class stock_partial_picking(osv.osv_memory):
|
||||
_name = "stock.partial.picking"
|
||||
_description = "Partial Picking Processing Wizard"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<separator string="Transfer Products" name="product_separator"/>
|
||||
<field name="move_ids" context="{'hide_tracking': hide_tracking}">
|
||||
<tree editable="bottom" string="Product Moves">
|
||||
<field name="product_id" />
|
||||
<field name="product_id" on_change="onchange_product_id(product_id)"/>
|
||||
<field name="quantity" />
|
||||
<field name="product_uom" groups="product.group_uom"/>
|
||||
<field name="tracking" invisible="1"/>
|
||||
|
||||
Reference in New Issue
Block a user