diff --git a/addons/stock_picking_wave/stock_picking_wave.py b/addons/stock_picking_wave/stock_picking_wave.py
index fea3518061b..7be588bf014 100644
--- a/addons/stock_picking_wave/stock_picking_wave.py
+++ b/addons/stock_picking_wave/stock_picking_wave.py
@@ -4,6 +4,7 @@ from openerp.tools.translate import _
class stock_picking_wave(osv.osv):
_name = "stock.picking.wave"
+ _order = "name desc"
_columns = {
'name': fields.char('name', required=True, help='Name of the picking wave'),
'partner_id': fields.many2one('res.partner', 'Responsible', help='Person responsible for this wave'),
@@ -11,7 +12,7 @@ class stock_picking_wave(osv.osv):
'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'),
- 'state': fields.selection([('in_progress', 'Running'), ('done', 'Done')], required=True),
+ 'state': fields.selection([('in_progress', 'Running'), ('done', 'Done'), ('cancel', 'Cancelled')], required=True),
}
_defaults = {
'name': '/',
@@ -24,7 +25,8 @@ class stock_picking_wave(osv.osv):
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)
- return self.pool.get('stock.picking').action_cancel(cr, uid, picking_todo, context=context)
+ self.pool.get('stock.picking').action_cancel(cr, uid, picking_todo, context=context)
+ return self.write(cr, uid, ids, {'state': 'cancel'}, context=context)
def print_picking(self, cr, uid, ids, context=None):
'''
diff --git a/addons/stock_picking_wave/stock_picking_wave_sequence.xml b/addons/stock_picking_wave/stock_picking_wave_sequence.xml
new file mode 100644
index 00000000000..f328e437514
--- /dev/null
+++ b/addons/stock_picking_wave/stock_picking_wave_sequence.xml
@@ -0,0 +1,17 @@
+
+