diff --git a/stock_quant_manual_assign/__init__.py b/stock_quant_manual_assign/__init__.py index 307ef6e12..c1a24230c 100644 --- a/stock_quant_manual_assign/__init__.py +++ b/stock_quant_manual_assign/__init__.py @@ -1,20 +1,6 @@ - -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## -# -# 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 http://www.gnu.org/licenses/. -# +# For copyright and license notices, see __openerp__.py file in root directory ############################################################################## - +from . import models from . import wizard diff --git a/stock_quant_manual_assign/models/__init__.py b/stock_quant_manual_assign/models/__init__.py new file mode 100644 index 000000000..2dbb95a28 --- /dev/null +++ b/stock_quant_manual_assign/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## +from . import stock_picking diff --git a/stock_quant_manual_assign/models/stock_picking.py b/stock_quant_manual_assign/models/stock_picking.py new file mode 100644 index 000000000..14ae8ce68 --- /dev/null +++ b/stock_quant_manual_assign/models/stock_picking.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## +from openerp import models, api + + +class StockPicking(models.Model): + _inherit = 'stock.picking' + + @api.multi + def action_assign(self): + self.mapped('pack_operation_ids').unlink() + return super(StockPicking, self).action_assign() diff --git a/stock_quant_manual_assign/wizard/__init__.py b/stock_quant_manual_assign/wizard/__init__.py index fa7e09bfa..a7dec37e7 100644 --- a/stock_quant_manual_assign/wizard/__init__.py +++ b/stock_quant_manual_assign/wizard/__init__.py @@ -1,20 +1,5 @@ - -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## -# -# 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 http://www.gnu.org/licenses/. -# +# For copyright and license notices, see __openerp__.py file in root directory ############################################################################## - from . import assign_manual_quants diff --git a/stock_quant_manual_assign/wizard/assign_manual_quants.py b/stock_quant_manual_assign/wizard/assign_manual_quants.py index cee50fd03..e9d26cca7 100644 --- a/stock_quant_manual_assign/wizard/assign_manual_quants.py +++ b/stock_quant_manual_assign/wizard/assign_manual_quants.py @@ -1,22 +1,7 @@ - -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## -# -# 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 http://www.gnu.org/licenses/. -# +# For copyright and license notices, see __openerp__.py file in root directory ############################################################################## - from openerp import fields, models, api, exceptions, _ @@ -54,6 +39,7 @@ class AssignManualQuants(models.TransientModel): @api.multi def assign_quants(self): move = self.env['stock.move'].browse(self.env.context['active_id']) + move.picking_id.mapped('pack_operation_ids').unlink() quants = [] for quant_id in move.reserved_quant_ids.ids: move.write({'reserved_quant_ids': [[3, quant_id]]})