1 # -*- encoding: utf-8 -*-
2 ##############################################################################
4 # Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
6 # $Id: sign_in_out.py 2871 2006-04-25 14:08:22Z fp $
8 # WARNING: This program as such is intended to be used by professional
9 # programmers who take the whole responsability of assessing all potential
10 # consequences resulting from its eventual inadequacies and bugs
11 # End users who are looking for a ready-to-use solution with commercial
12 # garantees and support are strongly adviced to contract a Free Software
15 # This program is Free Software; you can redistribute it and/or
16 # modify it under the terms of the GNU General Public License
17 # as published by the Free Software Foundation; either version 2
18 # of the License, or (at your option) any later version.
20 # This program is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write to the Free Software
27 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 ##############################################################################
37 'task_ids': {'relation':'project.task', 'type':'many2many', 'string':'Tasks selection'},
38 'timebox_to_id': {'relation':'project.gtd.timebox', 'type':'many2one', 'string':'Set to Timebox'},
39 'timebox_id': {'relation':'project.gtd.timebox', 'type':'many2one', 'string':'Get from Timebox'}
43 <form string="Timebox tasks selection" width="780">
44 <field name="timebox_id" required="1"/>
45 <field name="timebox_to_id" required="1"/>
46 <field name="task_ids" nolabel="1" colspan="4" height="450" domain="[('timebox_id','=',timebox_id),('state','=','open')]"/>
50 class wiz_timebox_fill(wizard.interface):
51 def _fill(self, cr, uid, data, context):
52 pool = pooler.get_pool(cr.dbname)
53 ids = pool.get('project.gtd.timebox').search(cr, uid, [('parent_id','=',data['id']),('user_id','=',uid)], context=context)
55 'timebox_id': ids and ids[0] or False,
56 'timebox_to_id': data['id']
59 def _process(self, cr, uid, data, context):
60 pool = pooler.get_pool(cr.dbname)
61 ids = data['form']['task_ids']
62 pool.get('project.task').write(cr, uid, ids[0][2], {'timebox_id':data['form']['timebox_to_id']})
74 ('process','Add to Timebox')
79 'actions' : [_process],
80 'result' : {'type':'state', 'state':'end'}
83 wiz_timebox_fill('project.gtd.timebox.fill')
85 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: