mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-27 02:48:41 -06:00
[15.0][MIG] document_page_portal: Migration to 15.0 file fix
This commit is contained in:
parent
8760f4c40d
commit
79398e1a0f
@ -1,7 +1,6 @@
|
|||||||
# Copyright (C) 2020 - TODAY, Marcel Savegnago - Escodoo).
|
# Copyright (C) 2020 - TODAY, Marcel Savegnago - Escodoo).
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
|
||||||
from odoo import http
|
from odoo import http
|
||||||
from odoo.exceptions import AccessError, MissingError
|
from odoo.exceptions import AccessError, MissingError
|
||||||
from odoo.http import request
|
from odoo.http import request
|
||||||
@ -10,7 +9,6 @@ from odoo.tools.translate import _
|
|||||||
|
|
||||||
from odoo.addons.portal.controllers.portal import CustomerPortal, pager as portal_pager
|
from odoo.addons.portal.controllers.portal import CustomerPortal, pager as portal_pager
|
||||||
|
|
||||||
|
|
||||||
class CustomerPortal(CustomerPortal):
|
class CustomerPortal(CustomerPortal):
|
||||||
def _prepare_portal_layout_values(self):
|
def _prepare_portal_layout_values(self):
|
||||||
values = super(CustomerPortal, self)._prepare_portal_layout_values()
|
values = super(CustomerPortal, self)._prepare_portal_layout_values()
|
||||||
@ -73,7 +71,9 @@ class CustomerPortal(CustomerPortal):
|
|||||||
order = searchbar_sortings[sortby]["order"]
|
order = searchbar_sortings[sortby]["order"]
|
||||||
|
|
||||||
# archive groups - Default Group By 'create_date'
|
# archive groups - Default Group By 'create_date'
|
||||||
archive_groups = self._get_archive_groups("document.page", domain)
|
archive_groups = request.env["document.page"].read_group(
|
||||||
|
domain, ['create_date:month'], ['create_date:month']
|
||||||
|
)
|
||||||
if date_begin and date_end:
|
if date_begin and date_end:
|
||||||
domain += [
|
domain += [
|
||||||
("create_date", ">", date_begin),
|
("create_date", ">", date_begin),
|
||||||
@ -112,7 +112,7 @@ class CustomerPortal(CustomerPortal):
|
|||||||
"date": date_begin,
|
"date": date_begin,
|
||||||
"document_pages": document_pages,
|
"document_pages": document_pages,
|
||||||
"page_name": "document_page",
|
"page_name": "document_page",
|
||||||
"default_url": "/my/knowledge/s",
|
"default_url": "/my/knowledge/documents",
|
||||||
"pager": pager,
|
"pager": pager,
|
||||||
"archive_groups": archive_groups,
|
"archive_groups": archive_groups,
|
||||||
"searchbar_sortings": searchbar_sortings,
|
"searchbar_sortings": searchbar_sortings,
|
||||||
|
Loading…
Reference in New Issue
Block a user