1
# -*- coding: utf-8 -*-
2
##############################################################################
4
# OpenERP, Open Source Management Solution
5
# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>)
6
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
8
# This program is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
10
# the Free Software Foundation, either version 3 of the License, or
11
# (at your option) any later version.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with this program. If not, see <http://www.gnu.org/licenses/>
21
##############################################################################
23
from osv import osv, fields
26
class res_company(osv.osv):
28
Add check printing options check_layout, currency_format and check language on company
30
_inherit = "res.company"
32
def _get_language(self, cr, uid, context=None):
34
@param cr: current row of database
35
@param uid: id of user currently logged in
36
@param ids: ids of selected records
37
@param context: context
38
@return: list of tuple of the form (code, name)
40
lang_obj = self.pool.get('res.lang')
41
lang_ids = lang_obj.search(cr, uid, [('translatable', '=', True)], context=context)
42
langs = lang_obj.browse(cr, uid, lang_ids, context=context)
43
res = [(lang.code, lang.name) for lang in langs]
44
for lang_dict in tools.scan_languages():
45
if lang_dict not in res:
50
'check_layout': fields.selection([
51
('top', 'Check on Top'),
52
('middle', 'Check in middle'),
53
('bottom', 'Check on bottom'),
54
], "Choose Check layout",
55
help="Check on top is compatible with Quicken, QuickBooks and Microsoft Money. Check in middle is compatible with Peachtree,\
56
ACCPAC and DacEasy. Check on bottom is compatible with Peachtree, ACCPAC and DacEasy only"),
57
'currency_format': fields.selection([
59
('euro', 'Europian Format')
60
], 'Check Printing Format'),
61
'lang': fields.selection(_get_language, string='Check Print Language', size=16),
65
'check_layout': 'top',
66
'currency_format': 'us',
71
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: