[FIX] web: pager page on next/previous record

When browsing a form with a one2many / many2many field
with several pages, the one2many pager page was not reset
when going to the previous/next record, while the next/previous
record could not have multiple pages on its one2many/many2many,
and the page on which the user was on the former record could
not exist in the newly displayed record.

Besides, even if the page does exist, there is no reason
to display this new record X2many value from its first page.

It's the case anyway when you edit/save, it comes back to the first page.

opw-679092
This commit is contained in:
Denis Ledoux
2016-06-27 16:50:47 +02:00
parent d577eeaa6e
commit 9062c01c02
@@ -841,6 +841,7 @@ var FieldX2Many = AbstractManyField.extend({
self.is_loaded = self.is_loaded.then(function() {
var view = self.get_active_view();
if (view.type === "list") {
view.controller.page = 0;
return view.controller.reload_content();
} else if (view.controller.do_search) {
return view.controller.do_search(self.build_domain(), self.dataset.get_context(), []);