SlideShare a Scribd company logo
2
Most read
4
Most read
6
Most read
How to Create a Custom
Screen in Odoo 17 POS
Enterprise
Introduction
Enterprise
In Odoo ERP’s Point Of Sale module, we can handle sale transactions
efficiently with very user friendly UI.
In Odoo POS, businesses can configure custom screens to capture specific
data points needed for advanced reporting and analytics, providing better
insights into sales and operations.
Enterprise
Let’s demonstrate the process by creating a custom module
pos_custom_screen which has the structure as
Enterprise
Add the files in the manifest as follows,
'assets': {
'point_of_sale._assets_pos': [
'pos_custom_screen/static/src/**/*',
]
},
Enterprise
For creating the custom screen, we are just creating a custom button
named ‘Product Combos’ on the billing screen of the POS module. For
that, type the xml code in the product_combos_button.xml file as shown
below.
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="pos_custom_screen.ProductCombosButton" owl="1">
<button class="control-button btn btn-light rounded-0 fw-bolder" t-on-click="() => this.click()">
<i class="fa fa-align-justify me-1" role="img" aria-label="Product Combos" title="Product Combos" />
Product Combos
</button>
</t>
</templates>
Here, on onclick() method is set for the button.
Enterprise
Now, create the js file for the button
/** @odoo-module */
import { Component } from "@odoo/owl";
import { ProductScreen } from
"@point_of_sale/app/screens/product_screen/product_screen";
import { usePos } from "@point_of_sale/app/store/pos_hook";
export class ProductCombosButton extends Component {
static template = "pos_custom_screen.ProductCombosButton";
setup() {
this.pos = usePos();
}
async click() {
this.pos.showScreen("ProductCombosScreen");
}
}
ProductScreen.addControlButton({
component: ProductCombosButton,
condition: function () {
return true;
},
});
Enterprise
Here, a new Odoo Component ProductCombosButton here by extending
from the Component class as
export class ProductCombosButton extends Component
static template = "pos_custom_screen.ProductCombosButton";
ProductScreen.addControlButton({
component: ProductCombosButton,
condition: function () {
return true;
},
});
The early created xml template is set here
Then, inside the click(), we show the ProductCombosScreen
this.pos.showScreen("ProductCombosScreen");
Finally, the component is added to the control buttons of the
ProductScreen.
Enterprise
This will create the button as
Enterprise
On clicking the Product Combos button, our aim is to display the
product combo screen. So, let's proceed by creating the JavaScript
file for the custom screen in the file named
product_combos_screen.js
The js code start with the import statements as
/** @odoo-module */
import { registry } from "@web/core/registry";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { Component } from "@odoo/owl";
Enterprise
Now, create the class from Component class and define the template and
add the custom screen to the pos_screens registry.
export class ProductCombosScreen extends Component {
static template = "pos_custom_screen.ProductCombosScreen";
setup() {
super.setup(...arguments);
this.pos = usePos();
}
getComboList() {
var comboList = [];
Object.values(this.pos.db.combo_by_id).forEach(function(combo) {
comboList.push({
id: combo.id,
name: combo.name,
base_price: combo.base_price,
combo_line_ids: combo.combo_line_ids,
});
});
return comboList
}}
registry.category("pos_screens").add("ProductCombosScreen",
ProductCombosScreen);
Enterprise
Here we define a method getComboList which fetches some basic
information about the product such as id, name, base_price and
combo_line_ids. These details are then returned to the template
pos_custom_screen. ProductCombosScreen to display the details.
For displaying those details about the Combo products in the new
screen, we need to design the template for that. It is saved in the
product_combos_screen.xml file.
The xml code start as
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="pos_custom_screen.ProductCombosScreen" owl="1">
Enterprise
<div class="controls d-flex align-items-center justify-content-between mt-1 mt-md-0 p-2 bg-400">
<div class="buttons d-flex gap-2">
<button class="discard btn btn-lg btn-light" t-
on-click="() => this.pos.showScreen('ProductScreen')">
<span class="search-icon">
<i class="fa fa-
angle-double-left"/>
</span>
Back
</button>
</div>
</div>
Then, inside the ProductCombosScreen template, we define a main
div and inside that, the first <div> to navigate back to the billing
screen as
Enterprise
<div class="orders overflow-y-auto flex-grow-1">
<div class="header-row d-flex text-bg-700 fw-bolder">
<div class="col wide p-2">Combo Name</div>
<div class="col wide p-2">Price</div>
<div class="col wide p-2">No of products</div>
</div>
<t t-set="comboList" t-value="getComboList()"/>
<t t-foreach="comboList" t-as="combo" t-key="combo.id">
<div class="order-row">
<div class="col wide p-2 ">
<div><t
t-esc="combo.name"/></div>
</div>
<div class="col wide p-2">
<div><t t-
esc="combo.base_price"/></div>
</div>
<div class="col wide p-2"><div>
<t t-
esc="combo.combo_line_ids.length"/></div>
</div></div></t>
</div>
And the second div to show the Product combo details as
Enterprise
This code will show the new screen as
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

PPTX
How to Add a Custom Button in Pos Odoo 17
PPTX
How to Add a Custom Button in Odoo 18 POS Screen
PPTX
How to Customize POS Receipts in the Odoo 17
PDF
Odoo POS Module Development: Complete Setup Guide
PPTX
How to Load Custom Field to POS in Odoo 17 - Odoo 17 Slides
PPTX
How to Create & Manage a Dashboard Using OWL in Odoo 17
PPTX
How to perform product search based on a custom field from the PoS screen of ...
PPTX
How to configure the retail shop in Odoo 17 Point of Sale
How to Add a Custom Button in Pos Odoo 17
How to Add a Custom Button in Odoo 18 POS Screen
How to Customize POS Receipts in the Odoo 17
Odoo POS Module Development: Complete Setup Guide
How to Load Custom Field to POS in Odoo 17 - Odoo 17 Slides
How to Create & Manage a Dashboard Using OWL in Odoo 17
How to perform product search based on a custom field from the PoS screen of ...
How to configure the retail shop in Odoo 17 Point of Sale

Similar to How to Create a Custom Screen in Odoo 17 POS (6)

PPTX
How to Create an App Using Odoo 17 Studio
PPTX
How to Modify Existing Web Pages in Odoo 18
PPTX
Revamped POS User Interface in Odoo 18 - Odoo Slides
PDF
Step-by-Step Guide of Creating a Custom Module in Odoo
PDF
A Comprehensive Guide to Building Custom Odoo Dashboards
PPTX
How to modify_create components control buttons in Pos odoo.pptx
How to Create an App Using Odoo 17 Studio
How to Modify Existing Web Pages in Odoo 18
Revamped POS User Interface in Odoo 18 - Odoo Slides
Step-by-Step Guide of Creating a Custom Module in Odoo
A Comprehensive Guide to Building Custom Odoo Dashboards
How to modify_create components control buttons in Pos odoo.pptx
Ad

More from Celine George (20)

PPTX
How to Implement OWL Notification Service in Odoo 18
PPTX
Tracking Profit Margins in Sales Orders with Odoo 18
PPTX
How to Configure Outgoing Shipment in 3 Steps Using Odoo 18
PPTX
How to Configure Outgoing Shipment in 1 Step Using Odoo 18.pptx
PPTX
How to Configure Outgoing Shipment in 2 Steps Using Odoo 18
PPTX
How to Add New Applicants in Odoo 18 Recruitment
PPTX
How to Analyze the Recruitment Process in Odoo 18 Recruitment
PPTX
How to Manage Referral Reporting in Odoo 18 Referrals
PPTX
How to Set, Track, & Review Employee Goals in Odoo 18 Appraisals
PPTX
Revamp in MTO Odoo 18 Inventory - Odoo Slides
PPTX
How to Manage Starshipit in Odoo 18 - Odoo Slides
PPTX
How to Manage Bill Control Policy in Odoo 18
PPTX
How to Manage Loyalty Points in Odoo 18 Sales
PPTX
Odoo 18 Sales_ Managing Quotation Validity
PPTX
How to Manage Global Discount in Odoo 18 POS
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
PPTX
How to Track Skills & Contracts Using Odoo 18 Employee
How to Implement OWL Notification Service in Odoo 18
Tracking Profit Margins in Sales Orders with Odoo 18
How to Configure Outgoing Shipment in 3 Steps Using Odoo 18
How to Configure Outgoing Shipment in 1 Step Using Odoo 18.pptx
How to Configure Outgoing Shipment in 2 Steps Using Odoo 18
How to Add New Applicants in Odoo 18 Recruitment
How to Analyze the Recruitment Process in Odoo 18 Recruitment
How to Manage Referral Reporting in Odoo 18 Referrals
How to Set, Track, & Review Employee Goals in Odoo 18 Appraisals
Revamp in MTO Odoo 18 Inventory - Odoo Slides
How to Manage Starshipit in Odoo 18 - Odoo Slides
How to Manage Bill Control Policy in Odoo 18
How to Manage Loyalty Points in Odoo 18 Sales
Odoo 18 Sales_ Managing Quotation Validity
How to Manage Global Discount in Odoo 18 POS
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Tips Management in Odoo 18 POS - Odoo Slides
How to Close Subscription in Odoo 18 - Odoo Slides
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
How to Track Skills & Contracts Using Odoo 18 Employee
Ad

Recently uploaded (20)

PDF
TR - Agricultural Crops Production NC III.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
GDM (1) (1).pptx small presentation for students
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Institutional Correction lecture only . . .
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
RMMM.pdf make it easy to upload and study
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Cell Structure & Organelles in detailed.
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Anesthesia in Laparoscopic Surgery in India
TR - Agricultural Crops Production NC III.pdf
VCE English Exam - Section C Student Revision Booklet
human mycosis Human fungal infections are called human mycosis..pptx
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
GDM (1) (1).pptx small presentation for students
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Institutional Correction lecture only . . .
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Supply Chain Operations Speaking Notes -ICLT Program
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
O7-L3 Supply Chain Operations - ICLT Program
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
Renaissance Architecture: A Journey from Faith to Humanism
RMMM.pdf make it easy to upload and study
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Cell Structure & Organelles in detailed.
Microbial diseases, their pathogenesis and prophylaxis
Anesthesia in Laparoscopic Surgery in India

How to Create a Custom Screen in Odoo 17 POS

  • 1. How to Create a Custom Screen in Odoo 17 POS Enterprise
  • 2. Introduction Enterprise In Odoo ERP’s Point Of Sale module, we can handle sale transactions efficiently with very user friendly UI. In Odoo POS, businesses can configure custom screens to capture specific data points needed for advanced reporting and analytics, providing better insights into sales and operations.
  • 3. Enterprise Let’s demonstrate the process by creating a custom module pos_custom_screen which has the structure as
  • 4. Enterprise Add the files in the manifest as follows, 'assets': { 'point_of_sale._assets_pos': [ 'pos_custom_screen/static/src/**/*', ] },
  • 5. Enterprise For creating the custom screen, we are just creating a custom button named ‘Product Combos’ on the billing screen of the POS module. For that, type the xml code in the product_combos_button.xml file as shown below. <?xml version="1.0" encoding="UTF-8"?> <templates id="template" xml:space="preserve"> <t t-name="pos_custom_screen.ProductCombosButton" owl="1"> <button class="control-button btn btn-light rounded-0 fw-bolder" t-on-click="() => this.click()"> <i class="fa fa-align-justify me-1" role="img" aria-label="Product Combos" title="Product Combos" /> Product Combos </button> </t> </templates> Here, on onclick() method is set for the button.
  • 6. Enterprise Now, create the js file for the button /** @odoo-module */ import { Component } from "@odoo/owl"; import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen"; import { usePos } from "@point_of_sale/app/store/pos_hook"; export class ProductCombosButton extends Component { static template = "pos_custom_screen.ProductCombosButton"; setup() { this.pos = usePos(); } async click() { this.pos.showScreen("ProductCombosScreen"); } } ProductScreen.addControlButton({ component: ProductCombosButton, condition: function () { return true; }, });
  • 7. Enterprise Here, a new Odoo Component ProductCombosButton here by extending from the Component class as export class ProductCombosButton extends Component static template = "pos_custom_screen.ProductCombosButton"; ProductScreen.addControlButton({ component: ProductCombosButton, condition: function () { return true; }, }); The early created xml template is set here Then, inside the click(), we show the ProductCombosScreen this.pos.showScreen("ProductCombosScreen"); Finally, the component is added to the control buttons of the ProductScreen.
  • 9. Enterprise On clicking the Product Combos button, our aim is to display the product combo screen. So, let's proceed by creating the JavaScript file for the custom screen in the file named product_combos_screen.js The js code start with the import statements as /** @odoo-module */ import { registry } from "@web/core/registry"; import { usePos } from "@point_of_sale/app/store/pos_hook"; import { Component } from "@odoo/owl";
  • 10. Enterprise Now, create the class from Component class and define the template and add the custom screen to the pos_screens registry. export class ProductCombosScreen extends Component { static template = "pos_custom_screen.ProductCombosScreen"; setup() { super.setup(...arguments); this.pos = usePos(); } getComboList() { var comboList = []; Object.values(this.pos.db.combo_by_id).forEach(function(combo) { comboList.push({ id: combo.id, name: combo.name, base_price: combo.base_price, combo_line_ids: combo.combo_line_ids, }); }); return comboList }} registry.category("pos_screens").add("ProductCombosScreen", ProductCombosScreen);
  • 11. Enterprise Here we define a method getComboList which fetches some basic information about the product such as id, name, base_price and combo_line_ids. These details are then returned to the template pos_custom_screen. ProductCombosScreen to display the details. For displaying those details about the Combo products in the new screen, we need to design the template for that. It is saved in the product_combos_screen.xml file. The xml code start as <?xml version="1.0" encoding="UTF-8"?> <templates id="template" xml:space="preserve"> <t t-name="pos_custom_screen.ProductCombosScreen" owl="1">
  • 12. Enterprise <div class="controls d-flex align-items-center justify-content-between mt-1 mt-md-0 p-2 bg-400"> <div class="buttons d-flex gap-2"> <button class="discard btn btn-lg btn-light" t- on-click="() => this.pos.showScreen('ProductScreen')"> <span class="search-icon"> <i class="fa fa- angle-double-left"/> </span> Back </button> </div> </div> Then, inside the ProductCombosScreen template, we define a main div and inside that, the first <div> to navigate back to the billing screen as
  • 13. Enterprise <div class="orders overflow-y-auto flex-grow-1"> <div class="header-row d-flex text-bg-700 fw-bolder"> <div class="col wide p-2">Combo Name</div> <div class="col wide p-2">Price</div> <div class="col wide p-2">No of products</div> </div> <t t-set="comboList" t-value="getComboList()"/> <t t-foreach="comboList" t-as="combo" t-key="combo.id"> <div class="order-row"> <div class="col wide p-2 "> <div><t t-esc="combo.name"/></div> </div> <div class="col wide p-2"> <div><t t- esc="combo.base_price"/></div> </div> <div class="col wide p-2"><div> <t t- esc="combo.combo_line_ids.length"/></div> </div></div></t> </div> And the second div to show the Product combo details as
  • 14. Enterprise This code will show the new screen as
  • 15. 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