In below example, I have written Python script to loan/invest demand fields. Use below python code in your .py file :
'date_start': fields.date('Start Date', states={'confirm': [('readonly', True)]}),
'date_stop': fields.date('Maturity Date', states={'confirm': [('readonly', True)]}),
'days': fields.integer('Interest Days', required=True, states={'confirm': [('readonly', True)]}),
'rate': fields.float('Interest Rate (%)', required=True, states={'confirm': [('readonly', True)]}),
'interest_payment': fields.selection([
('pre', 'In Advance'),
('post', 'On Maturity Date')],
'Interest Payment', required=True, states={'confirm': [('readonly', True)]}),
'day_count_basis': fields.selection([
('360', '360'),
('365', '365')],
'Day Count Basis', required=True, states={'confirm': [('readonly', True)]}),
'amount_main': fields.float('Transaction Amount', digits_compute=dp.get_precision('Account'), required=True, states={'confirm': [('readonly', True)]}),
'amount_cost': fields.float('Transaction Costs', digits_compute=dp.get_precision('Account'), required=True, states={'confirm': [('readonly', True)]}),
'bank_id': fields.many2one('res.partner.bank', 'Bank Account', required=True, states={'confirm': [('readonly', True)]},
change_default=True, help='Bank Account Number.'),
0 Comment(s)