~serpent-consulting-services/openerp-usa/shipping_api_6-1

« back to all changes in this revision

Viewing changes to account_check_writing/company.py

  • Committer: npgllc
  • Date: 2012-08-02 17:13:27 UTC
  • Revision ID: npgllc-20120802171327-2xgyyjjb5d1kx26y
Removed all the 6.0 compatible modules

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- coding: utf-8 -*-
2
 
##############################################################################
3
 
#
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>)
7
 
#
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.
12
 
#
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.
17
 
#
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/>
20
 
#
21
 
##############################################################################
22
 
 
23
 
from osv import osv, fields
24
 
import tools
25
 
 
26
 
class res_company(osv.osv):
27
 
    """
28
 
        Add check printing options check_layout, currency_format and check language on company
29
 
    """
30
 
    _inherit = "res.company"
31
 
 
32
 
    def _get_language(self, cr, uid, context=None):
33
 
        """
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)
39
 
        """
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:
46
 
                res.append(lang_dict)
47
 
        return res
48
 
 
49
 
    _columns = {
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([
58
 
            ('us', 'US Format'), 
59
 
            ('euro', 'Europian Format')
60
 
            ], 'Check Printing Format'),
61
 
        'lang': fields.selection(_get_language, string='Check Print Language', size=16),
62
 
        }
63
 
    
64
 
    _defaults = {
65
 
        'check_layout': 'top',
66
 
        'currency_format': 'us',
67
 
        }
68
 
    
69
 
res_company()
70
 
 
71
 
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: