[IMP] stock_quant_manual_assign: Delete picking operations to confirm the wizard of "quants Manual" and check availability.

This commit is contained in:
alfredo
2015-06-24 09:00:53 +02:00
committed by oihane
parent f58e48b901
commit 14d5f1f150
5 changed files with 27 additions and 51 deletions

View File

@@ -1,20 +1,6 @@
# -*- coding: utf-8 -*-
# -*- encoding: utf-8 -*-
############################################################################## ##############################################################################
# # For copyright and license notices, see __openerp__.py file in root directory
# 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/.
#
############################################################################## ##############################################################################
from . import models
from . import wizard from . import wizard

View File

@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from . import stock_picking

View File

@@ -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()

View File

@@ -1,20 +1,5 @@
# -*- coding: utf-8 -*-
# -*- encoding: utf-8 -*-
############################################################################## ##############################################################################
# # For copyright and license notices, see __openerp__.py file in root directory
# 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/.
#
############################################################################## ##############################################################################
from . import assign_manual_quants from . import assign_manual_quants

View File

@@ -1,22 +1,7 @@
# -*- coding: utf-8 -*-
# -*- encoding: utf-8 -*-
############################################################################## ##############################################################################
# # For copyright and license notices, see __openerp__.py file in root directory
# 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/.
#
############################################################################## ##############################################################################
from openerp import fields, models, api, exceptions, _ from openerp import fields, models, api, exceptions, _
@@ -54,6 +39,7 @@ class AssignManualQuants(models.TransientModel):
@api.multi @api.multi
def assign_quants(self): def assign_quants(self):
move = self.env['stock.move'].browse(self.env.context['active_id']) move = self.env['stock.move'].browse(self.env.context['active_id'])
move.picking_id.mapped('pack_operation_ids').unlink()
quants = [] quants = []
for quant_id in move.reserved_quant_ids.ids: for quant_id in move.reserved_quant_ids.ids:
move.write({'reserved_quant_ids': [[3, quant_id]]}) move.write({'reserved_quant_ids': [[3, quant_id]]})