def get_months_service_to_date(self, cr, uid, ids, dToday=None, context=None):
        '''Returns a dictionary of floats. The key is the employee id, and the value is
        number of months of employment.'''

        res = dict.fromkeys(ids, 0)
        if dToday == None:
            dToday = date.today()

        for ee in self.pool.get('hr.employee').browse(cr, uid, ids, context=context):

            delta = relativedelta(dToday, dToday)
            contracts = self._get_contracts_list(ee)
            if len(contracts) == 0:
                res[ee.id] = (0.0, False)
                continue

            dInitial = datetime.strptime(
                contracts[0].date_start, OE_DATEFORMAT).date()

            if ee.initial_employment_date:
                dFirstContract = dInitial
                dInitial = datetime.strptime(
                    ee.initial_employment_date, '%Y-%m-%d').date()
                if dFirstContract < dInitial:
                    raise osv.except_osv(_('Employment Date mismatch!'),
                                         _('The initial employment date cannot be after the first contract in the system.\nEmployee: %s', ee.name))

                delta = relativedelta(dFirstContract, dInitial)

            for c in contracts:
                dStart = datetime.strptime(c.date_start, '%Y-%m-%d').date()
                if dStart >= dToday:
                    continue

                # If the contract doesn't have an end date, use today's date
                # If the contract has finished consider the entire duration of
                # the contract, otherwise consider only the months in the
                # contract until today.
                #
                if c.date_end:
                    dEnd = datetime.strptime(c.date_end, '%Y-%m-%d').date()
                else:
                    dEnd = dToday
                if dEnd > dToday:
                    dEnd = dToday

                delta += relativedelta(dEnd, dStart)

            # Set the number of months the employee has worked
            date_part = float(delta.days) / float(
                self._get_days_in_month(dInitial))
            res[ee.id] = (
                float((delta.years * 12) + delta.months) + date_part, dInitial)

        return res