1
# -*- encoding: utf-8 -*-
2
##############################################################################
4
# Copyright (c) Camptocamp (http://www.camptocamp.com) All Rights Reserved.
6
# author: awu ported by nbessi
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
##############################################################################
40
class wiz_account_detail(wizard.interface):
41
""" a wizard that display a report that list projects and their invoices
42
this wizard is inspired (/copied) from
43
the class wiz_invoices_from_proj in
44
addons/specific_fct/wizard/open_specific_invoices.py
48
def _get_select_projects_ids(self, cr, uid, data, context):
49
""" Return the list of projects selected before to call the wizard. """
51
if not len(data['ids']):
53
pool = pooler.get_pool(cr.dbname)
56
"SELECT id from account_analytic_account \
58
(",".join(map(str,data['ids'])),)
60
projects_ids = cr.fetchall()
63
raise wizard.except_wizard(
69
res = {'projects': [x[0] for x in projects_ids]}
73
def _get_print_projects_ids(self, cr, uid, data, context):
74
""" return the list of projects selected in the wizard's
75
first form that match the criterias """
78
projects_ids = data['form']['projects'][0][2]
79
open_only = data['form']['open_only']
80
supplier_too = data['form']['supplier_too']
82
values = {'ids': projects_ids,
83
'open_only': open_only,
84
'supplier_too': supplier_too,
89
_create_form = """<?xml version="1.0"?>
90
<form string="Get projects details">
91
<separator string="Filter By Project" colspan="4"/>
92
<field name="projects" colspan="4" nolabel="1"/>
93
<separator string="Filter Options" colspan="4"/>
94
<field name="open_only"/>
95
<field name="supplier_too"/>
103
'relation':'account.analytic.account'
106
'string':'Open Invoices Only',
110
'string':'Display Suppliers Invoices',
117
'actions' : [_get_select_projects_ids],
119
'type':'form', 'arch':_create_form,
120
'fields':_create_fields,
123
('print','Open Report')
128
'actions': [_get_print_projects_ids],
131
'report':'indicator.account.detail',
132
'get_id_from_action':True,
138
wiz_account_detail('indicator.account.detail')
b'\\ No newline at end of file'