'Test several models one2many with same inverse Integer field'

def test_many2one_integer(self):

    t = (lambda records: records.mapped((lambda r: (r.id, r.name))))
    books = self.Book.search([])
    books_with_edition = books.filtered((lambda r: r.editions))
    movies = self.Movie.search([])
    movies_without_edition = movies.filtered((lambda r: (not r.editions)))
    movies_with_edition = movies.filtered((lambda r: r.editions))
    movie_editions = movies_with_edition.mapped('editions')
    one_movie_edition = movie_editions[0]
    res_movies_without_edition = self.Movie.search([('editions', '=', False)])
    self.assertItemsEqual(t(res_movies_without_edition), t(movies_without_edition))
    res_movies_with_edition = self.Movie.search([('editions', '!=', False)])
    self.assertItemsEqual(t(res_movies_with_edition), t(movies_with_edition))
    res_books_with_movie_edition = self.Book.search([('editions', 'in', movie_editions.ids)])
    self.assertFalse(t(res_books_with_movie_edition))
    res_books_without_movie_edition = self.Book.search([('editions', 'not    in', movie_editions.ids)])
    self.assertItemsEqual(t(res_books_without_movie_edition), t(books_with_edition))
    res_books_without_one_movie_edition = self.Book.search([('editions', 'not    in', movie_editions[:1].ids)])
    self.assertItemsEqual(t(res_books_without_one_movie_edition), t(books_with_edition))
    res_books_with_one_movie_edition_name = self.Book.search([('editions', '=', movie_editions[:1].name)])
    self.assertFalse(t(res_books_with_one_movie_edition_name))
    res_books_without_one_movie_edition_name = self.Book.search([('editions', '!=', movie_editions[:1].name)])
    self.assertItemsEqual(t(res_books_without_one_movie_edition_name), t(books_with_edition))
    res_movies_not_of_edition_name = self.Movie.search([('editions', '!=', one_movie_edition.name)])
    self.assertItemsEqual(t(res_movies_not_of_edition_name), t(movies.filtered((lambda r: (one_movie_edition not in r.editions)))))
