diff --git a/addons/stock_picking_wave/__init__.py b/addons/stock_picking_wave/__init__.py new file mode 100644 index 00000000000..5d412cbda31 --- /dev/null +++ b/addons/stock_picking_wave/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +import stock_picking_wave + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock_picking_wave/__openerp__.py b/addons/stock_picking_wave/__openerp__.py new file mode 100644 index 00000000000..f20f853d0c0 --- /dev/null +++ b/addons/stock_picking_wave/__openerp__.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': 'Stock Picking Waves', + 'version': '1.0', + 'category': 'Stock Management', + 'description': """ +This module adds the picking wave option in warehouse management. +================================================================= + """, + 'author': 'OpenERP SA', + 'website': 'http://www.openerp.com', + 'depends': ['stock'], + 'data': ['security/ir.model.access.csv', + 'stock_picking_wave_view.xml'], + 'demo': [], + 'installable': True, + 'auto_install': True, +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock_picking_wave/security/ir.model.access.csv b/addons/stock_picking_wave/security/ir.model.access.csv new file mode 100644 index 00000000000..ae988068499 --- /dev/null +++ b/addons/stock_picking_wave/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +stock_picking_wave,stock.picking.wave,model_stock_picking_wave,stock.group_stock_user,1,1,1,1 \ No newline at end of file diff --git a/addons/stock_picking_wave/stock_picking_wave.py b/addons/stock_picking_wave/stock_picking_wave.py new file mode 100644 index 00000000000..70c29a003cf --- /dev/null +++ b/addons/stock_picking_wave/stock_picking_wave.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +from openerp.osv import fields, osv + +class stock_picking_wave(osv.osv): + _name = "stock.picking.wave" + _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'), + '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) + return self.pool.get('stock.picking').action_done(cr, uid, picking_todo, context=context) + + 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) + + def print_picking(self, cr, uid, ids, context=None): + ''' + This function print the report for all picking_ids associated to the picking wave + ''' + picking_ids = [] + for wave in self.browse(cr, uid, ids, context=context): + picking_ids.append([picking.id for picking in wave.picking_ids]) + datas = { + 'ids': picking_ids, + 'model': 'stock.picking', + 'form': self.read(cr, uid, picking_ids, context=context) + } + return { + 'type': 'ir.actions.report.xml', + 'report_name': context.get('report', 'stock.picking.list'), + 'datas': datas, + 'nodestroy': True + } + + +class stock_picking(osv.osv): + _inherit = "stock.picking" + _columns = { + 'wave_id': fields.many2one('stock.picking.wave', 'Picking Wave', help='Picking wave associated to this picking'), + } +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock_picking_wave/stock_picking_wave_view.xml b/addons/stock_picking_wave/stock_picking_wave_view.xml new file mode 100644 index 00000000000..a0cfde33277 --- /dev/null +++ b/addons/stock_picking_wave/stock_picking_wave_view.xml @@ -0,0 +1,96 @@ + + + + picking.wave.form + stock.picking.wave + +
+ +
+
+ + + + + + + + + + + + + + + + + + +