[IMP]stock:remove extra def
bzr revid: dbr@tinyerp.com-20120503052517-9bk8uha3rajbtupi
This commit is contained in:
parent
5ed1a8f646
commit
bbf00f1aa5
|
@ -342,8 +342,8 @@ class product_product(osv.osv):
|
|||
return res
|
||||
|
||||
_columns = {
|
||||
'reception_count': fields.function(_stock_picking_count , type='integer',string="Total Reception"),
|
||||
'delivery_count': fields.function(_stock_picking_count , type='integer',string="Total Delivery"),
|
||||
'reception_count': fields.function(_stock_picking_count , type='integer',string="Reception"),
|
||||
'delivery_count': fields.function(_stock_picking_count , type='integer',string="Delivery"),
|
||||
'qty_available': fields.function(_product_available, multi='qty_available',
|
||||
type='float', digits_compute=dp.get_precision('Product UoM'),
|
||||
string='Quantity On Hand',
|
||||
|
@ -461,61 +461,6 @@ class product_product(osv.osv):
|
|||
if fields.get('qty_available'):
|
||||
res['fields']['qty_available']['string'] = _('Produced Qty')
|
||||
return res
|
||||
def get_receptions(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
models_data = self.pool.get('ir.model.data')
|
||||
|
||||
form_view = models_data.get_object_reference(cr, uid, 'stock', 'view_picking_in_form')
|
||||
tree_view = models_data.get_object_reference(cr, uid, 'stock', 'view_picking_in_tree')
|
||||
search_view = models_data.get_object_reference(cr, uid, 'stock', 'view_picking_internal_search')
|
||||
product_id = self.browse(cr, uid, ids[0], context=context)
|
||||
domain =[('move_lines.product_id', '=', product_id.id),('type','=','in')]
|
||||
context.update({'default_type': 'internal', 'contact_display': 'partner_address', 'search_default_available': 1})
|
||||
|
||||
return {
|
||||
'name': _('Receptions'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree, form',
|
||||
'res_model': 'stock.picking',
|
||||
'domain': domain,
|
||||
'view_id': False,
|
||||
'views': [(tree_view and tree_view[1] or False, 'tree'),
|
||||
(form_view and form_view[1] or False, 'form'),
|
||||
(False, 'calendar'), (False, 'graph')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'context': context,
|
||||
'search_view_id': search_view and search_view[1] or False,
|
||||
'nodestroy': True,
|
||||
}
|
||||
|
||||
def get_deliveries(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
models_data = self.pool.get('ir.model.data')
|
||||
|
||||
form_view = models_data.get_object_reference(cr, uid, 'stock', 'view_picking_out_form')
|
||||
tree_view = models_data.get_object_reference(cr, uid, 'stock', 'view_picking_out_tree')
|
||||
search_view = models_data.get_object_reference(cr, uid, 'stock', 'view_picking_out_search')
|
||||
product_id = self.browse(cr, uid, ids[0], context=context)
|
||||
domain =[('move_lines.product_id', '=', product_id.id),('type','=','out')]
|
||||
context.update({'default_type': 'out', 'contact_display': 'partner_address'})
|
||||
|
||||
return {
|
||||
'name': _('Deliveries'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree, form',
|
||||
'res_model': 'stock.picking',
|
||||
'domain': domain,
|
||||
'view_id': False,
|
||||
'views': [(tree_view and tree_view[1] or False, 'tree'),
|
||||
(form_view and form_view[1] or False, 'form'),
|
||||
(False, 'calendar'), (False, 'graph')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'context':context,
|
||||
'search_view_id': search_view and search_view[1] or False,
|
||||
'nodestroy': True,
|
||||
}
|
||||
|
||||
product_product()
|
||||
|
||||
|
|
Loading…
Reference in New Issue