Browse Source

Uploaded pos_change_table Module

pull/81/head
cybroodoo 9 years ago
parent
commit
b6488938f5
  1. 0
      pos_change_table/__init__.py
  2. 25
      pos_change_table/__openerp__.py
  3. BIN
      pos_change_table/static/description/change_table.png
  4. 17
      pos_change_table/static/description/index.html
  5. 97
      pos_change_table/static/src/css/pos.css
  6. 105
      pos_change_table/static/src/js/floors.js
  7. 16
      pos_change_table/static/src/xml/table_change.xml
  8. 10
      pos_change_table/template.xml

0
pos_change_table/__init__.py

25
pos_change_table/__openerp__.py

@ -0,0 +1,25 @@
{
'name' : 'POS Change Table',
'version': '1.0',
'category': 'POS',
'summary': "Change Table of Order in POS ",
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'website': 'http://www.cybrosys.com',
'description': """
=======================
""",
'depends': ['point_of_sale', 'pos_restaurant','base'],
'data': [
'template.xml'
],
'qweb': [
"static/src/xml/table_change.xml",
],
'installable': True,
}

BIN
pos_change_table/static/description/change_table.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

17
pos_change_table/static/description/index.html

@ -0,0 +1,17 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">Change Table in POS</h2>
<h3 class="oe_slogan"></h3>
<div>
<p class='oe_mt32'>
This module allows you to change Table of an order from one to another by using 'change table' button in POS without cancelling the order.
</p><p>
</p>
</div>
<div class="oe_row_img oe_centered oe_mt32">
<div class= oe_picture oe_screenshot">
<img src="change_table.png">
</div>
</div>
</div>
</section>

97
pos_change_table/static/src/css/pos.css

@ -0,0 +1,97 @@
.pos .clientlist-screen .deliveryperson-list{
font-size: 16px;
width: 100%;
line-height: 40px;
}
.pos .clientlist-screen .deliveryperson-list th,
.pos .clientlist-screen .deliveryperson-list td {
padding: 0px 8px;
}
.pos .clientlist-screen .deliveryperson-list tr{
transition: all 150ms linear;
background: rgb(230,230,230);
}
.pos .clientlist-screen .deliveryperson-list thead > tr,
.pos .clientlist-screen .deliveryperson-list tr:nth-child(even) {
background: rgb(247,247,247);
}
.pos .clientlist-screen .deliveryperson-list tr.highlight{
transition: all 150ms linear;
background: rgb(110,200,155) !important;
color: white;
}
.pos .clientlist-screen .deliveryperson-list tr.lowlight{
transition: all 150ms linear;
background: rgb(216, 238, 227);
}
.pos .clientlist-screen .deliveryperson-list tr.lowlight:nth-child(even){
transition: all 150ms linear;
background: rgb(227, 246, 237);
}
.floor-map .table .time-value {
position: absolute;
text-align: center;
background: blue;
margin-top: 5px;
height: 20px;
line-height: 20px;
border-radius: 1px;
font-size: 16px;
z-index: 10;
top: 8px;
left: 16px;
width: 70px;
}
.floor-map .table .round-time {
top: 50px !important;
left: 70px !important;
}
.floor-map .table .order-value {
position: absolute;
text-align: center;
background: #0D823C;
margin-top: -50px;
margin-left: -10px;
height: 17px;
line-height: 17px;
border-radius: 10px;
z-index: 10;
left: 0px;
right: 0;
font-size: 12px;
margin: 0 12px;
bottom: 26px;
}
.floor-map .table .round-value {
height: 20px !important;
margin: 0 55px !important;
line-height: 20px !important;
bottom: 65px !important;
}
.floor-map .table .labels {
display: block;
max-height: 100%;
overflow: hidden;
position: relative;
bottom: 4px;
z-index: 5;
}
.pos .order-button.change-floor-button .fa {
font-size: 24px;
}
.pos .order-button.change-floor-button {
font-weight: bold;
font-size: 16px;
min-width: 128px;
padding-left: 16px;
padding-right: 16px;
}

105
pos_change_table/static/src/js/floors.js

@ -0,0 +1,105 @@
odoo.define('pos_change_table.floors', function (require) {
"use strict";
var chrome = require('point_of_sale.chrome');
var gui = require('point_of_sale.gui');
var models = require('point_of_sale.models');
var screens = require('point_of_sale.screens');
var core = require('web.core');
var QWeb = core.qweb;
var floor = require('pos_restaurant.floors');
// We need to modify the OrderSelector to hide itself when we're on
// the floor plan
chrome.OrderSelectorWidget.include({
change_floor_button_click_handler: function(){
this.pos.change_table = true;
this.pos.previous_order_id = this.pos.get_order();
this.pos.set_table(null);
},
renderElement: function(){
var self = this;
this._super();
if (this.pos.config.iface_floorplan) {
if (this.pos.get_order()) {
if (this.pos.table && this.pos.table.floor) {
this.$('.orders').prepend(QWeb.render('ChangeFloorButton'));
this.$('.change-floor-button').click(function(){
self.change_floor_button_click_handler();
});
}
this.$el.removeClass('oe_invisible');
} else {
this.$el.addClass('oe_invisible');
}
}
},
});
// We need to change the way the regular UI sees the orders, it
// needs to only see the orders associated with the current table,
// and when an order is validated, it needs to go back to the floor map.
//
// And when we change the table, we must create an order for that table
// if there is none.
var _super_posmodel = models.PosModel.prototype;
models.PosModel = models.PosModel.extend({
initialize: function(session, attributes) {
this.change_table = false;
this.previous_order_id= false;
return _super_posmodel.initialize.call(this,session,attributes);
},
// changes the current table.
set_table: function(table) {
if (this.change_table){
if (!table) { // no table ? go back to the floor plan, see ScreenSelector
this.set_order(null);
}
else {
this.previous_order_id.table = table;
this.change_table = false;
// table ? load the associated orders ...
this.table = table;
var orders = this.get_order_list();
if (orders.length) {
this.set_order(orders[0]); // and go to the first one ...
} else {
this.add_new_order(); // or create a new order with the current table
}
}
}
else{
_super_posmodel.set_table.apply(this,arguments);
}
if (!table) { // no table ? go back to the floor plan, see ScreenSelector
this.set_order(null);
}
else {
if(this.change_table){
this.previous_order_id.table = table;
this.change_table = false;
}
// table ? load the associated orders ...
this.table = table;
var orders = this.get_order_list();
if (orders.length) {
this.set_order(orders[0]); // and go to the first one ...
} else {
this.add_new_order(); // or create a new order with the current table
}
}
},
});
});

16
pos_change_table/static/src/xml/table_change.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="ChangeFloorButton">
<span class="order-button change-floor-button">
<i class='fa fa-angle-double-left'/>
<span class='table-name'>
Change Table
</span>
</span>
</t>
</templates>

10
pos_change_table/template.xml

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="assets" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<script type="text/javascript" src="/pos_change_table/static/src/js/floors.js"></script>
</xpath>
</template>
</data>
</openerp>
Loading…
Cancel
Save