From df8535fbd40e1e5c09dbe616a3332c76c23525c8 Mon Sep 17 00:00:00 2001 From: "Chrysanthe (chgo)" Date: Mon, 9 Oct 2023 11:55:47 +0200 Subject: [PATCH] [REF] portal, *: portal redesign *: base, account, account_payment, auth_top_portal, hr_timesheet, loyalty, mrp_subcontracting, payment, project, purchase, sale, sale_stock, sale_timesheet, website_crm_partner_assign, website_sale, website_slides Portal general redesign. Increase visual consistencies with the backend [1] and adapt to the new default website design [2]. [1] https://github.com/odoo/odoo/pull/116641 [2] https://github.com/odoo/odoo/pull/120302 task-3046004 Part-of: odoo/odoo#138077 --- addons/account/controllers/portal.py | 18 +- addons/account/static/src/img/Bill.svg | 13 ++ .../views/account_portal_templates.xml | 90 +++++--- .../views/account_portal_templates.xml | 22 +- .../static/tests/totp_portal.js | 4 +- addons/auth_totp_portal/views/templates.xml | 4 +- addons/hr_timesheet/static/img/timesheet.svg | 13 ++ .../views/hr_timesheet_portal_templates.xml | 11 +- .../views/project_task_portal_templates.xml | 17 +- addons/loyalty/static/img/portal-loyalty.svg | 14 ++ .../static/src/img/manufacturing.svg | 16 ++ .../views/subcontracting_portal_templates.xml | 13 +- addons/payment/static/img/payment-methods.svg | 11 + addons/payment/views/portal_templates.xml | 28 ++- .../static/src/img/portal-addresses.svg | 6 + .../static/src/img/portal-connection.svg | 13 ++ addons/portal/static/src/js/portal.js | 2 +- .../static/src/scss/bootstrap_overridden.scss | 2 + addons/portal/static/src/scss/portal.scss | 80 ++----- .../portal/static/src/xml/portal_chatter.xml | 56 ++--- addons/portal/views/portal_templates.xml | 204 +++++++++++------- addons/project/static/src/img/folder.svg | 13 ++ addons/project/static/src/img/tasks.svg | 22 ++ ...oject_portal_project_project_templates.xml | 19 +- .../project_portal_project_task_templates.xml | 126 ++++++----- addons/purchase/static/src/img/calculator.svg | 19 ++ addons/purchase/static/src/img/rfq.svg | 9 + .../static/src/js/purchase_portal_sidebar.js | 4 +- addons/purchase/views/portal_templates.xml | 95 ++++---- addons/sale/static/src/img/bag.svg | 9 + addons/sale/static/src/img/quotation.svg | 19 ++ .../sale/static/src/js/sale_portal_sidebar.js | 4 +- addons/sale/views/sale_portal_templates.xml | 158 +++++++------- .../views/sale_stock_portal_template.xml | 20 +- .../views/sale_timesheet_portal_templates.xml | 12 +- .../static/src/img/leads.svg | 10 + .../static/src/img/quotation.svg | 19 ++ .../website_crm_partner_assign_templates.xml | 178 ++++++++------- .../tests/tours/website_sale_complete_flow.js | 6 +- addons/website_sale/views/templates.xml | 6 +- .../tests/tours/slides_course_reviews.js | 2 +- .../base/views/ir_qweb_widget_templates.xml | 22 +- 42 files changed, 847 insertions(+), 562 deletions(-) create mode 100644 addons/account/static/src/img/Bill.svg create mode 100644 addons/hr_timesheet/static/img/timesheet.svg create mode 100644 addons/loyalty/static/img/portal-loyalty.svg create mode 100644 addons/mrp_subcontracting/static/src/img/manufacturing.svg create mode 100644 addons/payment/static/img/payment-methods.svg create mode 100644 addons/portal/static/src/img/portal-addresses.svg create mode 100644 addons/portal/static/src/img/portal-connection.svg create mode 100644 addons/project/static/src/img/folder.svg create mode 100644 addons/project/static/src/img/tasks.svg create mode 100644 addons/purchase/static/src/img/calculator.svg create mode 100644 addons/purchase/static/src/img/rfq.svg create mode 100644 addons/sale/static/src/img/bag.svg create mode 100644 addons/sale/static/src/img/quotation.svg create mode 100644 addons/website_crm_partner_assign/static/src/img/leads.svg create mode 100644 addons/website_crm_partner_assign/static/src/img/quotation.svg diff --git a/addons/account/controllers/portal.py b/addons/account/controllers/portal.py index 4779f84ce27..0cc3bd44cb2 100644 --- a/addons/account/controllers/portal.py +++ b/addons/account/controllers/portal.py @@ -16,9 +16,13 @@ class PortalAccount(CustomerPortal): def _prepare_home_portal_values(self, counters): values = super()._prepare_home_portal_values(counters) if 'invoice_count' in counters: - invoice_count = request.env['account.move'].search_count(self._get_invoices_domain()) \ + invoice_count = request.env['account.move'].search_count(self._get_invoices_domain('in'), limit=1) \ if request.env['account.move'].check_access_rights('read', raise_exception=False) else 0 values['invoice_count'] = invoice_count + if 'bill_count' in counters: + bill_count = request.env['account.move'].search_count(self._get_invoices_domain('out'), limit=1) \ + if request.env['account.move'].check_access_rights('read', raise_exception=False) else 0 + values['bill_count'] = bill_count return values # ------------------------------------------------------------ @@ -32,8 +36,12 @@ class PortalAccount(CustomerPortal): } return self._get_page_view_values(invoice, access_token, values, 'my_invoices_history', False, **kwargs) - def _get_invoices_domain(self): - return [('state', 'not in', ('cancel', 'draft')), ('move_type', 'in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))] + def _get_invoices_domain(self, m_type=None): + if m_type in ['in', 'out']: + move_type = [m_type+move for move in ('_invoice', '_refund', '_receipt')] + else: + move_type = ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt') + return [('state', 'not in', ('cancel', 'draft')), ('move_type', 'in', move_type)] def _get_account_searchbar_sortings(self): return { @@ -46,8 +54,8 @@ class PortalAccount(CustomerPortal): def _get_account_searchbar_filters(self): return { 'all': {'label': _('All'), 'domain': []}, - 'invoices': {'label': _('Invoices'), 'domain': [('move_type', 'in', ('out_invoice', 'out_refund'))]}, - 'bills': {'label': _('Bills'), 'domain': [('move_type', 'in', ('in_invoice', 'in_refund'))]}, + 'invoices': {'label': _('Invoices'), 'domain': [('move_type', 'in', ('out_invoice', 'out_refund', 'out_receipt'))]}, + 'bills': {'label': _('Bills'), 'domain': [('move_type', 'in', ('in_invoice', 'in_refund', 'in_receipt'))]}, } @http.route(['/my/invoices', '/my/invoices/page/'], type='http', auth="user", website=True) diff --git a/addons/account/static/src/img/Bill.svg b/addons/account/static/src/img/Bill.svg new file mode 100644 index 00000000000..51d1968db63 --- /dev/null +++ b/addons/account/static/src/img/Bill.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/addons/account/views/account_portal_templates.xml b/addons/account/views/account_portal_templates.xml index 51e7c70c7f5..18d680dd7bd 100644 --- a/addons/account/views/account_portal_templates.xml +++ b/addons/account/views/account_portal_templates.xml @@ -13,13 +13,28 @@