1
# -*- encoding: utf-8 -*-
2
##############################################################################
4
# Copyright (c) 2007-2008 Sandas. (http://www.sandas.eu) All Rights Reserved.
6
# WARNING: This program as such is intended to be used by professional
7
# programmers who take the whole responsability of assessing all potential
8
# consequences resulting from its eventual inadequacies and bugs
9
# End users who are looking for a ready-to-use solution with commercial
10
# garantees and support are strongly adviced to contract a Free Software
13
# This program is Free Software; you can redistribute it and/or
14
# modify it under the terms of the GNU General Public License
15
# as published by the Free Software Foundation; either version 2
16
# of the License, or (at your option) any later version.
18
# This program is distributed in the hope that it will be useful,
19
# but WITHOUT ANY WARRANTY; without even the implied warranty of
20
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
# GNU General Public License for more details.
23
# You should have received a copy of the GNU General Public License
24
# along with this program; if not, write to the Free Software
25
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27
############################################################
32
class wiz_open_line_entry(wizard.interface):
33
def _open_line_entry(self, cr, uid, data, context):
34
pool = pooler.get_pool(cr.dbname)
35
lines = pool.get('personal.base.account.entry.line').browse(cr, uid, data['ids'])
40
model = l.parent_id.created_in_model_id
41
if model.id == l.parent_id.created_in_model_id.id:
42
ids.append(l.parent_id.id)
44
if model.model == 'personal.base.account.entry':
47
id_field_name = 'entry_id'
49
domain = "[('" + id_field_name + "','in', [" + ','.join(map(str,ids)) + "])"
50
if model.model == 'personal.base.account.entry':
51
domain = domain + ",('created_in_model_id', '=', %d)" % model.id
57
'view_mode': 'tree,form',
58
'res_model': model.model,
60
'type': 'ir.actions.act_window'
67
'result': {'type':'action', 'action':_open_line_entry, 'state':'end'}
70
wiz_open_line_entry('personal.base.account.open_line_entry')