Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Managament
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

How to inherit Odoo 16 pos TicketScreen and add Order Ref column?

Odoberať

Get notified when there's activity on this post

This question has been flagged
posodoo16features
2 Replies
4520 Zobrazenia
Avatar
Jay

Hello, 

I want to inherit this table below in POS and add a column.
If you click on Refund Button it will get you to this table.
How do I go about this?

Thanks in advance.


Here is my code. 

class PosSession(models.Model):
_inherit = 'pos.session'

def _loader_params_pos_order(self):
result = super()._loader_params_pos_order()
result['search_params']['fields'].append('name')
return result


1
Avatar
Zrušiť
Avatar
Jay
Autor Best Answer

I found the solution to my question and here is the answer.

/** @odoo-module **/
odoo.define('pos_customizations.models', function(require) {
'use strict';

var {Order, OrderLine} = require('point_of_sale.models');
const Registries = require('point_of_sale.Registries');

const PosSaleOrder = (Order) => class PosSaleOrder extends Order {
constructor() {
super(...arguments);
this.order_ref = this.order_ref || null;
}

export_as_JSON() {
const json = super.export_as_JSON(...arguments);
json.order_ref = this.order_ref;
return json;
}

init_from_JSON(json) {
super.init_from_JSON(...arguments);
this.order_ref = json.order_ref;
}
};

Registries.Model.extend(Order, PosSaleOrder);
});


0
Avatar
Zrušiť
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,

You can refer this blog to add field onto your pos screen
https://www.cybrosys.com/blog/how-to-load-models-fields-in-the-odoo-16-pos


Hope it helps

0
Avatar
Zrušiť
Jay
Autor

Hi @Cybrosys Techno Solutions Pvt.Ltd,

I have followed the blog but the field is still not visible.
What am I missing?

Here is my code.

class PosOrder(models.Model):
_inherit = 'pos.order'

order_ref = fields.Char(string='Order Ref', compute="_getOrderRef")

@api.depends('name')
def _getOrderRef(self):
for rec in self:
rec.order_ref = rec.name
print("order_ref--->", rec.order_ref)

class PosSession(models.Model):
_inherit = 'pos.session'

def _pos_ui_pos_order(self):
result = super()._pos_ui_pos_order()
result.append('pos.order')
print("result", result)
return result

def _loader_params_pos_order(self):
return {
'search_params': {
'fields': ['order_ref'],
},
}

def _get_pos_ui_pos_order(self, params):
return self.env['pos.order'].search_read(**params['search_params'])

JS code:
/** @odoo-module **/
import { PosGlobalState } from 'point_of_sale.models';
import Registries from 'point_of_sale.Registries';
const NewPosGlobalState = (PosGlobalState) => class NewPosGlobalState extends PosGlobalState {
async _processData(loadedData) {
await super._processData(...arguments);
this.order_ref = loadedData['pos.order'];
console.log(this.order_ref)
}
}
Registries.Model.extend(PosGlobalState, NewPosGlobalState);

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrácia
Related Posts Replies Zobrazenia Aktivita
Missing Record on Closing POS Session Solved
pos odoo16features
Avatar
Avatar
2
sep 25
3072
Error POS "The operation cannot be completed: Reference must be unique per company!"
pos odoo16features
Avatar
Avatar
1
mar 24
3211
How can I add a field in the Odoo 16 POS order refund table as shown in the screenshot below. Solved
pos odoo16features
Avatar
Avatar
1
feb 24
2936
how to inherit Odoo 16 pos _getSearchFields js function for searchbar and add Order Ref Solved
pos odoo16features
Avatar
1
feb 24
3190
Odoo 16 - POS : Variable Weighting tare
pos odoo16features
Avatar
0
nov 23
2416
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now