Hello,
I'm trying to make a module to manage travel leaves for employees.
What I need t do is adding extra float field in hr.employee module of 'available_tickets' . To be allocated from other module named "travel_request". How t do this?
Here's my code:
class hr_employee(osv.osv):
_inherit="hr.employee"
_columns = {
'available_tickets': fields.float("Available Tickets"),
}
class travel_request(osv.osv):
_name = 'travel.request'
def _get_tickets(self, cr, uid, ids, context=None):
emp_ticket = self.pool.get('hr.employee').browse(cr, uid, ids)
return emp_ticket.available_tickets
_columns = {
'no_tickets': fields.function(_get_tickets, string='Number of Tickets', type='float'),
}
But it didn't work.. any idea how to fix it?