1
# -*- coding: utf-8 -*-
2
##############################################################################
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>)
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.
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.
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/>
21
##############################################################################
24
from osv import fields, osv
25
from tools.translate import _
29
class assigned_picker(osv.osv_memory):
30
_name = "stock.assigned.picker"
31
_description = "Summary Report"
33
'name':fields.many2one('res.users','User'),
34
'read_only':fields.boolean('Make Read only'),
36
def _get_default_name(self, cr, uid, context=None):
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']
43
_defaults={'name':_get_default_name,
44
'read_only':_get_default,
46
def print_report(self, cr, uid, ids, context=None):
47
data = self.browse(cr, uid, ids[0], context=context)
49
'type': 'ir.actions.report.xml',
50
'report_name':"pick_list.report",
53
'id': data.name and data.name.id or False,
54
'ids': data.name and [data.name.id] or [],
65
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: