際際滷

際際滷Share a Scribd company logo
How to Add Sort Option in
Website Portal Odoo 17
Enterprise
Introduction
Enterprise
Odoo provides a versatile approach to improving the user
interface on our website portal by enabling the addition of
sorting features customized to our requirements.
In the "My Account" section of the website, there are
various options such as Sales Orders, Projects, Timesheets, and
more. We can view further details by selecting each menu item.
Steps
Enterprise
Steps for Adding the Sort Option in Odoo Website
1. Create a Custom Module
2. Define the Module Manifest
3. Extend the Model
4. Create a XML template
5. Create a controller
6. Update and Install the Module
Explanation
Enterprise
1. Create a Custom Module: Create a custom module, define
a new file with the desired functionality
2. Define the Module Manifest, Extend the Model:
Include the necessary metadata and dependencies, and
also extend the model.
Create a XML template
Enterprise
3. Create a XML template
Explanation
Enterprise
 This template changes the current portal breadcrumbs to
include a "Recruitment" breadcrumb entry. The entry
appears conditionally active and is linked based on the
variables page_name and recruitment.
 If page_name equals 'recruitment', the entry is shown. If
recruitment is true, it will be an active link.
 otherwise, it will appear as plain text.
 This setup enables users to access the "Recruitment" page
via the breadcrumb trail, ensuring a consistent and user-
friendly navigation experience.
Code
Enterprise
Explanation
Enterprise
 This code enhances the Odoo portal's home page by
adding a new menu item for "Recruitment."
 These changes enhance the portal's home page with a
user-friendly link to the "Recruitment" section, improving
navigation and accessibility for users.
Code
Enterprise
<template id="portal_my_home_recruitment_views" name="Recruitment">
<t t-call="portal.portal_layout">
<t t-set="breadcrumbs_searchbar" t-value="True"/>
<t t-call="portal.portal_searchbar">
<t t-set="title">Recruitment</t>
</t>
<t t-call="portal.portal_table">
<thead>
<tr class="active">
<th class="text-left">Applicant</th>
<th class="text-center">Create Date</th>
<th class="text-center">Job Position</th>
<th class="text-end">Status</th>
</tr>
</thead>
<t t-foreach="recruitment" t-as="record">
<tr>
<td class='text-left'>
<span t-field="record.partner_name"/>
</td>
<td class='text-center'>
<span t-field="record.create_date"/>
</td>
<td class='text-center'>
<span t-field="record.job_id.name"/>
</td>
<td class='text-end'>
<span t-field="record.stage_id.name"/>
</td>
</tr>
</t>
</t>
</t>
</template>
Explanation
Enterprise
This template extends the portal layout to add a "Recruitment"
page in the Odoo portal. The page includes:
1. A Search Bar: The search bar is enabled and a title is set to
"Recruitment".
2. A Table: A table with headers for Applicant, Create Date, Job
Position, and Status.
3. Dynamic Content: Each row in the table corresponds to a
recruitment record, displaying the applicant's name,
creation date, job position, and current status.
This setup provides a clear and organized way for users to view
recruitment details within the portal.
Create a controller
Enterprise
Explanation
Enterprise
 This class and method are used to extend the Odoo
customer portal to include recruitment data
 This allows users to see the number of recruitment
applications they are involved with when they access the
portal, enhancing the portal's functionality by integrating
recruitment information.
Create a controller
Enterprise
Explanation
Enterprise
 This method handles the display and sorting of recruitment records in
the Odoo portal. When a user accesses the recruitment page.
 Defines Routes: Specifies the URL routes it responds to, ensuring the
user is authenticated.
 Sorts Records: Provides sorting options for recruitment records by
date or status.
 Searches Records: Retrieves recruitment records for the current user,
applying the chosen sorting order.
 Renders Page: Passes the retrieved records and sorting options to the
specified template for rendering.
 This setup enhances the user experience by allowing users to easily
view and sort their recruitment records in the portal.
Enterprise
searchbar_sortings = {
'date': {'label': _('Date'), 'order': 'create_date desc'},
'stage': {'label': _('Status'), 'order': 'stage_id'},
}
 The searchbar_sortings dictionary is designed to define sorting
options for a search bar in a web application.
 Each key in the dictionary represents a sorting criterion, with 'date'
and 'stage' being the criteria in this example.
 The value associated with each key is another dictionary that
contains two entries: 'label' and 'order'.
 The 'label' is a user-friendly name for the sorting criterion.
 The 'order' specifies how the results should be ordered in the
database query.
SORT
Enterprise
 Verifying with this code if a value is specified for the 'sortby'
option. If not, we can then establish a default value. In this
instance, the default order for sorting the records is by the date
in descending order.
 This code checks if the 'sortby' option has a value. If it doesn't, a
default value is assigned. Here, the default sorting sequence for
the records is by date, in descending order.
if not sortby:
sortby = 'date'
order = searchbar_sortings[sortby]['order']
recruitment = request.env['hr.applicant'].sudo().search([
('user_id', '=', request.env.uid)], order=order)
Sort By
Enterprise
Enterprise
Conclusion
Hence this way we can use the default sort functionality of odoo add
extra parameters to our sort option of the search bar in the portal
page .
For More Info.
Check our company website for related blogs
and Odoo book.
Check our YouTube channel for
functional and technical videos in Odoo.
Enterprise
www.cybrosys.com

More Related Content

Similar to How to Add Sort Option in Website Portal Odoo 17 (20)

URLS and routing in odoo 18 - Odoo 際際滷s
URLS and routing in odoo 18 - Odoo 際際滷sURLS and routing in odoo 18 - Odoo 際際滷s
URLS and routing in odoo 18 - Odoo 際際滷s
Celine George
How to Create Cohort View in Odoo 17 - Odoo 17 際際滷s
How to Create Cohort View in Odoo 17 - Odoo 17 際際滷sHow to Create Cohort View in Odoo 17 - Odoo 17 際際滷s
How to Create Cohort View in Odoo 17 - Odoo 17 際際滷s
Celine George
User Profiles: I Didn't Know I Could Do That (Updated Demo)
User Profiles:  I Didn't Know I Could Do That (Updated Demo)User Profiles:  I Didn't Know I Could Do That (Updated Demo)
User Profiles: I Didn't Know I Could Do That (Updated Demo)
Stacy Deere
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
Celine George
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling
Sencha
Develop an App with the Odoo Framework
Develop an App with the Odoo FrameworkDevelop an App with the Odoo Framework
Develop an App with the Odoo Framework
Odoo
People Management Templates
People Management TemplatesPeople Management Templates
People Management Templates
seanwfielding
Supercharging your Organic CTR
Supercharging your Organic CTRSupercharging your Organic CTR
Supercharging your Organic CTR
Phil Pearce
Advance Sql Server Store procedure Presentation
Advance Sql Server Store procedure PresentationAdvance Sql Server Store procedure Presentation
Advance Sql Server Store procedure Presentation
Amin Uddin
How to Store Data on the Odoo 17 Website
How to Store Data on the Odoo 17 WebsiteHow to Store Data on the Odoo 17 Website
How to Store Data on the Odoo 17 Website
Celine George
Angular js quickstart
Angular js quickstartAngular js quickstart
Angular js quickstart
LinkMe Srl
How to Create & Manage a Dashboard Using OWL in Odoo 17
How to Create & Manage a Dashboard Using OWL in Odoo 17How to Create & Manage a Dashboard Using OWL in Odoo 17
How to Create & Manage a Dashboard Using OWL in Odoo 17
Celine George
TechDays 2013 Jari Kallonen: What's New WebForms 4.5
TechDays 2013 Jari Kallonen: What's New WebForms 4.5TechDays 2013 Jari Kallonen: What's New WebForms 4.5
TechDays 2013 Jari Kallonen: What's New WebForms 4.5
Tieturi Oy
Sales force certification-lab
Sales force certification-labSales force certification-lab
Sales force certification-lab
Amit Sharma
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
Joaquim Rocha
Alexandria ACM Student Chapter | Specification & Verification of Data-Centric...
Alexandria ACM Student Chapter | Specification & Verification of Data-Centric...Alexandria ACM Student Chapter | Specification & Verification of Data-Centric...
Alexandria ACM Student Chapter | Specification & Verification of Data-Centric...
AlexACMSC
Client Actions In Odoo 17 - Odoo 17 際際滷s
Client Actions In Odoo 17 - Odoo 17 際際滷sClient Actions In Odoo 17 - Odoo 17 際際滷s
Client Actions In Odoo 17 - Odoo 17 際際滷s
Celine George
Subscribed zuora forsalesforce training -section301-final
Subscribed zuora forsalesforce training -section301-finalSubscribed zuora forsalesforce training -section301-final
Subscribed zuora forsalesforce training -section301-final
Samuel Sharaf
An Overview of Owl Input Bindings in Odoo 16
An Overview of Owl Input Bindings in Odoo 16An Overview of Owl Input Bindings in Odoo 16
An Overview of Owl Input Bindings in Odoo 16
Celine George
MICROPROJECT_CSS resume.pdf client side scripting
MICROPROJECT_CSS resume.pdf client side scriptingMICROPROJECT_CSS resume.pdf client side scripting
MICROPROJECT_CSS resume.pdf client side scripting
vaijenathphad15
URLS and routing in odoo 18 - Odoo 際際滷s
URLS and routing in odoo 18 - Odoo 際際滷sURLS and routing in odoo 18 - Odoo 際際滷s
URLS and routing in odoo 18 - Odoo 際際滷s
Celine George
How to Create Cohort View in Odoo 17 - Odoo 17 際際滷s
How to Create Cohort View in Odoo 17 - Odoo 17 際際滷sHow to Create Cohort View in Odoo 17 - Odoo 17 際際滷s
How to Create Cohort View in Odoo 17 - Odoo 17 際際滷s
Celine George
User Profiles: I Didn't Know I Could Do That (Updated Demo)
User Profiles:  I Didn't Know I Could Do That (Updated Demo)User Profiles:  I Didn't Know I Could Do That (Updated Demo)
User Profiles: I Didn't Know I Could Do That (Updated Demo)
Stacy Deere
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
Celine George
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling
Sencha
Develop an App with the Odoo Framework
Develop an App with the Odoo FrameworkDevelop an App with the Odoo Framework
Develop an App with the Odoo Framework
Odoo
People Management Templates
People Management TemplatesPeople Management Templates
People Management Templates
seanwfielding
Supercharging your Organic CTR
Supercharging your Organic CTRSupercharging your Organic CTR
Supercharging your Organic CTR
Phil Pearce
Advance Sql Server Store procedure Presentation
Advance Sql Server Store procedure PresentationAdvance Sql Server Store procedure Presentation
Advance Sql Server Store procedure Presentation
Amin Uddin
How to Store Data on the Odoo 17 Website
How to Store Data on the Odoo 17 WebsiteHow to Store Data on the Odoo 17 Website
How to Store Data on the Odoo 17 Website
Celine George
Angular js quickstart
Angular js quickstartAngular js quickstart
Angular js quickstart
LinkMe Srl
How to Create & Manage a Dashboard Using OWL in Odoo 17
How to Create & Manage a Dashboard Using OWL in Odoo 17How to Create & Manage a Dashboard Using OWL in Odoo 17
How to Create & Manage a Dashboard Using OWL in Odoo 17
Celine George
TechDays 2013 Jari Kallonen: What's New WebForms 4.5
TechDays 2013 Jari Kallonen: What's New WebForms 4.5TechDays 2013 Jari Kallonen: What's New WebForms 4.5
TechDays 2013 Jari Kallonen: What's New WebForms 4.5
Tieturi Oy
Sales force certification-lab
Sales force certification-labSales force certification-lab
Sales force certification-lab
Amit Sharma
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
Joaquim Rocha
Alexandria ACM Student Chapter | Specification & Verification of Data-Centric...
Alexandria ACM Student Chapter | Specification & Verification of Data-Centric...Alexandria ACM Student Chapter | Specification & Verification of Data-Centric...
Alexandria ACM Student Chapter | Specification & Verification of Data-Centric...
AlexACMSC
Client Actions In Odoo 17 - Odoo 17 際際滷s
Client Actions In Odoo 17 - Odoo 17 際際滷sClient Actions In Odoo 17 - Odoo 17 際際滷s
Client Actions In Odoo 17 - Odoo 17 際際滷s
Celine George
Subscribed zuora forsalesforce training -section301-final
Subscribed zuora forsalesforce training -section301-finalSubscribed zuora forsalesforce training -section301-final
Subscribed zuora forsalesforce training -section301-final
Samuel Sharaf
An Overview of Owl Input Bindings in Odoo 16
An Overview of Owl Input Bindings in Odoo 16An Overview of Owl Input Bindings in Odoo 16
An Overview of Owl Input Bindings in Odoo 16
Celine George
MICROPROJECT_CSS resume.pdf client side scripting
MICROPROJECT_CSS resume.pdf client side scriptingMICROPROJECT_CSS resume.pdf client side scripting
MICROPROJECT_CSS resume.pdf client side scripting
vaijenathphad15

More from Celine George (20)

How to setup journals in Odoo 17 Accounting
How to setup journals in Odoo 17 AccountingHow to setup journals in Odoo 17 Accounting
How to setup journals in Odoo 17 Accounting
Celine George
How to handle the storage categories of the locations in Odoo 17
How to handle the storage categories of the locations in Odoo 17How to handle the storage categories of the locations in Odoo 17
How to handle the storage categories of the locations in Odoo 17
Celine George
How to Identify the Margin from the Sales Orders using Odoo 17
How to Identify the Margin from the Sales Orders using Odoo 17How to Identify the Margin from the Sales Orders using Odoo 17
How to Identify the Margin from the Sales Orders using Odoo 17
Celine George
Field Parameters in Odoo 18 - Odoo 18 際際滷s
Field Parameters in Odoo 18 - Odoo 18 際際滷sField Parameters in Odoo 18 - Odoo 18 際際滷s
Field Parameters in Odoo 18 - Odoo 18 際際滷s
Celine George
How to Invoice Shipping Cost to Customer in Odoo 17
How to Invoice Shipping Cost to Customer in Odoo 17How to Invoice Shipping Cost to Customer in Odoo 17
How to Invoice Shipping Cost to Customer in Odoo 17
Celine George
How to configure the retail shop in Odoo 17 Point of Sale
How to configure the retail shop in Odoo 17 Point of SaleHow to configure the retail shop in Odoo 17 Point of Sale
How to configure the retail shop in Odoo 17 Point of Sale
Celine George
How to process Interwarehouse and Intrawarehouse transfers in Odoo
How to process Interwarehouse and Intrawarehouse transfers in OdooHow to process Interwarehouse and Intrawarehouse transfers in Odoo
How to process Interwarehouse and Intrawarehouse transfers in Odoo
Celine George
How to manage Customer Tips with Odoo 17 Point Of Sale
How to manage Customer Tips with Odoo 17 Point Of SaleHow to manage Customer Tips with Odoo 17 Point Of Sale
How to manage Customer Tips with Odoo 17 Point Of Sale
Celine George
Analysis of Conf File Parameters in the Odoo 18
Analysis of Conf File Parameters in the Odoo 18Analysis of Conf File Parameters in the Odoo 18
Analysis of Conf File Parameters in the Odoo 18
Celine George
Purchase Analysis in Odoo 17 - Odoo 際際滷s
Purchase Analysis in Odoo 17 - Odoo 際際滷sPurchase Analysis in Odoo 17 - Odoo 際際滷s
Purchase Analysis in Odoo 17 - Odoo 際際滷s
Celine George
Analysis of Conf File Parameters in Odoo 17
Analysis of Conf File Parameters in Odoo 17Analysis of Conf File Parameters in Odoo 17
Analysis of Conf File Parameters in Odoo 17
Celine George
How to Manage Check Out Process in Odoo 17 Website
How to Manage Check Out Process in Odoo 17 WebsiteHow to Manage Check Out Process in Odoo 17 Website
How to Manage Check Out Process in Odoo 17 Website
Celine George
Managing Online Signature and Payment with Odoo 17
Managing Online Signature and Payment with Odoo 17Managing Online Signature and Payment with Odoo 17
Managing Online Signature and Payment with Odoo 17
Celine George
Recruitment in the Odoo 17 - Odoo 17 際際滷s
Recruitment in the Odoo 17 - Odoo 17 際際滷sRecruitment in the Odoo 17 - Odoo 17 際際滷s
Recruitment in the Odoo 17 - Odoo 17 際際滷s
Celine George
How to Setup Company Data in Odoo 17 Accounting App
How to Setup Company Data in Odoo 17 Accounting AppHow to Setup Company Data in Odoo 17 Accounting App
How to Setup Company Data in Odoo 17 Accounting App
Celine George
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷sHow to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
Celine George
How to Manage Purchase Order Approval in Odoo 18
How to Manage Purchase Order Approval in Odoo 18How to Manage Purchase Order Approval in Odoo 18
How to Manage Purchase Order Approval in Odoo 18
Celine George
How to Configure Outgoing and Incoming mail servers in Odoo 18
How to Configure Outgoing and Incoming mail servers in Odoo 18How to Configure Outgoing and Incoming mail servers in Odoo 18
How to Configure Outgoing and Incoming mail servers in Odoo 18
Celine George
How to Grant Discounts in Sale Order Lines in Odoo 18 Sales
How to Grant Discounts in Sale Order Lines in Odoo 18 SalesHow to Grant Discounts in Sale Order Lines in Odoo 18 Sales
How to Grant Discounts in Sale Order Lines in Odoo 18 Sales
Celine George
Comparing RFQ Lines for the best price in Odoo 17
Comparing RFQ Lines for the best price in Odoo 17Comparing RFQ Lines for the best price in Odoo 17
Comparing RFQ Lines for the best price in Odoo 17
Celine George
How to setup journals in Odoo 17 Accounting
How to setup journals in Odoo 17 AccountingHow to setup journals in Odoo 17 Accounting
How to setup journals in Odoo 17 Accounting
Celine George
How to handle the storage categories of the locations in Odoo 17
How to handle the storage categories of the locations in Odoo 17How to handle the storage categories of the locations in Odoo 17
How to handle the storage categories of the locations in Odoo 17
Celine George
How to Identify the Margin from the Sales Orders using Odoo 17
How to Identify the Margin from the Sales Orders using Odoo 17How to Identify the Margin from the Sales Orders using Odoo 17
How to Identify the Margin from the Sales Orders using Odoo 17
Celine George
Field Parameters in Odoo 18 - Odoo 18 際際滷s
Field Parameters in Odoo 18 - Odoo 18 際際滷sField Parameters in Odoo 18 - Odoo 18 際際滷s
Field Parameters in Odoo 18 - Odoo 18 際際滷s
Celine George
How to Invoice Shipping Cost to Customer in Odoo 17
How to Invoice Shipping Cost to Customer in Odoo 17How to Invoice Shipping Cost to Customer in Odoo 17
How to Invoice Shipping Cost to Customer in Odoo 17
Celine George
How to configure the retail shop in Odoo 17 Point of Sale
How to configure the retail shop in Odoo 17 Point of SaleHow to configure the retail shop in Odoo 17 Point of Sale
How to configure the retail shop in Odoo 17 Point of Sale
Celine George
How to process Interwarehouse and Intrawarehouse transfers in Odoo
How to process Interwarehouse and Intrawarehouse transfers in OdooHow to process Interwarehouse and Intrawarehouse transfers in Odoo
How to process Interwarehouse and Intrawarehouse transfers in Odoo
Celine George
How to manage Customer Tips with Odoo 17 Point Of Sale
How to manage Customer Tips with Odoo 17 Point Of SaleHow to manage Customer Tips with Odoo 17 Point Of Sale
How to manage Customer Tips with Odoo 17 Point Of Sale
Celine George
Analysis of Conf File Parameters in the Odoo 18
Analysis of Conf File Parameters in the Odoo 18Analysis of Conf File Parameters in the Odoo 18
Analysis of Conf File Parameters in the Odoo 18
Celine George
Purchase Analysis in Odoo 17 - Odoo 際際滷s
Purchase Analysis in Odoo 17 - Odoo 際際滷sPurchase Analysis in Odoo 17 - Odoo 際際滷s
Purchase Analysis in Odoo 17 - Odoo 際際滷s
Celine George
Analysis of Conf File Parameters in Odoo 17
Analysis of Conf File Parameters in Odoo 17Analysis of Conf File Parameters in Odoo 17
Analysis of Conf File Parameters in Odoo 17
Celine George
How to Manage Check Out Process in Odoo 17 Website
How to Manage Check Out Process in Odoo 17 WebsiteHow to Manage Check Out Process in Odoo 17 Website
How to Manage Check Out Process in Odoo 17 Website
Celine George
Managing Online Signature and Payment with Odoo 17
Managing Online Signature and Payment with Odoo 17Managing Online Signature and Payment with Odoo 17
Managing Online Signature and Payment with Odoo 17
Celine George
Recruitment in the Odoo 17 - Odoo 17 際際滷s
Recruitment in the Odoo 17 - Odoo 17 際際滷sRecruitment in the Odoo 17 - Odoo 17 際際滷s
Recruitment in the Odoo 17 - Odoo 17 際際滷s
Celine George
How to Setup Company Data in Odoo 17 Accounting App
How to Setup Company Data in Odoo 17 Accounting AppHow to Setup Company Data in Odoo 17 Accounting App
How to Setup Company Data in Odoo 17 Accounting App
Celine George
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷sHow to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
Celine George
How to Manage Purchase Order Approval in Odoo 18
How to Manage Purchase Order Approval in Odoo 18How to Manage Purchase Order Approval in Odoo 18
How to Manage Purchase Order Approval in Odoo 18
Celine George
How to Configure Outgoing and Incoming mail servers in Odoo 18
How to Configure Outgoing and Incoming mail servers in Odoo 18How to Configure Outgoing and Incoming mail servers in Odoo 18
How to Configure Outgoing and Incoming mail servers in Odoo 18
Celine George
How to Grant Discounts in Sale Order Lines in Odoo 18 Sales
How to Grant Discounts in Sale Order Lines in Odoo 18 SalesHow to Grant Discounts in Sale Order Lines in Odoo 18 Sales
How to Grant Discounts in Sale Order Lines in Odoo 18 Sales
Celine George
Comparing RFQ Lines for the best price in Odoo 17
Comparing RFQ Lines for the best price in Odoo 17Comparing RFQ Lines for the best price in Odoo 17
Comparing RFQ Lines for the best price in Odoo 17
Celine George

Recently uploaded (20)

MIPLM subject matter expert Nicos Raftis
MIPLM subject matter expert Nicos RaftisMIPLM subject matter expert Nicos Raftis
MIPLM subject matter expert Nicos Raftis
MIPLM
Anti-Viral Agents.pptx Medicinal Chemistry III, B Pharm SEM VI
Anti-Viral Agents.pptx Medicinal Chemistry III, B Pharm SEM VIAnti-Viral Agents.pptx Medicinal Chemistry III, B Pharm SEM VI
Anti-Viral Agents.pptx Medicinal Chemistry III, B Pharm SEM VI
Samruddhi Khonde
Introduction to Systematic Reviews - Prof Ejaz Khan
Introduction to Systematic Reviews - Prof Ejaz KhanIntroduction to Systematic Reviews - Prof Ejaz Khan
Introduction to Systematic Reviews - Prof Ejaz Khan
Systematic Reviews Network (SRN)
General Quiz at ChakraView 2025 | Amlan Sarkar | Ashoka Univeristy | Prelims ...
General Quiz at ChakraView 2025 | Amlan Sarkar | Ashoka Univeristy | Prelims ...General Quiz at ChakraView 2025 | Amlan Sarkar | Ashoka Univeristy | Prelims ...
General Quiz at ChakraView 2025 | Amlan Sarkar | Ashoka Univeristy | Prelims ...
Amlan Sarkar
PUBH1000 際際滷s - Module 7: Ecological Health
PUBH1000 際際滷s - Module 7: Ecological HealthPUBH1000 際際滷s - Module 7: Ecological Health
PUBH1000 際際滷s - Module 7: Ecological Health
Jonathan Hallett
NC Advisory Council on Student Safety and Well-Being
NC Advisory Council on Student Safety and Well-BeingNC Advisory Council on Student Safety and Well-Being
NC Advisory Council on Student Safety and Well-Being
Mebane Rash
ISO 42001 2023 Audit and Control Checklist
ISO 42001 2023 Audit and Control ChecklistISO 42001 2023 Audit and Control Checklist
ISO 42001 2023 Audit and Control Checklist
priyanshamadhwal2
NURSING PROCESS AND ITS STEPS .pptx
NURSING PROCESS AND ITS STEPS                 .pptxNURSING PROCESS AND ITS STEPS                 .pptx
NURSING PROCESS AND ITS STEPS .pptx
PoojaSen20
MIPLM subject matter expert Daniel Holzner
MIPLM subject matter expert Daniel HolznerMIPLM subject matter expert Daniel Holzner
MIPLM subject matter expert Daniel Holzner
MIPLM
MIPLM subject matter expert Sascha Kamhuber
MIPLM subject matter expert Sascha KamhuberMIPLM subject matter expert Sascha Kamhuber
MIPLM subject matter expert Sascha Kamhuber
MIPLM
technology in banking ppt FOR E-CONTENT -2.ppt
technology in banking ppt  FOR E-CONTENT -2.ppttechnology in banking ppt  FOR E-CONTENT -2.ppt
technology in banking ppt FOR E-CONTENT -2.ppt
HARIHARAN A
U.S. Department of Education certification
U.S. Department of Education certificationU.S. Department of Education certification
U.S. Department of Education certification
Mebane Rash
3. AI Trust Layer, Governance Explainability, Security & Compliance.pdf
3. AI Trust Layer, Governance  Explainability, Security & Compliance.pdf3. AI Trust Layer, Governance  Explainability, Security & Compliance.pdf
3. AI Trust Layer, Governance Explainability, Security & Compliance.pdf
Mukesh Kala
ANORECTAL MALFORMATIONS: NURSING MANAGEMENT PPT.pptx
ANORECTAL MALFORMATIONS: NURSING MANAGEMENT PPT.pptxANORECTAL MALFORMATIONS: NURSING MANAGEMENT PPT.pptx
ANORECTAL MALFORMATIONS: NURSING MANAGEMENT PPT.pptx
PRADEEP ABOTHU
Different perspectives on dugout canoe heritage of Soomaa.pdf
Different perspectives on dugout canoe heritage of Soomaa.pdfDifferent perspectives on dugout canoe heritage of Soomaa.pdf
Different perspectives on dugout canoe heritage of Soomaa.pdf
Aivar Ruukel
Unit No 4- Chemotherapy of Malignancy.pptx
Unit No  4- Chemotherapy of Malignancy.pptxUnit No  4- Chemotherapy of Malignancy.pptx
Unit No 4- Chemotherapy of Malignancy.pptx
Ashish Umale
MIPLM subject matter expert Dr Alihan Kaya
MIPLM subject matter expert Dr Alihan KayaMIPLM subject matter expert Dr Alihan Kaya
MIPLM subject matter expert Dr Alihan Kaya
MIPLM
UNIT 1 Introduction to communication.pptx
UNIT 1 Introduction to communication.pptxUNIT 1 Introduction to communication.pptx
UNIT 1 Introduction to communication.pptx
HARIHARAN A
Strategic Corporate Social Responsibility: Sustainable Value Creation Fourth
Strategic Corporate Social Responsibility: Sustainable Value Creation FourthStrategic Corporate Social Responsibility: Sustainable Value Creation Fourth
Strategic Corporate Social Responsibility: Sustainable Value Creation Fourth
keileyrazawi
General Quiz at Maharaja Agrasen College | Amlan Sarkar | Prelims with Answer...
General Quiz at Maharaja Agrasen College | Amlan Sarkar | Prelims with Answer...General Quiz at Maharaja Agrasen College | Amlan Sarkar | Prelims with Answer...
General Quiz at Maharaja Agrasen College | Amlan Sarkar | Prelims with Answer...
Amlan Sarkar
MIPLM subject matter expert Nicos Raftis
MIPLM subject matter expert Nicos RaftisMIPLM subject matter expert Nicos Raftis
MIPLM subject matter expert Nicos Raftis
MIPLM
Anti-Viral Agents.pptx Medicinal Chemistry III, B Pharm SEM VI
Anti-Viral Agents.pptx Medicinal Chemistry III, B Pharm SEM VIAnti-Viral Agents.pptx Medicinal Chemistry III, B Pharm SEM VI
Anti-Viral Agents.pptx Medicinal Chemistry III, B Pharm SEM VI
Samruddhi Khonde
General Quiz at ChakraView 2025 | Amlan Sarkar | Ashoka Univeristy | Prelims ...
General Quiz at ChakraView 2025 | Amlan Sarkar | Ashoka Univeristy | Prelims ...General Quiz at ChakraView 2025 | Amlan Sarkar | Ashoka Univeristy | Prelims ...
General Quiz at ChakraView 2025 | Amlan Sarkar | Ashoka Univeristy | Prelims ...
Amlan Sarkar
PUBH1000 際際滷s - Module 7: Ecological Health
PUBH1000 際際滷s - Module 7: Ecological HealthPUBH1000 際際滷s - Module 7: Ecological Health
PUBH1000 際際滷s - Module 7: Ecological Health
Jonathan Hallett
NC Advisory Council on Student Safety and Well-Being
NC Advisory Council on Student Safety and Well-BeingNC Advisory Council on Student Safety and Well-Being
NC Advisory Council on Student Safety and Well-Being
Mebane Rash
ISO 42001 2023 Audit and Control Checklist
ISO 42001 2023 Audit and Control ChecklistISO 42001 2023 Audit and Control Checklist
ISO 42001 2023 Audit and Control Checklist
priyanshamadhwal2
NURSING PROCESS AND ITS STEPS .pptx
NURSING PROCESS AND ITS STEPS                 .pptxNURSING PROCESS AND ITS STEPS                 .pptx
NURSING PROCESS AND ITS STEPS .pptx
PoojaSen20
MIPLM subject matter expert Daniel Holzner
MIPLM subject matter expert Daniel HolznerMIPLM subject matter expert Daniel Holzner
MIPLM subject matter expert Daniel Holzner
MIPLM
MIPLM subject matter expert Sascha Kamhuber
MIPLM subject matter expert Sascha KamhuberMIPLM subject matter expert Sascha Kamhuber
MIPLM subject matter expert Sascha Kamhuber
MIPLM
technology in banking ppt FOR E-CONTENT -2.ppt
technology in banking ppt  FOR E-CONTENT -2.ppttechnology in banking ppt  FOR E-CONTENT -2.ppt
technology in banking ppt FOR E-CONTENT -2.ppt
HARIHARAN A
U.S. Department of Education certification
U.S. Department of Education certificationU.S. Department of Education certification
U.S. Department of Education certification
Mebane Rash
3. AI Trust Layer, Governance Explainability, Security & Compliance.pdf
3. AI Trust Layer, Governance  Explainability, Security & Compliance.pdf3. AI Trust Layer, Governance  Explainability, Security & Compliance.pdf
3. AI Trust Layer, Governance Explainability, Security & Compliance.pdf
Mukesh Kala
ANORECTAL MALFORMATIONS: NURSING MANAGEMENT PPT.pptx
ANORECTAL MALFORMATIONS: NURSING MANAGEMENT PPT.pptxANORECTAL MALFORMATIONS: NURSING MANAGEMENT PPT.pptx
ANORECTAL MALFORMATIONS: NURSING MANAGEMENT PPT.pptx
PRADEEP ABOTHU
Different perspectives on dugout canoe heritage of Soomaa.pdf
Different perspectives on dugout canoe heritage of Soomaa.pdfDifferent perspectives on dugout canoe heritage of Soomaa.pdf
Different perspectives on dugout canoe heritage of Soomaa.pdf
Aivar Ruukel
Unit No 4- Chemotherapy of Malignancy.pptx
Unit No  4- Chemotherapy of Malignancy.pptxUnit No  4- Chemotherapy of Malignancy.pptx
Unit No 4- Chemotherapy of Malignancy.pptx
Ashish Umale
MIPLM subject matter expert Dr Alihan Kaya
MIPLM subject matter expert Dr Alihan KayaMIPLM subject matter expert Dr Alihan Kaya
MIPLM subject matter expert Dr Alihan Kaya
MIPLM
UNIT 1 Introduction to communication.pptx
UNIT 1 Introduction to communication.pptxUNIT 1 Introduction to communication.pptx
UNIT 1 Introduction to communication.pptx
HARIHARAN A
Strategic Corporate Social Responsibility: Sustainable Value Creation Fourth
Strategic Corporate Social Responsibility: Sustainable Value Creation FourthStrategic Corporate Social Responsibility: Sustainable Value Creation Fourth
Strategic Corporate Social Responsibility: Sustainable Value Creation Fourth
keileyrazawi
General Quiz at Maharaja Agrasen College | Amlan Sarkar | Prelims with Answer...
General Quiz at Maharaja Agrasen College | Amlan Sarkar | Prelims with Answer...General Quiz at Maharaja Agrasen College | Amlan Sarkar | Prelims with Answer...
General Quiz at Maharaja Agrasen College | Amlan Sarkar | Prelims with Answer...
Amlan Sarkar

How to Add Sort Option in Website Portal Odoo 17

  • 1. How to Add Sort Option in Website Portal Odoo 17 Enterprise
  • 2. Introduction Enterprise Odoo provides a versatile approach to improving the user interface on our website portal by enabling the addition of sorting features customized to our requirements. In the "My Account" section of the website, there are various options such as Sales Orders, Projects, Timesheets, and more. We can view further details by selecting each menu item.
  • 3. Steps Enterprise Steps for Adding the Sort Option in Odoo Website 1. Create a Custom Module 2. Define the Module Manifest 3. Extend the Model 4. Create a XML template 5. Create a controller 6. Update and Install the Module
  • 4. Explanation Enterprise 1. Create a Custom Module: Create a custom module, define a new file with the desired functionality 2. Define the Module Manifest, Extend the Model: Include the necessary metadata and dependencies, and also extend the model.
  • 5. Create a XML template Enterprise 3. Create a XML template
  • 6. Explanation Enterprise This template changes the current portal breadcrumbs to include a "Recruitment" breadcrumb entry. The entry appears conditionally active and is linked based on the variables page_name and recruitment. If page_name equals 'recruitment', the entry is shown. If recruitment is true, it will be an active link. otherwise, it will appear as plain text. This setup enables users to access the "Recruitment" page via the breadcrumb trail, ensuring a consistent and user- friendly navigation experience.
  • 8. Explanation Enterprise This code enhances the Odoo portal's home page by adding a new menu item for "Recruitment." These changes enhance the portal's home page with a user-friendly link to the "Recruitment" section, improving navigation and accessibility for users.
  • 9. Code Enterprise <template id="portal_my_home_recruitment_views" name="Recruitment"> <t t-call="portal.portal_layout"> <t t-set="breadcrumbs_searchbar" t-value="True"/> <t t-call="portal.portal_searchbar"> <t t-set="title">Recruitment</t> </t> <t t-call="portal.portal_table"> <thead> <tr class="active"> <th class="text-left">Applicant</th> <th class="text-center">Create Date</th> <th class="text-center">Job Position</th> <th class="text-end">Status</th> </tr> </thead> <t t-foreach="recruitment" t-as="record"> <tr> <td class='text-left'> <span t-field="record.partner_name"/> </td> <td class='text-center'> <span t-field="record.create_date"/> </td> <td class='text-center'> <span t-field="record.job_id.name"/> </td> <td class='text-end'> <span t-field="record.stage_id.name"/> </td> </tr> </t> </t> </t> </template>
  • 10. Explanation Enterprise This template extends the portal layout to add a "Recruitment" page in the Odoo portal. The page includes: 1. A Search Bar: The search bar is enabled and a title is set to "Recruitment". 2. A Table: A table with headers for Applicant, Create Date, Job Position, and Status. 3. Dynamic Content: Each row in the table corresponds to a recruitment record, displaying the applicant's name, creation date, job position, and current status. This setup provides a clear and organized way for users to view recruitment details within the portal.
  • 12. Explanation Enterprise This class and method are used to extend the Odoo customer portal to include recruitment data This allows users to see the number of recruitment applications they are involved with when they access the portal, enhancing the portal's functionality by integrating recruitment information.
  • 14. Explanation Enterprise This method handles the display and sorting of recruitment records in the Odoo portal. When a user accesses the recruitment page. Defines Routes: Specifies the URL routes it responds to, ensuring the user is authenticated. Sorts Records: Provides sorting options for recruitment records by date or status. Searches Records: Retrieves recruitment records for the current user, applying the chosen sorting order. Renders Page: Passes the retrieved records and sorting options to the specified template for rendering. This setup enhances the user experience by allowing users to easily view and sort their recruitment records in the portal.
  • 15. Enterprise searchbar_sortings = { 'date': {'label': _('Date'), 'order': 'create_date desc'}, 'stage': {'label': _('Status'), 'order': 'stage_id'}, } The searchbar_sortings dictionary is designed to define sorting options for a search bar in a web application. Each key in the dictionary represents a sorting criterion, with 'date' and 'stage' being the criteria in this example. The value associated with each key is another dictionary that contains two entries: 'label' and 'order'. The 'label' is a user-friendly name for the sorting criterion. The 'order' specifies how the results should be ordered in the database query. SORT
  • 16. Enterprise Verifying with this code if a value is specified for the 'sortby' option. If not, we can then establish a default value. In this instance, the default order for sorting the records is by the date in descending order. This code checks if the 'sortby' option has a value. If it doesn't, a default value is assigned. Here, the default sorting sequence for the records is by date, in descending order. if not sortby: sortby = 'date' order = searchbar_sortings[sortby]['order'] recruitment = request.env['hr.applicant'].sudo().search([ ('user_id', '=', request.env.uid)], order=order)
  • 18. Enterprise Conclusion Hence this way we can use the default sort functionality of odoo add extra parameters to our sort option of the search bar in the portal page .
  • 19. For More Info. Check our company website for related blogs and Odoo book. Check our YouTube channel for functional and technical videos in Odoo. Enterprise www.cybrosys.com