[IMP] Onchange on picking type in pos.config
bzr revid: jco@openerp.com-20140324125441-eh4wb77pwzop0zon
This commit is contained in:
parent
641fc49eeb
commit
2655798706
|
@ -162,6 +162,14 @@ class pos_config(osv.osv):
|
|||
'company_id': _get_default_company,
|
||||
}
|
||||
|
||||
|
||||
def onchange_picking_type_id(self, cr, uid, ids, picking_type_id, context=None):
|
||||
p_type_obj = self.pool.get("stock.picking.type")
|
||||
p_type = p_type_obj.browse(cr, uid, picking_type_id, context=context)
|
||||
if p_type.default_location_src_id and p_type.default_location_src_id.usage == 'internal' and p_type.default_location_dest_id and p_type.default_location_dest_id.usage == 'customer':
|
||||
return {'value': {'stock_location_id': p_type.default_location_src_id.id}}
|
||||
return False
|
||||
|
||||
def set_active(self, cr, uid, ids, context=None):
|
||||
return self.write(cr, uid, ids, {'state' : 'active'}, context=context)
|
||||
|
||||
|
|
|
@ -591,7 +591,8 @@
|
|||
<field name="name"/>
|
||||
</h1>
|
||||
<group col="4">
|
||||
<field name="picking_type_id" widget="selection" groups="stock.group_locations" /><!-- TODO Group? -->
|
||||
<field name="picking_type_id" widget="selection" groups="stock.group_locations"
|
||||
on_change="onchange_picking_type_id(picking_type_id)"/>
|
||||
<field name="stock_location_id" groups="stock.group_locations"/>
|
||||
<field name="pricelist_id" groups="product.group_sale_pricelist"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
|
|
Loading…
Reference in New Issue