~vauxoo/openerp-mexico-localization/l10n_mx_chart_of_accounts_v61_dev_negrin

« back to all changes in this revision

Viewing changes to account_tax_category/account_tax_category.py

[ADD] [account_tax_category]

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
# -*- encoding: utf-8 -*-
 
3
###########################################################################
 
4
#    Module Writen to OpenERP, Open Source Management Solution
 
5
#    Copyright (C) Vauxoo (<http://vauxoo.com>).
 
6
#    All Rights Reserved
 
7
###############Credits######################################################
 
8
#    Coded by: Carlos Funes(juan@vauxoo.com)
 
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 published by
 
12
#    the Free Software Foundation, either version 3 of the License, or
 
13
#    (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
from osv import fields, osv, orm
 
24
 
 
25
class account_tax_category(osv.osv):
 
26
    _name='account.tax.category'
 
27
    
 
28
    _columns = {
 
29
        'company_id': fields.many2one('res.company', 'Company', required=True),
 
30
        'name': fields.char('Name', size=64, required=True),
 
31
        'code': fields.char('Code', size=32, required=True),
 
32
        'active': fields.boolean('Active'),
 
33
        'sign': fields.integer('Sign'),
 
34
        'category_ids': fields.one2many('account.tax', 'tax_category_id', 'Category'),
 
35
        
 
36
    }
 
37
    
 
38
    _defaults = {
 
39
    'active': 1,
 
40
    'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'account.tax.category', context=c),
 
41
    }
 
42
    
 
43
account_tax_category()
 
44
 
 
45
class account_tax(osv.osv):
 
46
    _inherit = 'account.tax'
 
47
 
 
48
    _columns = {
 
49
        'tax_category_id': fields.many2one('account.tax.category','Tax Category',required=False),
 
50
    }
 
51
 
 
52
account_tax()