16 lines
635 B
Python
16 lines
635 B
Python
from odoo import models, fields
|
|
class RepaymentLine(models.Model):
|
|
_name = 'repayment.line'
|
|
_description = 'Repayment Schedule Line'
|
|
|
|
contract_id = fields.Many2one('loan.contract', string='Contract', ondelete='cascade', required=True)
|
|
installment = fields.Integer(string='Kỳ thứ')
|
|
due_date = fields.Date(string='Ngày đến hạn')
|
|
principal = fields.Float(string='Tiền gốc')
|
|
interest = fields.Float(string='Tiền lãi')
|
|
total = fields.Float(string='Tổng phải trả')
|
|
state = fields.Selection([
|
|
('draft', 'Chưa trả'),
|
|
('paid', 'Đã trả'),
|
|
], default='draft')
|