mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[IMP] stock_quant_manual_assign: Delete picking operations to confirm the wizard of "quants Manual" and check availability.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
5
stock_quant_manual_assign/models/__init__.py
Normal file
5
stock_quant_manual_assign/models/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
##############################################################################
|
||||||
|
# For copyright and license notices, see __openerp__.py file in root directory
|
||||||
|
##############################################################################
|
||||||
|
from . import stock_picking
|
||||||
14
stock_quant_manual_assign/models/stock_picking.py
Normal file
14
stock_quant_manual_assign/models/stock_picking.py
Normal 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()
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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]]})
|
||||||
|
|||||||
Reference in New Issue
Block a user