'Force all attachments to be stored in the currently configured storage'

@api.model
def force_storage(self):

    if (not self.env.user._is_admin()):
        raise AccessError(_('Only    administrators    can    execute    this    action.'))
    domain = {'db': [('store_fname', '!=', False)], 'file': [('db_datas', '!=', False)]}[self._storage()]
    for attach in self.search(domain):
        attach.write({'datas': attach.datas})
    return True
