Skip to Content
Menu
This question has been flagged
1 Reply
2664 Views

This ext_leav is not saving the data 

class HolidaysType(models.Model):

    _name = "hr.holidays.status"

virtual_remaining_leaves = fields.Float(compute='_compute_leaves', string='Virtual Remaining Leaves',

        help='Maximum Leaves Allowed - Leaves Already Taken - Leaves Waiting Approval')

class Holidays(models.Model):

    _name = "hr.holidays"

holiday_status_id = fields.Many2one("hr.holidays.status", string="Leave Type", required=True, readonly=True,

        states={'draft': [('readonly', False)], 'confirm': [('readonly', False)]})

ext_leav = fields.Float('Leaves Available2', related='holiday_status_id.virtual_remaining_leaves', readonly=True, use_parent_address=False,

        store=True,force_save="1")

Avatar
Discard
Best Answer

Hi,

You're referring to field : virtual_remaining_leaves which is not computed field and already not stored! this mean it is not exists on the table, so I think adding store = True to that field may solve your problem
Regards,
 

Avatar
Discard