Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

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

Naroči se

Get notified when there's activity on this post

This question has been flagged
posodoo16features
2 Odgovori
4591 Prikazi
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
Opusti
Avatar
Jay
Avtor 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
Opusti
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
Opusti
Jay
Avtor

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!

Prijavi
Related Posts Odgovori Prikazi Aktivnost
Missing Record on Closing POS Session Solved
pos odoo16features
Avatar
Avatar
2
sep. 25
3127
Error POS "The operation cannot be completed: Reference must be unique per company!"
pos odoo16features
Avatar
Avatar
1
mar. 24
3241
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
2974
how to inherit Odoo 16 pos _getSearchFields js function for searchbar and add Order Ref Solved
pos odoo16features
Avatar
1
feb. 24
3204
Odoo 16 - POS : Variable Weighting tare
pos odoo16features
Avatar
0
nov. 23
2455
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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