~avanzosc-manufactuaring-team/avanzosc/manufacturing-6.0

« back to all changes in this revision

Viewing changes to mrp_master_extension/wizard/wizard_force_disponibility.py

  • Committer: alfredodelafuente
  • Date: 2013-11-13 14:34:45 UTC
  • Revision ID: alfredodelafuente@avanzosc.es-20131113143445-vta97484lk01r2yl
[MOD mrp_master_extension, mrp_advanced_operations]

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- encoding: utf-8 -*-
 
2
##############################################################################
 
3
#
 
4
#    Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
 
5
#
 
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.
 
10
#
 
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.
 
15
#
 
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/.
 
18
#
 
19
##############################################################################
 
20
 
 
21
from osv import osv, fields
 
22
from tools.translate import _
 
23
import time
 
24
import tools
 
25
import netsvc
 
26
 
 
27
 
 
28
class wizard_force_disponibility(osv.osv_memory):    
 
29
    _name = "wizard.force.disponibility"
 
30
    _description = "Wizard Force Disponibility of Internal Picking"
 
31
       
 
32
    _columns = {'name':fields.char('name', size=64),
 
33
                }
 
34
    _defaults = {
 
35
                 'name': lambda *a:'a',
 
36
                 }
 
37
    
 
38
    def internalpicking_force_disponibility(self, cr, uid, ids, context=None):
 
39
        picking_obj = self.pool.get('stock.picking')
 
40
        datas = {}
 
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])
 
46
 
 
47
        return {'type': 'ir.actions.act_window_close'}                     
 
48
 
 
49
wizard_force_disponibility()
 
 
b'\\ No newline at end of file'