SlideShare a Scribd company logo
How to Load Custom Field
to POS in Odoo 17
Enterprise
Introduction
Enterprise
This slide explains how to load custom fields you've created
into the Odoo 17 Point-of-Sale (POS) interface.
Enterprise
There are two main approaches:
1. Loading Fields to Existing Models
2. Loading a Custom Model to the POS
Enterprise
1. Loading Fields to Existing Models
This approach involves extending the functionalities of
existing POS models (e.g., product.product) to include
your custom field.
Steps:
1. Create the Custom Field:
In your custom module, define the custom field using
Odoo's field types (e.g., char, float, boolean) within your
model definition.
Enterprise
2. Extend the _loader_params_<model_name> Function:
Create a function named
_loader_params_<model_name> (replace <model_name>
with the actual model name, e.g., product.product) by
inheriting the pos.session model.
This function returns a dictionary with a key named
"search_params".
The "search_params" value should be another dictionary
with two keys:
"domains" (optional): A list of domain filters to apply
when searching for the model (relevant for custom
filtering based on your field).
"fields": A list containing your custom field name to
ensure it's loaded in the POS view.
Enterprise
3. (Optional) Override _get_pos_ui_<model_name>
Function (Advanced):
If you need to manipulate the retrieved data before it
reaches the POS UI, you can define a function named
_get_pos_ui_<model_name> .
This function takes a record (e.g., product object) as input
and can modify or format the custom field value before
returning it.
Enterprise
Example:
from odoo import models
# Assuming your custom field is named "custom_field" on the
"product.product" model
class PosSession(models.Model):
_inherit = 'pos.session'
def _loader_params_product_product(self):
result = super()._loader_params_product_product()
result['search_params']['fields'].append(custom_field)
return result
Enterprise
2. Loading a Custom Model to the POS
This approach involves creating a completely new model for
your custom data and then loading it into the POS interface.
Steps:
● Load the model to the pos
Inherit the pos.session model and load the custom
model to the pos as follows
Enterprise
class PosSession(models.Model):
_inherit = 'pos.session'
def _pos_ui_models_to_load(self):
result = super()._pos_ui_models_to_load()
result += [
custom.model
]
return result
Enterprise
Create a function named
_loader_params_<model_name> (replace
<model_name> with the actual model name, e.g.,
custom.model).
def _loader_params_custom_model(self):
return {
'search_params': {
'domain': [],
'fields': [
‘field1’, ‘field2’,’field3’, ‘field4’
],
},
}
Enterprise
define a function named _get_pos_ui_<model_name> .
This function takes a record as input and can modify or
format the custom field value before returning it.
def _get_pos_ui_custom_model(self, params):
return
self.env[custom.model].search_read(**params['search_params'
])
Enterprise
Now create a js file and add the code below to load the
custom model data into pos
/** @odoo-module */
import { patch } from "@web/core/utils/patch";
import { PosStore } from
"@point_of_sale/app/store/pos_store";
patch(PosStore.prototype, {
async _processData(loadedData) {
await super._processData(...arguments);
this.model = loadedData["custom.model"];
}
},
});
Enterprise
Now the custom model and its data will be available in
the point of sale interface
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 Load Custom Field to POS in Odoo 17 - Odoo 17 Slides

Model Binding in ASP.NET MVC
Model Binding in ASP.NET MVCModel Binding in ASP.NET MVC
Model Binding in ASP.NET MVC
Barry Dorrans
 
Whmcs addon module docs
Whmcs addon module docsWhmcs addon module docs
Whmcs addon module docs
quyvn
 
PrestaShop Kathmandu Ecommerce Meetup #2
PrestaShop Kathmandu Ecommerce Meetup #2PrestaShop Kathmandu Ecommerce Meetup #2
PrestaShop Kathmandu Ecommerce Meetup #2
Hem Pokhrel
 
Django
DjangoDjango
Eclipse Tricks
Eclipse TricksEclipse Tricks
Eclipse Tricks
Kaniska Mandal
 
Solid angular
Solid angularSolid angular
Solid angular
Nir Kaufman
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
Celine George
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
Joaquim Rocha
 
File(2)
File(2)File(2)
File(2)
Mahi G
 
Creation vsm modelos componentes electronicos
Creation vsm   modelos componentes electronicosCreation vsm   modelos componentes electronicos
Creation vsm modelos componentes electronicos
jeblanco81
 
03-Factory Method for design patterns.pdf
03-Factory Method for design patterns.pdf03-Factory Method for design patterns.pdf
03-Factory Method for design patterns.pdf
ssusera587d2
 
Symfony2 Introduction Presentation
Symfony2 Introduction PresentationSymfony2 Introduction Presentation
Symfony2 Introduction Presentation
Nerd Tzanetopoulos
 
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
 
Django design-patterns
Django design-patternsDjango design-patterns
Django design-patterns
Agiliq Info Solutions India Pvt Ltd
 
building-a-fdm-application-for-a-hfm-target
 building-a-fdm-application-for-a-hfm-target building-a-fdm-application-for-a-hfm-target
building-a-fdm-application-for-a-hfm-target
Sid Mehta
 
Tips On Trick Odoo Add-On.pptx
Tips On Trick Odoo Add-On.pptxTips On Trick Odoo Add-On.pptx
Tips On Trick Odoo Add-On.pptx
Agusto Sipahutar
 
Desing pattern prototype-Factory Method, Prototype and Builder
Desing pattern prototype-Factory Method, Prototype and Builder Desing pattern prototype-Factory Method, Prototype and Builder
Desing pattern prototype-Factory Method, Prototype and Builder
paramisoft
 
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
 
Progamming Primer Polymorphism (Method Overloading) VB
Progamming Primer Polymorphism (Method Overloading) VBProgamming Primer Polymorphism (Method Overloading) VB
Progamming Primer Polymorphism (Method Overloading) VB
sunmitraeducation
 
Adding custom ui controls to your application (1)
Adding custom ui controls to your application (1)Adding custom ui controls to your application (1)
Adding custom ui controls to your application (1)
Oro Inc.
 

Similar to How to Load Custom Field to POS in Odoo 17 - Odoo 17 Slides (20)

Model Binding in ASP.NET MVC
Model Binding in ASP.NET MVCModel Binding in ASP.NET MVC
Model Binding in ASP.NET MVC
 
Whmcs addon module docs
Whmcs addon module docsWhmcs addon module docs
Whmcs addon module docs
 
PrestaShop Kathmandu Ecommerce Meetup #2
PrestaShop Kathmandu Ecommerce Meetup #2PrestaShop Kathmandu Ecommerce Meetup #2
PrestaShop Kathmandu Ecommerce Meetup #2
 
Django
DjangoDjango
Django
 
Eclipse Tricks
Eclipse TricksEclipse Tricks
Eclipse Tricks
 
Solid angular
Solid angularSolid angular
Solid angular
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
File(2)
File(2)File(2)
File(2)
 
Creation vsm modelos componentes electronicos
Creation vsm   modelos componentes electronicosCreation vsm   modelos componentes electronicos
Creation vsm modelos componentes electronicos
 
03-Factory Method for design patterns.pdf
03-Factory Method for design patterns.pdf03-Factory Method for design patterns.pdf
03-Factory Method for design patterns.pdf
 
Symfony2 Introduction Presentation
Symfony2 Introduction PresentationSymfony2 Introduction Presentation
Symfony2 Introduction Presentation
 
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
 
Django design-patterns
Django design-patternsDjango design-patterns
Django design-patterns
 
building-a-fdm-application-for-a-hfm-target
 building-a-fdm-application-for-a-hfm-target building-a-fdm-application-for-a-hfm-target
building-a-fdm-application-for-a-hfm-target
 
Tips On Trick Odoo Add-On.pptx
Tips On Trick Odoo Add-On.pptxTips On Trick Odoo Add-On.pptx
Tips On Trick Odoo Add-On.pptx
 
Desing pattern prototype-Factory Method, Prototype and Builder
Desing pattern prototype-Factory Method, Prototype and Builder Desing pattern prototype-Factory Method, Prototype and Builder
Desing pattern prototype-Factory Method, Prototype and Builder
 
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
 
Progamming Primer Polymorphism (Method Overloading) VB
Progamming Primer Polymorphism (Method Overloading) VBProgamming Primer Polymorphism (Method Overloading) VB
Progamming Primer Polymorphism (Method Overloading) VB
 
Adding custom ui controls to your application (1)
Adding custom ui controls to your application (1)Adding custom ui controls to your application (1)
Adding custom ui controls to your application (1)
 

More from Celine George

How to Manage Reporting in Events of Odoo 17 Events
How to Manage Reporting in Events of Odoo 17 EventsHow to Manage Reporting in Events of Odoo 17 Events
How to Manage Reporting in Events of Odoo 17 Events
Celine George
 
How to Install Custom Module in Odoo 17 - Odoo 17 Slides
How to Install Custom Module in Odoo 17 - Odoo 17 SlidesHow to Install Custom Module in Odoo 17 - Odoo 17 Slides
How to Install Custom Module in Odoo 17 - Odoo 17 Slides
Celine George
 
Manufacturing New Features in Odoo 17 - Odoo 17 Slides
Manufacturing New Features in Odoo 17 - Odoo 17 SlidesManufacturing New Features in Odoo 17 - Odoo 17 Slides
Manufacturing New Features in Odoo 17 - Odoo 17 Slides
Celine George
 
How to Empty a Many2Many Field in Odoo 17
How to Empty a Many2Many Field in Odoo 17How to Empty a Many2Many Field in Odoo 17
How to Empty a Many2Many Field in Odoo 17
Celine George
 
How to Set Maximum Difference in Odoo 17 POS
How to Set Maximum Difference in Odoo 17 POSHow to Set Maximum Difference in Odoo 17 POS
How to Set Maximum Difference in Odoo 17 POS
Celine George
 
How to use noupdate 0 or 1 in Odoo - Odoo 17 Slides
How to use noupdate 0 or 1 in Odoo - Odoo 17 SlidesHow to use noupdate 0 or 1 in Odoo - Odoo 17 Slides
How to use noupdate 0 or 1 in Odoo - Odoo 17 Slides
Celine George
 
How to Call Python Function from Menu Item
How to Call Python Function from Menu ItemHow to Call Python Function from Menu Item
How to Call Python Function from Menu Item
Celine George
 
How to Clear/delete All Order Lines in Odoo 17 POS
How to Clear/delete All Order Lines in Odoo 17 POSHow to Clear/delete All Order Lines in Odoo 17 POS
How to Clear/delete All Order Lines in Odoo 17 POS
Celine George
 
How to add button in list view Odoo 17 - Odoo 17 Slides
How to add button in list view Odoo 17 - Odoo 17 SlidesHow to add button in list view Odoo 17 - Odoo 17 Slides
How to add button in list view Odoo 17 - Odoo 17 Slides
Celine George
 
What is the Difference Between Lot & Serial Number in Odoo 17
What is the Difference Between Lot & Serial Number in Odoo 17What is the Difference Between Lot & Serial Number in Odoo 17
What is the Difference Between Lot & Serial Number in Odoo 17
Celine George
 
Float Operations in Odoo 17 - Odoo 17 Slides
Float Operations in Odoo 17 - Odoo 17 SlidesFloat Operations in Odoo 17 - Odoo 17 Slides
Float Operations in Odoo 17 - Odoo 17 Slides
Celine George
 
Prepayment Amount in Odoo 17 - How to Make Partial Payment in Odoo 17
Prepayment Amount in Odoo 17 - How to Make Partial Payment in Odoo 17Prepayment Amount in Odoo 17 - How to Make Partial Payment in Odoo 17
Prepayment Amount in Odoo 17 - How to Make Partial Payment in Odoo 17
Celine George
 
Multi Language and Language Translation with the Website of Odoo 17
Multi Language and Language Translation with the Website of Odoo 17Multi Language and Language Translation with the Website of Odoo 17
Multi Language and Language Translation with the Website of Odoo 17
Celine George
 
How to Manage Advanced Pricelist in Odoo 17
How to Manage Advanced Pricelist in Odoo 17How to Manage Advanced Pricelist in Odoo 17
How to Manage Advanced Pricelist in Odoo 17
Celine George
 
How to Configure Extra Steps During Checkout in Odoo 17 Website App
How to Configure Extra Steps During Checkout in Odoo 17 Website AppHow to Configure Extra Steps During Checkout in Odoo 17 Website App
How to Configure Extra Steps During Checkout in Odoo 17 Website App
Celine George
 
How to Restrict Price Modification to Managers in Odoo 17 POS
How to Restrict Price Modification to Managers in Odoo 17 POSHow to Restrict Price Modification to Managers in Odoo 17 POS
How to Restrict Price Modification to Managers in Odoo 17 POS
Celine George
 
How to Integrate Facebook in Odoo 17 - Odoo 17 Slides
How to Integrate Facebook in Odoo 17 - Odoo 17 SlidesHow to Integrate Facebook in Odoo 17 - Odoo 17 Slides
How to Integrate Facebook in Odoo 17 - Odoo 17 Slides
Celine George
 
Odoo 17 Project Module : New Features - Odoo 17 Slides
Odoo 17 Project Module : New Features - Odoo 17 SlidesOdoo 17 Project Module : New Features - Odoo 17 Slides
Odoo 17 Project Module : New Features - Odoo 17 Slides
Celine George
 
How to Add Collaborators to a Project in Odoo 17
How to Add Collaborators to a Project in Odoo 17How to Add Collaborators to a Project in Odoo 17
How to Add Collaborators to a Project in Odoo 17
Celine George
 
How to Manage Different Invoice & Delivery Addresses of a Customer in Odoo 17
How to Manage Different Invoice & Delivery Addresses of a Customer in Odoo 17How to Manage Different Invoice & Delivery Addresses of a Customer in Odoo 17
How to Manage Different Invoice & Delivery Addresses of a Customer in Odoo 17
Celine George
 

More from Celine George (20)

How to Manage Reporting in Events of Odoo 17 Events
How to Manage Reporting in Events of Odoo 17 EventsHow to Manage Reporting in Events of Odoo 17 Events
How to Manage Reporting in Events of Odoo 17 Events
 
How to Install Custom Module in Odoo 17 - Odoo 17 Slides
How to Install Custom Module in Odoo 17 - Odoo 17 SlidesHow to Install Custom Module in Odoo 17 - Odoo 17 Slides
How to Install Custom Module in Odoo 17 - Odoo 17 Slides
 
Manufacturing New Features in Odoo 17 - Odoo 17 Slides
Manufacturing New Features in Odoo 17 - Odoo 17 SlidesManufacturing New Features in Odoo 17 - Odoo 17 Slides
Manufacturing New Features in Odoo 17 - Odoo 17 Slides
 
How to Empty a Many2Many Field in Odoo 17
How to Empty a Many2Many Field in Odoo 17How to Empty a Many2Many Field in Odoo 17
How to Empty a Many2Many Field in Odoo 17
 
How to Set Maximum Difference in Odoo 17 POS
How to Set Maximum Difference in Odoo 17 POSHow to Set Maximum Difference in Odoo 17 POS
How to Set Maximum Difference in Odoo 17 POS
 
How to use noupdate 0 or 1 in Odoo - Odoo 17 Slides
How to use noupdate 0 or 1 in Odoo - Odoo 17 SlidesHow to use noupdate 0 or 1 in Odoo - Odoo 17 Slides
How to use noupdate 0 or 1 in Odoo - Odoo 17 Slides
 
How to Call Python Function from Menu Item
How to Call Python Function from Menu ItemHow to Call Python Function from Menu Item
How to Call Python Function from Menu Item
 
How to Clear/delete All Order Lines in Odoo 17 POS
How to Clear/delete All Order Lines in Odoo 17 POSHow to Clear/delete All Order Lines in Odoo 17 POS
How to Clear/delete All Order Lines in Odoo 17 POS
 
How to add button in list view Odoo 17 - Odoo 17 Slides
How to add button in list view Odoo 17 - Odoo 17 SlidesHow to add button in list view Odoo 17 - Odoo 17 Slides
How to add button in list view Odoo 17 - Odoo 17 Slides
 
What is the Difference Between Lot & Serial Number in Odoo 17
What is the Difference Between Lot & Serial Number in Odoo 17What is the Difference Between Lot & Serial Number in Odoo 17
What is the Difference Between Lot & Serial Number in Odoo 17
 
Float Operations in Odoo 17 - Odoo 17 Slides
Float Operations in Odoo 17 - Odoo 17 SlidesFloat Operations in Odoo 17 - Odoo 17 Slides
Float Operations in Odoo 17 - Odoo 17 Slides
 
Prepayment Amount in Odoo 17 - How to Make Partial Payment in Odoo 17
Prepayment Amount in Odoo 17 - How to Make Partial Payment in Odoo 17Prepayment Amount in Odoo 17 - How to Make Partial Payment in Odoo 17
Prepayment Amount in Odoo 17 - How to Make Partial Payment in Odoo 17
 
Multi Language and Language Translation with the Website of Odoo 17
Multi Language and Language Translation with the Website of Odoo 17Multi Language and Language Translation with the Website of Odoo 17
Multi Language and Language Translation with the Website of Odoo 17
 
How to Manage Advanced Pricelist in Odoo 17
How to Manage Advanced Pricelist in Odoo 17How to Manage Advanced Pricelist in Odoo 17
How to Manage Advanced Pricelist in Odoo 17
 
How to Configure Extra Steps During Checkout in Odoo 17 Website App
How to Configure Extra Steps During Checkout in Odoo 17 Website AppHow to Configure Extra Steps During Checkout in Odoo 17 Website App
How to Configure Extra Steps During Checkout in Odoo 17 Website App
 
How to Restrict Price Modification to Managers in Odoo 17 POS
How to Restrict Price Modification to Managers in Odoo 17 POSHow to Restrict Price Modification to Managers in Odoo 17 POS
How to Restrict Price Modification to Managers in Odoo 17 POS
 
How to Integrate Facebook in Odoo 17 - Odoo 17 Slides
How to Integrate Facebook in Odoo 17 - Odoo 17 SlidesHow to Integrate Facebook in Odoo 17 - Odoo 17 Slides
How to Integrate Facebook in Odoo 17 - Odoo 17 Slides
 
Odoo 17 Project Module : New Features - Odoo 17 Slides
Odoo 17 Project Module : New Features - Odoo 17 SlidesOdoo 17 Project Module : New Features - Odoo 17 Slides
Odoo 17 Project Module : New Features - Odoo 17 Slides
 
How to Add Collaborators to a Project in Odoo 17
How to Add Collaborators to a Project in Odoo 17How to Add Collaborators to a Project in Odoo 17
How to Add Collaborators to a Project in Odoo 17
 
How to Manage Different Invoice & Delivery Addresses of a Customer in Odoo 17
How to Manage Different Invoice & Delivery Addresses of a Customer in Odoo 17How to Manage Different Invoice & Delivery Addresses of a Customer in Odoo 17
How to Manage Different Invoice & Delivery Addresses of a Customer in Odoo 17
 

Recently uploaded

How to Configure Field Cleaning Rules in Odoo 17
How to Configure Field Cleaning Rules in Odoo 17How to Configure Field Cleaning Rules in Odoo 17
How to Configure Field Cleaning Rules in Odoo 17
Celine George
 
Understanding Clergy Payroll : QuickBooks
Understanding Clergy Payroll : QuickBooksUnderstanding Clergy Payroll : QuickBooks
Understanding Clergy Payroll : QuickBooks
TechSoup
 
Replacing the Whole Capitalist Stack.pdf
Replacing the Whole Capitalist Stack.pdfReplacing the Whole Capitalist Stack.pdf
Replacing the Whole Capitalist Stack.pdf
StefanMz
 
Class-Orientation for school year 2024 - 2025
Class-Orientation for school year 2024 - 2025Class-Orientation for school year 2024 - 2025
Class-Orientation for school year 2024 - 2025
KIPAIZAGABAWA1
 
Stéphan Vincent-Lancrin, Deputy Head of IMEP division and Senior Analyst - P...
Stéphan Vincent-Lancrin, Deputy Head of IMEP division and Senior Analyst  - P...Stéphan Vincent-Lancrin, Deputy Head of IMEP division and Senior Analyst  - P...
Stéphan Vincent-Lancrin, Deputy Head of IMEP division and Senior Analyst - P...
EduSkills OECD
 
How to Set Start Category in Odoo 17 POS
How to Set Start Category in Odoo 17 POSHow to Set Start Category in Odoo 17 POS
How to Set Start Category in Odoo 17 POS
Celine George
 
Brigada eskwela 2024 sample template NARRATIVE REPORT.docx
Brigada eskwela 2024 sample template NARRATIVE REPORT.docxBrigada eskwela 2024 sample template NARRATIVE REPORT.docx
Brigada eskwela 2024 sample template NARRATIVE REPORT.docx
BerlynFamilaran1
 
Tale of a Scholar and a Boatman ~ A Story with Life Lessons (Eng. & Chi.).pptx
Tale of a Scholar and a Boatman ~ A Story with Life Lessons (Eng. & Chi.).pptxTale of a Scholar and a Boatman ~ A Story with Life Lessons (Eng. & Chi.).pptx
Tale of a Scholar and a Boatman ~ A Story with Life Lessons (Eng. & Chi.).pptx
OH TEIK BIN
 
Email Marketing in Odoo 17 - Odoo 17 Slides
Email Marketing  in Odoo 17 - Odoo 17 SlidesEmail Marketing  in Odoo 17 - Odoo 17 Slides
Email Marketing in Odoo 17 - Odoo 17 Slides
Celine George
 
Bagong Pilipinas Pledge in Power pointpptx
Bagong Pilipinas Pledge in Power pointpptxBagong Pilipinas Pledge in Power pointpptx
Bagong Pilipinas Pledge in Power pointpptx
fantasialomibao
 
What is the Use of API.onchange in Odoo 17
What is the Use of API.onchange in Odoo 17What is the Use of API.onchange in Odoo 17
What is the Use of API.onchange in Odoo 17
Celine George
 
21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx
21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx
21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx
OliverVillanueva13
 
How to install python packages from Pycharm
How to install python packages from PycharmHow to install python packages from Pycharm
How to install python packages from Pycharm
Celine George
 
sdintegrating21stcenturyskillsinclassroom-basedassessment-240715032004-e59ed7...
sdintegrating21stcenturyskillsinclassroom-basedassessment-240715032004-e59ed7...sdintegrating21stcenturyskillsinclassroom-basedassessment-240715032004-e59ed7...
sdintegrating21stcenturyskillsinclassroom-basedassessment-240715032004-e59ed7...
ABELARDOBALDOVEAZUEL
 
A history of Innisfree in Milanville, Pennsylvania
A history of Innisfree in Milanville, PennsylvaniaA history of Innisfree in Milanville, Pennsylvania
A history of Innisfree in Milanville, Pennsylvania
ThomasRue2
 
How to Use Serial Numbers to Track Products in Odoo 17 Inventory
How to Use Serial Numbers to Track Products in Odoo 17 InventoryHow to Use Serial Numbers to Track Products in Odoo 17 Inventory
How to Use Serial Numbers to Track Products in Odoo 17 Inventory
Celine George
 
SD_Creating Excellent and Powerful Learning Facilitation.pptx
SD_Creating Excellent and Powerful Learning Facilitation.pptxSD_Creating Excellent and Powerful Learning Facilitation.pptx
SD_Creating Excellent and Powerful Learning Facilitation.pptx
jennifersayong3
 
Angular Roadmap For Beginner PDF By ScholarHat.pdf
Angular Roadmap For Beginner PDF By ScholarHat.pdfAngular Roadmap For Beginner PDF By ScholarHat.pdf
Angular Roadmap For Beginner PDF By ScholarHat.pdf
Scholarhat
 
Powerpoint on Classroom Orientation2024-2025
Powerpoint on Classroom Orientation2024-2025Powerpoint on Classroom Orientation2024-2025
Powerpoint on Classroom Orientation2024-2025
MarynolMagbanuaJimer
 
How to Use Quality Module in Odoo 17 - Odoo 17 Slides
How to Use Quality Module in Odoo 17 - Odoo 17 SlidesHow to Use Quality Module in Odoo 17 - Odoo 17 Slides
How to Use Quality Module in Odoo 17 - Odoo 17 Slides
Celine George
 

Recently uploaded (20)

How to Configure Field Cleaning Rules in Odoo 17
How to Configure Field Cleaning Rules in Odoo 17How to Configure Field Cleaning Rules in Odoo 17
How to Configure Field Cleaning Rules in Odoo 17
 
Understanding Clergy Payroll : QuickBooks
Understanding Clergy Payroll : QuickBooksUnderstanding Clergy Payroll : QuickBooks
Understanding Clergy Payroll : QuickBooks
 
Replacing the Whole Capitalist Stack.pdf
Replacing the Whole Capitalist Stack.pdfReplacing the Whole Capitalist Stack.pdf
Replacing the Whole Capitalist Stack.pdf
 
Class-Orientation for school year 2024 - 2025
Class-Orientation for school year 2024 - 2025Class-Orientation for school year 2024 - 2025
Class-Orientation for school year 2024 - 2025
 
Stéphan Vincent-Lancrin, Deputy Head of IMEP division and Senior Analyst - P...
Stéphan Vincent-Lancrin, Deputy Head of IMEP division and Senior Analyst  - P...Stéphan Vincent-Lancrin, Deputy Head of IMEP division and Senior Analyst  - P...
Stéphan Vincent-Lancrin, Deputy Head of IMEP division and Senior Analyst - P...
 
How to Set Start Category in Odoo 17 POS
How to Set Start Category in Odoo 17 POSHow to Set Start Category in Odoo 17 POS
How to Set Start Category in Odoo 17 POS
 
Brigada eskwela 2024 sample template NARRATIVE REPORT.docx
Brigada eskwela 2024 sample template NARRATIVE REPORT.docxBrigada eskwela 2024 sample template NARRATIVE REPORT.docx
Brigada eskwela 2024 sample template NARRATIVE REPORT.docx
 
Tale of a Scholar and a Boatman ~ A Story with Life Lessons (Eng. & Chi.).pptx
Tale of a Scholar and a Boatman ~ A Story with Life Lessons (Eng. & Chi.).pptxTale of a Scholar and a Boatman ~ A Story with Life Lessons (Eng. & Chi.).pptx
Tale of a Scholar and a Boatman ~ A Story with Life Lessons (Eng. & Chi.).pptx
 
Email Marketing in Odoo 17 - Odoo 17 Slides
Email Marketing  in Odoo 17 - Odoo 17 SlidesEmail Marketing  in Odoo 17 - Odoo 17 Slides
Email Marketing in Odoo 17 - Odoo 17 Slides
 
Bagong Pilipinas Pledge in Power pointpptx
Bagong Pilipinas Pledge in Power pointpptxBagong Pilipinas Pledge in Power pointpptx
Bagong Pilipinas Pledge in Power pointpptx
 
What is the Use of API.onchange in Odoo 17
What is the Use of API.onchange in Odoo 17What is the Use of API.onchange in Odoo 17
What is the Use of API.onchange in Odoo 17
 
21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx
21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx
21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx
 
How to install python packages from Pycharm
How to install python packages from PycharmHow to install python packages from Pycharm
How to install python packages from Pycharm
 
sdintegrating21stcenturyskillsinclassroom-basedassessment-240715032004-e59ed7...
sdintegrating21stcenturyskillsinclassroom-basedassessment-240715032004-e59ed7...sdintegrating21stcenturyskillsinclassroom-basedassessment-240715032004-e59ed7...
sdintegrating21stcenturyskillsinclassroom-basedassessment-240715032004-e59ed7...
 
A history of Innisfree in Milanville, Pennsylvania
A history of Innisfree in Milanville, PennsylvaniaA history of Innisfree in Milanville, Pennsylvania
A history of Innisfree in Milanville, Pennsylvania
 
How to Use Serial Numbers to Track Products in Odoo 17 Inventory
How to Use Serial Numbers to Track Products in Odoo 17 InventoryHow to Use Serial Numbers to Track Products in Odoo 17 Inventory
How to Use Serial Numbers to Track Products in Odoo 17 Inventory
 
SD_Creating Excellent and Powerful Learning Facilitation.pptx
SD_Creating Excellent and Powerful Learning Facilitation.pptxSD_Creating Excellent and Powerful Learning Facilitation.pptx
SD_Creating Excellent and Powerful Learning Facilitation.pptx
 
Angular Roadmap For Beginner PDF By ScholarHat.pdf
Angular Roadmap For Beginner PDF By ScholarHat.pdfAngular Roadmap For Beginner PDF By ScholarHat.pdf
Angular Roadmap For Beginner PDF By ScholarHat.pdf
 
Powerpoint on Classroom Orientation2024-2025
Powerpoint on Classroom Orientation2024-2025Powerpoint on Classroom Orientation2024-2025
Powerpoint on Classroom Orientation2024-2025
 
How to Use Quality Module in Odoo 17 - Odoo 17 Slides
How to Use Quality Module in Odoo 17 - Odoo 17 SlidesHow to Use Quality Module in Odoo 17 - Odoo 17 Slides
How to Use Quality Module in Odoo 17 - Odoo 17 Slides
 

How to Load Custom Field to POS in Odoo 17 - Odoo 17 Slides

  • 1. How to Load Custom Field to POS in Odoo 17 Enterprise
  • 2. Introduction Enterprise This slide explains how to load custom fields you've created into the Odoo 17 Point-of-Sale (POS) interface.
  • 3. Enterprise There are two main approaches: 1. Loading Fields to Existing Models 2. Loading a Custom Model to the POS
  • 4. Enterprise 1. Loading Fields to Existing Models This approach involves extending the functionalities of existing POS models (e.g., product.product) to include your custom field. Steps: 1. Create the Custom Field: In your custom module, define the custom field using Odoo's field types (e.g., char, float, boolean) within your model definition.
  • 5. Enterprise 2. Extend the _loader_params_<model_name> Function: Create a function named _loader_params_<model_name> (replace <model_name> with the actual model name, e.g., product.product) by inheriting the pos.session model. This function returns a dictionary with a key named "search_params". The "search_params" value should be another dictionary with two keys: "domains" (optional): A list of domain filters to apply when searching for the model (relevant for custom filtering based on your field). "fields": A list containing your custom field name to ensure it's loaded in the POS view.
  • 6. Enterprise 3. (Optional) Override _get_pos_ui_<model_name> Function (Advanced): If you need to manipulate the retrieved data before it reaches the POS UI, you can define a function named _get_pos_ui_<model_name> . This function takes a record (e.g., product object) as input and can modify or format the custom field value before returning it.
  • 7. Enterprise Example: from odoo import models # Assuming your custom field is named "custom_field" on the "product.product" model class PosSession(models.Model): _inherit = 'pos.session' def _loader_params_product_product(self): result = super()._loader_params_product_product() result['search_params']['fields'].append(custom_field) return result
  • 8. Enterprise 2. Loading a Custom Model to the POS This approach involves creating a completely new model for your custom data and then loading it into the POS interface. Steps: ● Load the model to the pos Inherit the pos.session model and load the custom model to the pos as follows
  • 9. Enterprise class PosSession(models.Model): _inherit = 'pos.session' def _pos_ui_models_to_load(self): result = super()._pos_ui_models_to_load() result += [ custom.model ] return result
  • 10. Enterprise Create a function named _loader_params_<model_name> (replace <model_name> with the actual model name, e.g., custom.model). def _loader_params_custom_model(self): return { 'search_params': { 'domain': [], 'fields': [ ‘field1’, ‘field2’,’field3’, ‘field4’ ], }, }
  • 11. Enterprise define a function named _get_pos_ui_<model_name> . This function takes a record as input and can modify or format the custom field value before returning it. def _get_pos_ui_custom_model(self, params): return self.env[custom.model].search_read(**params['search_params' ])
  • 12. Enterprise Now create a js file and add the code below to load the custom model data into pos /** @odoo-module */ import { patch } from "@web/core/utils/patch"; import { PosStore } from "@point_of_sale/app/store/pos_store"; patch(PosStore.prototype, { async _processData(loadedData) { await super._processData(...arguments); this.model = loadedData["custom.model"]; } }, });
  • 13. Enterprise Now the custom model and its data will be available in the point of sale interface
  • 14. 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