Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Add Button To Point of Sale

Subscriure's

Get notified when there's activity on this post

This question has been flagged
posbuttoncustom_module
2 Respostes
12058 Vistes
Avatar
Ameen

I am very new to Odoo  and I am trying to add a simple button to the POS left pane by creating a custom module that extends POS. I have tried several code samples I found on the internet but nothing is working.

I have Odoo 11.0 installed on C:\Program Files (x86)\Odoo 11.0. I created a custome module (rpos) using the scaffold command in C:\User\[username]\Odoo\rpos

Here is my code.

views/templates.xml

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="assets_backend" name="rpos assets" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<script type="text/javascript" src="/rpos/static/src/js/rpos.js"></script>
</xpath>
</template>
</odoo>

static/src/js/rpos.js

odoo.rpos = function(instance) {

var module = instance.point_of_sale;
var qweb = instance.web.qweb;

console.log("TEST");

module.PosWidget.include({
build_widgets: function(){
var self = this;
this._super();

cheeseBtn = $qweb.render('cheeseBtn'));
cheeseBtn.appendTo(this.$('.control-buttons'));
this.$('.control-buttons').removeClass('oe_hidden');
}
});
};


static/src/xml/templates.xml

<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">

<t t-name="cheeseBtn">
<button>Cheese</button>
</t>

</templates>

I am not even sure if my code is being loaded when I run the POS app.

Thanks


0
Avatar
Descartar
Mina

/custom-button/manifest.py

{

'name': 'CustomButton',

'summary': '',

'version': '1.0',

'description': """

""",

# 'author': '',

# 'maintainer': '',

# 'contributors': [''],

# 'website': '',

'license': 'AGPL-3',

'category': 'Uncategorized',

'depends': [

'base', 'point_of_sale',

],

'external_dependencies': {

'python': [

],

},

'data': [

'views/templates.xml',

],

'demo': [

],

'js': [

],

'css': [

],

'qweb': [

'static/src/xml/custom_button.xml',

],

'images': [

],

'test': [

],

'installable': True

}

/custom-button/views/templates.xml

<?xml version="1.0" encoding="utf-8"?>

<odoo>

<template id="assets" inherit_id="point_of_sale.assets">

<xpath expr="." position="inside">

<script type="text/javascript" src="/custom-button/static/src/js/custom.js"></script>

</xpath>

</template>

</odoo>

/custom-button/static/src/xml/custom_button.xml

<?xml version="1.0" encoding="UTF-8"?>

<templates id="template" xml:space="preserve">

<t t-name="CustomButton">

<span class="control-button">

<i class="fa fa-print"></i>

Custom Button

</span>

</t>

</templates>

/custom-button/static/src/js/custom.js

odoo.define('custom-button.custom_button', function (require) {

"use strict";

var core = require('web.core');

var screens = require('point_of_sale.screens');

var gui = require('point_of_sale.gui');

//Custom Code

var CustomButton = screens.ActionButtonWidget.extend({

template: 'CustomButton',

button_click: function(){

var self = this;

self.custom_function();

},

custom_function: function(){

console.log('Hi I am button click of CustomButton');

}

});

screens.define_action_button({

'name': 'custom_button',

'widget': CustomButton,

});

});

screenshot of the custom button in POS screen

https://github.com/minaeid90/Custom-Button

Vysakh B Thottarath

@Mina : Thanks a lot.Your GitHub code is working perfectly.

Avatar
Consultores RMS
Best Answer

Buen dia yo quiero agregar un boton en el POS despues de validar en la ultima pantalla, intento y nada me funciona siguiendo lo que indican en la web


xml version = "1.0" encoding = "utf-8"?>







t>


algunos dicen que odoo14 es difernte la programacion es cierto?

0
Avatar
Descartar
Avatar
Tando
Best Answer

Thanks this helped

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

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

Registrar-se
Related Posts Respostes Vistes Activitat
POS | No Close Session Button Solved
pos button close
Avatar
Avatar
Avatar
2
de set. 24
5157
POS offline red button not active?
pos offline button
Avatar
Avatar
Avatar
2
d’ag. 17
11496
How to create and add a button to POS payment screen under customer, and attach an on click event listener? Odoo V13
javascript pos button screen
Avatar
0
de jul. 21
5535
How to align validate button of payment screen to right in POS?
pos payment receipt button
Avatar
1
de maig 18
7551
Add print button to pos session
javascript pos print button
Avatar
Avatar
1
de març 15
7421
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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