(self, domain, fall_back_to_next=False, commit=True)
Change primary location to next location from assigned_location_ids,
        if there are no more locations in assigned_location_ids, primary location is cleared
Change primary location to next location from assigned_location_ids,
        if there are no more locations in assigned_location_ids, primary location is cleared
Change primary location to next location from assigned_location_ids if there are no more locations in assigned_location_ids primary location is cleared
def unset_location(self, domain, fall_back_to_next=False, commit=True):
        """
        Change primary location to next location from assigned_location_ids,
        if there are no more locations in assigned_location_ids, primary location is cleared
        """
        membership = self.get_domain_membership(domain)
        old_location_id = membership.location_id
        if old_location_id:
            membership.assigned_location_ids.remove(old_location_id)
            self.get_sql_locations.reset_cache(self)
        if membership.assigned_location_ids and fall_back_to_next:
            membership.location_id = membership.assigned_location_ids[0]
        else:
            membership.location_id = None
        self.get_sql_location.reset_cache(self)
        if commit:
            self.save()
def unset_location ( self , domain , fall_back_to_next = False , commit = True ) : membership = self . get_domain_membership ( domain ) old_location_id = membership . location_id if old_location_id : membership . assigned_location_ids . remove ( old_location_id ) self . get_sql_locations . reset_cache ( self ) if membership . assigned_location_ids and fall_back_to_next : membership . location_id = membership . assigned_location_ids [ 0 ] else : membership . location_id = None self . get_sql_location . reset_cache ( self ) if commit : self . save ( )