1
# -*- encoding: utf-8 -*-
2
##############################################################################
4
# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
6
# This program is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU Affero General Public License as
8
# published by the Free Software Foundation, either version 3 of the
9
# License, or (at your option) any later version.
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU Affero General Public License for more details.
16
# You should have received a copy of the GNU Affero General Public License
17
# along with this program. If not, see http://www.gnu.org/licenses/.
19
##############################################################################
21
from osv import osv, fields
22
from tools.translate import _
28
class wizard_force_disponibility(osv.osv_memory):
29
_name = "wizard.force.disponibility"
30
_description = "Wizard Force Disponibility of Internal Picking"
32
_columns = {'name':fields.char('name', size=64),
35
'name': lambda *a:'a',
38
def internalpicking_force_disponibility(self, cr, uid, ids, context=None):
39
picking_obj = self.pool.get('stock.picking')
41
internal_picking_ids = context.get('active_ids')
42
if internal_picking_ids:
43
for picking in picking_obj.browse(cr,uid,internal_picking_ids):
44
if picking.type == 'internal' and picking.internal_type == 'input' and picking.state == 'confirmed':
45
picking_obj.force_assign(cr, uid, [picking.id])
47
return {'type': 'ir.actions.act_window_close'}
49
wizard_force_disponibility()
b'\\ No newline at end of file'