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

POS, Extend Order Odoo V10

Odoberať

Get notified when there's activity on this post

This question has been flagged
posrestaurantpoint_of_salepos.order.linepos.order
5569 Zobrazenia
Avatar
Joaquim lozano

Hi, 

I would like to extend the functionality of the pos module : 

1 : I would like to add a functionality to separate the orderlines
Example Order :

1x Dish
1X Dish 2
---- Next ---
1x Dessert
1x dessert 1
--- Next ---
2x coffees

When i tried with my script, the next instruction display only once and in Start order ... 

Can you help me ?

XML & Script 

XML :

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

<t t-name="NextButton">
<div class='control-button'>
<i class='fa fa-leaf' /> Next
</div>
</t>


<t t-extend="OrderWidget">

<t t-jquery=".orderlines" t-operation="append">
<t t-if="order.get_next()">
<li class="orderline-instruction">
<span><t t-esc="order.get_next()" /></span>
</li>
</t>
</t>
</t>

</templates>

JS script : 

odoo.define('pos_expanded.next', function (require) {
"use strict";

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


var _super_order = models.Order.prototype;


models.Order = models.Order.extend({
initialize: function(attr, options) {
_super_order.initialize.call(this,attr,options);
this.next = this.next || "";
},
set_next: function(next){
var orderlines = this.pos.get_order().get_orderlines();
var order = this.pos.get_order();
//console.log("last orderline", this.get_last_orderline());
//console.log("orderlines", orderlines);
//console.log("order", order);

//var list_container = $('.orderlines');
//list_container.append("<li class='orderline-next'>"+next+"</li>");
this.next = next;
this.trigger('change',this);
},

get_next: function(next){
return this.next;
},
can_be_merged_with: function(order) {
if (order.get_next() !== this.get_next()) {
return false;
} else {
return _super_order.can_be_merged_with.apply(this,arguments);
}
},
clone: function(){
var order = _super_order.clone.call(this);
order.next = this.next;
return order;
},
export_as_JSON: function(){
var json = _super_order.export_as_JSON.call(this);
json.next = this.next;
return json;
},
init_from_JSON: function(json){
_super_order.init_from_JSON.apply(this,arguments);
this.next = json.next;
},
});

var NextButton = pos_screens.ActionButtonWidget.extend({
template: 'NextButton',

button_click: function(){
console.log('Next');

var order = this.pos.get_order();
var orderlines = this.pos.get_order().get_orderlines();

order.set_next(" --- Next --- ");

},

});

pos_screens.define_action_button({
'name': 'next',
'widget': NextButton
});

});
0
Avatar
Zrušiť
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
Point of sale - different UOMs Solved
pos restaurant point_of_sale
Avatar
Avatar
Avatar
Avatar
3
nov 15
7565
Odoo POS product services fees Solved
pos restaurant point_of_sale Point Of Sale
Avatar
Avatar
Avatar
2
máj 23
5649
POS automatically select customer based on table selected!
javascript pos customer restaurant point_of_sale
Avatar
1
máj 23
137
How is the data from POS UI converted into Orders after you click validate?
pos technical point_of_sale pos.order odoo12
Avatar
Avatar
1
nov 19
5166
How to add payment method to POS orders view
pos orders restaurant payment pos.order
Avatar
Avatar
1
apr 17
4702
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