Hello all,
I have two fields "fee_type" for Fees Type and "calculation_type". Type of both fields is selection.
fee_type = fields.Selection([('academic', 'Academic '), ('additional', 'Additional'),
('discount', 'Discount'),
('fines', 'Fines')], string='Type')
calculation_type = fields.Selection([('addition', 'Addition'), ('deduction', 'Deduction')],
string='Calculation Type', required=True)
I want that when I select fee_type as "Discount" then calculation_type should be set default to "Deduction".
Here is my code:
@api.onchange('calculation_type')
def _check_calc_type(self):
if self.fee_type == 'discount':
self.calculation_type = 'deduction'
it is not working.
plz help