'@param id: ids of a account.asset.asset objects
@return: Returns a dictionary of the effective dates of the last depreciation entry made for given asset ids. If there isn\'t any, return the purchase date of this asset'

@api.multi
def _get_last_depreciation_date(self):

    self.env.cr.execute('\n                                                SELECT    a.id    as    id,    COALESCE(MAX(m.date),a.date)    AS    date\n                                                FROM    account_asset_asset    a\n                                                LEFT    JOIN    account_asset_depreciation_line    rel    ON    (rel.asset_id    =    a.id)\n                                                LEFT    JOIN    account_move    m    ON    (rel.move_id    =    m.id)\n                                                WHERE    a.id    IN    %s\n                                                GROUP    BY    a.id,    m.date    ', (tuple(self.ids),))
    result = dict(self.env.cr.fetchall())
    return result
