Explorar el Código

commit inicial

Rodney Elpidio Enciso Arias hace 7 años
commit
8ee77d8cf8
Se han modificado 7 ficheros con 238 adiciones y 0 borrados
  1. 57 0
      README.rst
  2. 0 0
      __init__.py
  3. BIN
      __init__.pyc
  4. 40 0
      __openerp__.py
  5. 76 0
      static/src/js/main.js
  6. 55 0
      static/src/xml/pos.xml
  7. 10 0
      views/pos_template.xml

+ 57 - 0
README.rst

@@ -0,0 +1,57 @@
+.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
+    :alt: License: AGPL-3
+
+Kitchen Ticket for Odoo Point of Sale
+=====================================
+
+This module allows to print a kitchen ticket, which is the same ticket than normal
+but without prices and taxes. This will be useful when the order is done internally
+without the payment.
+
+It has a additional **Payment** button on the Kitchen Ticket window to change the
+flow from **Payment->Receipt** to **Receipt->Payment**.
+
+This module target the POSBoxless environments, as the POSBox environment already 
+have a Bill printing method which can be enabled with pos_restaurant module that 
+Odoo provides.
+
+Usage
+=====
+
+Just press the *Kitchen Ticket* button that appears below the order
+
+
+Installation
+============
+
+Nothing special is needed to install this module.
+
+
+Configuration
+=============
+
+No configuration needed.
+
+
+Known issues / Roadmap
+======================
+
+Missing features
+----------------
+* Not tested with a **PosBox setting** so surely will not work if *'print by
+proxy'* is enabled.
+
+
+Credits
+=======
+
+Contributors
+------------
+
+* Dhinesh D <dvdhinesh.mail@gmail.com>
+
+
+Maintainer
+----------
+
+* Dhinesh D <dvdhinesh.mail@gmail.com>

+ 0 - 0
__init__.py


BIN
__init__.pyc


+ 40 - 0
__openerp__.py

@@ -0,0 +1,40 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    This module copyright :
+#        (c) 2016 Dhinesh D <dvdhinesh.mail@gmail.com>
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+{
+    "name": "Eiru POS Kitchen Ticket",
+    "category": "Point Of Sale",
+    "version": "1.0",
+    'description': 'Impresion de ticket - Modificacion del modulo pos_kitchen_ticket',
+    "depends": [
+        'point_of_sale'
+    ],
+    'data': [
+        "views/pos_template.xml",
+    ],
+    "qweb": [
+        'static/src/xml/pos.xml',
+    ],
+    "author": "Dhinesh D - Eiru",
+    "license": "AGPL-3",
+    "installable": True, 
+}

+ 76 - 0
static/src/js/main.js

@@ -0,0 +1,76 @@
+/*
+    POS Kitchen Ticket for Odoo
+    Copyright (C) 2016 Dhinesh D <dvdhinesh.mail@gmail.com>
+    @author: Dhinesh D <dvdhinesh.mail@gmail.com>
+    The licence is in the file __openerp__.py
+*/
+
+
+openerp.eiru_kitchen_ticket = function (instance) {
+	var module   = instance.point_of_sale;
+    var _t = instance.web._t,
+        _lt = instance.web._lt;
+    var QWeb = instance.web.qweb;
+
+    module.KitchenTicketScreenWidget = module.ScreenWidget.extend({
+        template: 'KitchenTicketScreenWidget',
+
+        show_numpad:     false,
+        show_leftpane:   false,
+
+        show: function(){
+            this._super();
+            var self = this;
+            var back_button  = this.add_action_button({
+                label: _t('Back'),
+                icon: '/point_of_sale/static/src/img/icons/png48/go-previous.png',
+                click: function(){  
+                    self.back();
+                },
+            });
+            this.refresh();
+        },
+
+        print: function() {
+            this.pos.get('selectedOrder')._printed = true;
+            window.print();
+        },
+        back: function(){
+            var previous = this.pos.get('selectedOrder').get_screen_data('previous-screen');
+            if(previous){
+                this.pos_widget.screen_selector.set_current_screen(previous);
+            }
+        },
+        refresh: function() {
+            var order = this.pos.get('selectedOrder');
+            $('.pos-receipt-container', this.$el).html(QWeb.render('KitchenTicket',{
+                    widget:this,
+                    order: order,
+                    orderlines: order.get('orderLines').models,
+                }));
+        },
+    });
+
+    module.PosWidget.include({
+        build_widgets: function(){
+            var self = this;
+            this._super();
+
+            this.kitchen_ticket_screen = new module.KitchenTicketScreenWidget(this,{});
+            this.kitchen_ticket_screen.appendTo(this.$('.screens'));
+            this.screen_selector.add_screen('kitchenticket',this.kitchen_ticket_screen);
+
+            var kitchen_ticket_button = $(QWeb.render('KitchenTicketButton'));
+
+            kitchen_ticket_button.click(function(){
+                if(self.pos.get('selectedOrder').get('orderLines').models.length > 0){
+                    self.pos_widget.screen_selector.set_current_screen('kitchenticket');
+                }
+            });
+
+            kitchen_ticket_button.appendTo(this.$('.control-buttons'));
+            this.$('.control-buttons').removeClass('oe_hidden');
+        },
+    });
+
+};

+ 55 - 0
static/src/xml/pos.xml

@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<templates id="template" xml:space="preserve">
+    <t t-name="KitchenTicketScreenWidget">
+        <div class="receipt-screen screen touch-scrollable" >
+            <div class="pos-step-container">
+                <div class="pos-receipt-container">
+                </div>
+            </div>
+        </div>
+    </t>
+    <t t-name="KitchenTicketButton">
+        <span class="control-button order-printbill">
+            <i class="fa fa-print"></i>
+            Cocina
+        </span>
+    </t>
+    <t t-name="KitchenTicket">
+        <div class="pos-sale-ticket">
+            <div class="pos-center-align"><t t-esc="new Date().toString(Date.CultureInfo.formatPatterns.shortDate + ' ' +
+                Date.CultureInfo.formatPatterns.longTime)"/>
+                <br/> 
+                <t t-esc="order.get('name')"/>
+            </div>
+            <br/>
+            <t t-esc="widget.pos.company.name"/>
+            <br/>
+            <!-- Phone: <t t-esc="widget.pos.company.phone || ''"/><br /> -->
+            User: <t t-esc="widget.pos.cashier ? widget.pos.cashier.name : widget.pos.user.name"/><br/>
+            <br />
+            <div class="pos-center-align" style="font-size:20pt;font-weight:bold">Cocina</div>
+            <br />
+            <table>
+                <colgroup>
+                    <col width='75%' />
+                    <col width='25%' />
+                </colgroup>
+                <tr t-foreach="orderlines" t-as="orderline">
+                    <td>
+                        <t t-esc="orderline.get_product().display_name"/>
+                    </td>
+                    <td class="pos-right-align">
+                        <t t-esc="orderline.get_quantity_str_with_unit()"/>
+                    </td>
+                </tr>
+            </table>
+            <br />
+            <t t-if="widget.pos.config.receipt_footer">
+                <br />
+                <div style='text-align:center'>
+                    <t t-esc="widget.pos.config.receipt_footer" />
+                </div>
+            </t>
+        </div>
+    </t>
+</templates>

+ 10 - 0
views/pos_template.xml

@@ -0,0 +1,10 @@
+<openerp>
+    <data>
+        <template id="pos_kitchen_ticket_assets_backend" name="pos_kitchen_ticket_assets_backend" inherit_id="point_of_sale.assets_backend">
+            <xpath expr="." position="inside">
+                <script src="/eiru_kitchen_ticket/static/src/js/main.js"
+                        type="text/javascript"></script>
+            </xpath>
+        </template> 
+    </data>
+</openerp>