2013-06-27 09:43:56 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from openerp.tools.translate import _
|
|
|
|
from openerp.osv import fields, osv
|
|
|
|
from openerp import workflow
|
|
|
|
|
2013-06-27 13:13:29 +00:00
|
|
|
class stock_picking_wave(osv.osv):
|
|
|
|
_name = "stock.picking.wave"
|
2013-06-27 09:43:56 +00:00
|
|
|
_columns = {
|
|
|
|
'name': fields.char('name', required=True, help='Name of the picking wave'),
|
2013-07-29 14:12:50 +00:00
|
|
|
'partner_id': fields.many2one('res.partner', 'Responsible', help='Person responsible for this wave'),
|
2013-06-27 09:43:56 +00:00
|
|
|
'time': fields.float('Time', help='Time it will take to perform the wave'),
|
|
|
|
'picking_ids': fields.one2many('stock.picking', 'wave_id', 'Pickings', help='List of picking associated to this wave'),
|
|
|
|
'capacity': fields.float('Capacity', help='The capacity of the transport used to get the goods'),
|
|
|
|
'capacity_uom': fields.many2one('product.uom', 'Unit of Measure', help='The Unity Of Measure of the transport capacity'),
|
|
|
|
}
|
|
|
|
|
|
|
|
def confirm_picking(self, cr, uid, ids, context=None):
|
|
|
|
picking_todo = self.pool.get('stock.picking').search(cr, uid, [('wave_id', 'in', ids)], context=context)
|
2013-07-29 14:12:50 +00:00
|
|
|
self.pool.get('stock.picking').action_done(cr, uid, picking_todo, context=context)
|
2013-06-27 09:43:56 +00:00
|
|
|
return True
|
|
|
|
|
|
|
|
def cancel_picking(self, cr, uid, ids, context=None):
|
|
|
|
picking_todo = self.pool.get('stock.picking').search(cr, uid, [('wave_id', 'in', ids)], context=context)
|
2013-07-29 14:12:50 +00:00
|
|
|
self.pool.get('stock.picking').action_cancel(cr, uid, picking_todo, context=context)
|
2013-06-27 09:43:56 +00:00
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
class stock_picking(osv.osv):
|
|
|
|
_inherit = "stock.picking"
|
2013-07-01 14:39:09 +00:00
|
|
|
_columns = {
|
|
|
|
'wave_id': fields.many2one('stock.picking.wave', 'Picking Wave', help='Picking wave associated to this picking'),
|
|
|
|
}
|