Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • 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 Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & 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
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

POS, Extend Order Odoo V10

Subscribe

Get notified when there's activity on this post

This question has been flagged
posrestaurantpoint_of_salepos.order.linepos.order
5604 Views
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
Discard
Enjoying the discussion? Don't just read, join in!

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

Sign up
Related Posts Replies Views Activity
Point of sale - different UOMs Solved
pos restaurant point_of_sale
Avatar
Avatar
Avatar
Avatar
3
Nov 15
7585
Odoo POS product services fees Solved
pos restaurant point_of_sale Point Of Sale
Avatar
Avatar
Avatar
2
May 23
5692
POS automatically select customer based on table selected!
javascript pos customer restaurant point_of_sale
Avatar
1
May 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
5211
How to add payment method to POS orders view
pos orders restaurant payment pos.order
Avatar
Avatar
1
Apr 17
4721
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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