~serpent-consulting-services/openerp-usa/shipping_api_6-1

« back to all changes in this revision

Viewing changes to stock_assigned_picker/wizard/pick_list_report_wizard.py

  • Committer: npgllc
  • Date: 2012-08-02 17:13:27 UTC
  • Revision ID: npgllc-20120802171327-2xgyyjjb5d1kx26y
Removed all the 6.0 compatible modules

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- coding: utf-8 -*-
2
 
##############################################################################
3
 
#
4
 
#    OpenERP, Open Source Management Solution
5
 
#    Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>)
6
 
#    Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
7
 
#
8
 
#    This program is free software: you can redistribute it and/or modify
9
 
#    it under the terms of the GNU General Public License as published by
10
 
#    the Free Software Foundation, either version 3 of the License, or
11
 
#    (at your option) any later version.
12
 
#
13
 
#    This program is distributed in the hope that it will be useful,
14
 
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 
#    GNU General Public License for more details.
17
 
#
18
 
#    You should have received a copy of the GNU General Public License
19
 
#    along with this program.  If not, see <http://www.gnu.org/licenses/>
20
 
#
21
 
##############################################################################
22
 
 
23
 
import pooler
24
 
from osv import fields, osv
25
 
from tools.translate import _
26
 
import tools
27
 
 
28
 
 
29
 
class assigned_picker(osv.osv_memory):
30
 
    _name = "stock.assigned.picker"
31
 
    _description = "Summary Report"
32
 
    _columns = {
33
 
                'name':fields.many2one('res.users','User'),
34
 
                'read_only':fields.boolean('Make Read only'),
35
 
    }
36
 
    def _get_default_name(self, cr, uid, context=None):
37
 
        return uid
38
 
    def _get_default(self, cr, uid, context=None):
39
 
        mod_data_ids = self.pool.get('ir.model.data').search(cr,uid,[('name','=','group_stock_manager'),('model','=','res.groups')])
40
 
        group_id = self.pool.get('ir.model.data').read(cr,uid,mod_data_ids,['res_id'])[0]['res_id']
41
 
        users = self.pool.get('res.groups').read(cr,uid,group_id,['users'])['users']
42
 
        return uid in users
43
 
    _defaults={'name':_get_default_name,
44
 
              'read_only':_get_default,
45
 
              }
46
 
    def print_report(self, cr, uid, ids, context=None):
47
 
        data = self.browse(cr, uid, ids[0], context=context)
48
 
        return {
49
 
        'type': 'ir.actions.report.xml',
50
 
        'report_name':"pick_list.report",
51
 
        'datas': {
52
 
                'model':'res.users',
53
 
                'id': data.name and data.name.id or False,
54
 
                'ids': data.name and [data.name.id] or [],
55
 
                'report_type': 'pdf',
56
 
            },
57
 
        'nodestroy': False,
58
 
        'context':context,
59
 
        }
60
 
assigned_picker()
61
 
 
62
 
 
63
 
 
64
 
 
65
 
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
66