Hi
I need to make server action to create daily leave allocation record based on employee tags
i added the below python code to action server
def _daily_leaves(self):
duration = 5
leave = self.env['hr.holidays'].create({
'category_id': '1',
'holiday_status_id': status.id,
'type': 'add',
'holiday_type': 'category',
'number_of_days_temp': duration
})
leave.action_approve()
if leave.double_validation:
leave.action_validate()
and then i created scheduled action to trigar that action , the scheduled action
- Object:
ir.actions.server
- Method: _
run_actions
- Arguments:
([200],)
the server action ID
when i test the action it gives no error but no record added
could any help in that
Idea of server action in odoo: http://learnopenerp.blogspot.com/2020/01/odoo-server-action.html