-
Notifications
You must be signed in to change notification settings - Fork 27
/
loantype.py
executable file
·72 lines (67 loc) · 3.09 KB
/
loantype.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from openerp.osv import fields, osv
class account_loan_loantype(osv.osv):
_name = "account.loan.loantype"
_description = "account loan type "
_columns = {
'name' : fields.char('Type Name', size=32,required=True),
'prooftypes' : fields.many2many('account.loan.proof.type', 'loantype_prooftype_rel', 'order_line_id', 'tax_id', 'Taxes'),
'calculation':fields.selection(
[
('flat','Flat'),
('reducing','Reducing')
],'Calculation Method'),
'interestversion_ids' : fields.one2many('account.loan.loantype.interestversion','loantype_id','Interest Versions'),
}
account_loan_loantype()
class account_loan_loantype_interestversion(osv.osv):
_name='account.loan.loantype.interestversion'
_columns={
'name':fields.char('Name',size=32,required=True),
'loantype_id':fields.many2one('account.loan.loantype','Loan Type'),
'start_date':fields.date('Start Date'),
'end_date':fields.date('End Date'),
'active':fields.boolean('Active'),
'interestversionline_ids':fields.one2many('account.loan.loantype.interestversionline','interestversion_id','Current Interest Version'),
'sequence':fields.integer('Sequence',size=32),
}
_order = 'sequence'
_defaults = {
'active': lambda *a: True,
}
account_loan_loantype_interestversion()
class account_loan_loantype_interestversionline(osv.osv):
_name='account.loan.loantype.interestversionline'
_columns={
'name':fields.char('Interest ID',size=32,required=True),
'interestversion_id':fields.many2one('account.loan.loantype.interestversion','Loan Interest Id'),
'min_month' : fields.integer('Minimum Month',size=32),
'max_month' : fields.integer('Maximum Month',size=32),
'min_amount': fields.float('Minimum Amount', digits=(10,2)),
'max_amount': fields.float('Maximum Amount', digits=(10,2)),
'rate':fields.float('Rate',digits=(10,2)),
'sequence':fields.integer('Sequence',size=32),
}
_order = 'sequence'
account_loan_loantype_interestversionline()