33
34
from osv import fields, osv
35
36
class tax_rebate_sections(osv.osv):
36
_name = "tax.rebate.sections"
37
_description = "Tax Rebate Sections"
39
'name': fields.char("Code", size=32),
40
'description': fields.char('Description', size=32),
42
'max_limit' : fields.float('Maximum Limit', digits=(12,2) ),
43
'deduction_inc': fields.boolean('Deduction from income'),
44
'dependency' : fields.one2many('tax.rebates', 'section_id', 'Dependent Tax Rebates'),
37
_name = "tax.rebate.sections"
38
_description = "Tax Rebate Sections"
40
'name': fields.char("Code", size=32),
41
'description': fields.char('Description', size=32),
43
'max_limit' : fields.float('Maximum Limit', digits=(12,2) ),
44
'deduction_inc': fields.boolean('Deduction from income'),
45
'dependency' : fields.one2many('tax.rebates', 'section_id', 'Dependent Tax Rebates'),
49
50
tax_rebate_sections()
51
52
class tax_rebates(osv.osv):
53
_description = "Tax Rebates"
55
'name': fields.char("Code", size=32),
56
'section_id': fields.many2one('tax.rebate.sections', 'Rebate Section ID' ),
57
'declaration_id': fields.many2one('employee.tax.declarations', 'Declaration ID' ),
58
'description': fields.char('Description', size=32),
54
_description = "Tax Rebates"
56
'name': fields.char("Code", size=32),
57
'section_id': fields.many2one('tax.rebate.sections', 'Rebate Section ID' ),
58
'declaration_id': fields.many2one('employee.tax.declarations', 'Declaration ID' ),
59
'description': fields.char('Description', size=32),
65
66
class employee_tax_declarations(osv.osv):
66
_name = "employee.tax.declarations"
67
_description = "Employee Tax Declarations"
69
'name': fields.char("Declaration Name", size=32),
67
_name = "employee.tax.declarations"
68
_description = "Employee Tax Declarations"
70
'name': fields.char("Declaration Name", size=32),
70
71
'employee_id': fields.many2one('hr.employee', 'Employee ID' ),
71
'status': fields.selection([('pending','Pending'), ('provided','Provided')], 'Status' ),
72
'rebate_code': fields.many2one('tax.rebates', 'Rebate code'),
73
'description': fields.char('Description', size=32),
74
'scheme_code': fields.char('Scheme Code', size=32),
75
'policy_no': fields.char('Policy/Account No.', size=32),
76
'premium_yr': fields.date('Premium for year'),
77
'amount': fields.float('Amount', digits=(12,2)),
78
'deduction_inc': fields.boolean('Deduction from income'),
79
'proof_recv': fields.boolean('Proof received'),
82
'name' : lambda *a: 'Tax Declaration',
83
'status': lambda *a: 'pending',
85
def onchange_rebate_code(self, cr, uid, ids, r_code):
86
result = {'value':{'description': False, 'deduction_inc': False}}
87
print 'r_code : ',r_code
88
tax_decl = self.pool.get('tax.rebates').browse(cr, uid, r_code)
89
if tax_decl.description:
90
result['value']['description'] = tax_decl.description
92
if tax_decl.section_id.deduction_inc:
93
result['value']['deduction_inc'] = tax_decl.section_id.deduction_inc
72
'status': fields.selection([('pending','Pending'), ('provided','Provided')], 'Status' ),
73
'rebate_code': fields.many2one('tax.rebates', 'Rebate code'),
74
'description': fields.char('Description', size=32),
75
'scheme_code': fields.char('Scheme Code', size=32),
76
'policy_no': fields.char('Policy/Account No.', size=32),
77
'premium_yr': fields.date('Premium for year'),
78
'amount': fields.float('Amount', digits=(12,2)),
79
'deduction_inc': fields.boolean('Deduction from income'),
80
'proof_recv': fields.boolean('Proof received'),
83
'name' : lambda *a: 'Tax Declaration',
84
'status': lambda *a: 'pending',
86
def onchange_rebate_code(self, cr, uid, ids, r_code):
87
result = {'value':{'description': False, 'deduction_inc': False}}
88
print 'r_code : ',r_code
89
tax_decl = self.pool.get('tax.rebates').browse(cr, uid, r_code)
90
if tax_decl.description:
91
result['value']['description'] = tax_decl.description
93
if tax_decl.section_id.deduction_inc:
94
result['value']['deduction_inc'] = tax_decl.section_id.deduction_inc
96
97
employee_tax_declarations()
98
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: