[IMP] search views: more generic name for saved filters
[odoo/odoo.git] / addons / l10n_ch / account_wizard.py
1 # -*- coding: utf-8 -*-
2 ##############################################################################
3 #
4 #    Author: Nicolas Bessi. Copyright Camptocamp SA
5 #    Financial contributors: Hasa SA, Open Net SA,
6 #                            Prisme Solutions Informatique SA, Quod SA
7 #
8 #    Translation contributors: brain-tec AG, Agile Business Group
9 #
10 #    This program is free software: you can redistribute it and/or modify
11 #    it under the terms of the GNU Affero General Public License as
12 #    published by the Free Software Foundation, either version 3 of the
13 #    License, or (at your option) any later version.
14 #
15 #    This program is distributed in the hope that it will be useful,
16 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
17 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 #    GNU Affero General Public License for more details.
19 #
20 #    You should have received a copy of the GNU Affero General Public License
21 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
22 #
23 ##############################################################################
24 from openerp.osv.orm import TransientModel
25
26 class WizardMultiChartsAccounts(TransientModel):
27
28     _inherit ='wizard.multi.charts.accounts'
29
30     def onchange_chart_template_id(self, cursor, uid, ids, chart_template_id=False, context=None):
31         if context is None: context = {}
32         res = super(WizardMultiChartsAccounts, self).onchange_chart_template_id(cursor, uid, ids,
33                                                                                 chart_template_id=chart_template_id,
34                                                                                 context=context)
35         # 0 is evaluated as False in python so we have to do this
36         # because original wizard test code_digits value on a float widget
37         if chart_template_id:
38             sterchi_template = self.pool.get('ir.model.data').get_object(cursor, uid, 'l10n_ch', 'l10nch_chart_template')
39             if sterchi_template.id == chart_template_id:
40                 res['value']['code_digits'] = 0
41         return res
42
43
44 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: