1 # -*- coding: utf-8 -*-
2 ##############################################################################
4 # Author: Nicolas Bessi. Copyright Camptocamp SA
5 # Financial contributors: Hasa SA, Open Net SA,
6 # Prisme Solutions Informatique SA, Quod SA
8 # Translation contributors: brain-tec AG, Agile Business Group
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.
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.
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/>.
23 ##############################################################################
24 from openerp.osv.orm import TransientModel
26 class WizardMultiChartsAccounts(TransientModel):
28 _inherit ='wizard.multi.charts.accounts'
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,
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
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
44 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: