From 6fd3622fce4a505abc8feba6fc617213d3613c49 Mon Sep 17 00:00:00 2001 From: Ismael Calvo Date: Thu, 20 Aug 2015 12:36:14 +0200 Subject: [PATCH 1/4] [ADD] Pos Gift Ticket Module --- pos_gift_ticket/README.rst | 52 ++++++++++++++++++++++ pos_gift_ticket/__init__.py | 0 pos_gift_ticket/__openerp__.py | 39 +++++++++++++++++ pos_gift_ticket/i18n/es.po | 53 +++++++++++++++++++++++ pos_gift_ticket/i18n/pos_gift_ticket.pot | 52 ++++++++++++++++++++++ pos_gift_ticket/static/src/js/main.js | 48 +++++++++++++++++++++ pos_gift_ticket/static/src/xml/pos.xml | 55 ++++++++++++++++++++++++ pos_gift_ticket/views/pos_template.xml | 14 ++++++ 8 files changed, 313 insertions(+) create mode 100644 pos_gift_ticket/README.rst create mode 100644 pos_gift_ticket/__init__.py create mode 100644 pos_gift_ticket/__openerp__.py create mode 100644 pos_gift_ticket/i18n/es.po create mode 100644 pos_gift_ticket/i18n/pos_gift_ticket.pot create mode 100644 pos_gift_ticket/static/src/js/main.js create mode 100644 pos_gift_ticket/static/src/xml/pos.xml create mode 100644 pos_gift_ticket/views/pos_template.xml diff --git a/pos_gift_ticket/README.rst b/pos_gift_ticket/README.rst new file mode 100644 index 00000000..f993151e --- /dev/null +++ b/pos_gift_ticket/README.rst @@ -0,0 +1,52 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License: AGPL-3 + +Gift Ticket for Odoo Point of Sale +==================================== + +This module allows to print a gift ticket, which is the same ticket than normal +but without prices and taxes. + +Usage +===== + +Just press the *Gift Ticket* button that appears beside the normal print +ticket button + + +Installation +============ + +Nothing special is needed to install this module. + + +Configuration +============= + +No configuration needed. + + + +Credits +======= + +Contributors +------------ + +* Ismael Calvo + + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/pos_gift_ticket/__init__.py b/pos_gift_ticket/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/pos_gift_ticket/__openerp__.py b/pos_gift_ticket/__openerp__.py new file mode 100644 index 00000000..d8264d93 --- /dev/null +++ b/pos_gift_ticket/__openerp__.py @@ -0,0 +1,39 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright : +# (c) 2015 FactorLibre S.L. (http://www.factorlibre.com) +# Ismael Calvo +# +# 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 . +# +############################################################################## + +{ + "name": "Gift Ticket", + "version": "0.1", + "author": "FactorLibre", + "website": "http://www.factorlibre.com", + "license": "AGPL-3", + "category": "Point Of Sale", + "depends": ['base', 'point_of_sale'], + 'data': [ + "views/pos_template.xml", + ], + "qweb": [ + 'static/src/xml/pos.xml', + ], + "installable": True, +} diff --git a/pos_gift_ticket/i18n/es.po b/pos_gift_ticket/i18n/es.po new file mode 100644 index 00000000..a9b3177a --- /dev/null +++ b/pos_gift_ticket/i18n/es.po @@ -0,0 +1,53 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_gift_ticket +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-08-17 07:44+0000\n" +"PO-Revision-Date: 2015-08-17 07:44+0000\n" +"Last-Translator: Ismael Calvo \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: pos_gift_ticket +#. openerp-web +#: code:addons/pos_gift_ticket/static/src/xml/pos.xml:22 +#, python-format +msgid "GIFT TICKET" +msgstr "TICKET REGALO" + +#. module: pos_gift_ticket +#. openerp-web +#: code:addons/pos_gift_ticket/static/src/js/main.js:19 +#, python-format +msgid "Gift Ticket" +msgstr "Ticket Regalo" + +#. module: pos_gift_ticket +#. openerp-web +#: code:addons/pos_gift_ticket/static/src/xml/pos.xml:11 +#, python-format +msgid "Phone:" +msgstr "Teléfono:" + +#. module: pos_gift_ticket +#. openerp-web +#: code:addons/pos_gift_ticket/static/src/xml/pos.xml:13 +#, python-format +msgid "Shop:" +msgstr "Tienda:" + +#. module: pos_gift_ticket +#. openerp-web +#: code:addons/pos_gift_ticket/static/src/xml/pos.xml:12 +#, python-format +msgid "User:" +msgstr "Usuario:" + diff --git a/pos_gift_ticket/i18n/pos_gift_ticket.pot b/pos_gift_ticket/i18n/pos_gift_ticket.pot new file mode 100644 index 00000000..f2085900 --- /dev/null +++ b/pos_gift_ticket/i18n/pos_gift_ticket.pot @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_gift_ticket +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-08-17 07:44+0000\n" +"PO-Revision-Date: 2015-08-17 07:44+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: pos_gift_ticket +#. openerp-web +#: code:addons/pos_gift_ticket/static/src/xml/pos.xml:22 +#, python-format +msgid "GIFT TICKET" +msgstr "" + +#. module: pos_gift_ticket +#. openerp-web +#: code:addons/pos_gift_ticket/static/src/js/main.js:19 +#, python-format +msgid "Gift Ticket" +msgstr "" + +#. module: pos_gift_ticket +#. openerp-web +#: code:addons/pos_gift_ticket/static/src/xml/pos.xml:11 +#, python-format +msgid "Phone:" +msgstr "" + +#. module: pos_gift_ticket +#. openerp-web +#: code:addons/pos_gift_ticket/static/src/xml/pos.xml:13 +#, python-format +msgid "Shop:" +msgstr "" + +#. module: pos_gift_ticket +#. openerp-web +#: code:addons/pos_gift_ticket/static/src/xml/pos.xml:12 +#, python-format +msgid "User:" +msgstr "" + diff --git a/pos_gift_ticket/static/src/js/main.js b/pos_gift_ticket/static/src/js/main.js new file mode 100644 index 00000000..96f04a5a --- /dev/null +++ b/pos_gift_ticket/static/src/js/main.js @@ -0,0 +1,48 @@ +/* + POS Gift Tickete for Odoo + Copyright (C) 2015 FactorLibre (www.factorlibre.com) + @author: Ismael Calvo + The licence is in the file __openerp__.py +*/ + + +openerp.pos_gift_ticket = function (instance) { + var _t = instance.web._t, + _lt = instance.web._lt; + var QWeb = instance.web.qweb; + + instance.point_of_sale.ReceiptScreenWidget.include({ + show: function(){ + this._super() + var self = this; + var print_gift_ticket_button = this.add_action_button({ + label: _t('Gift Ticket'), + icon: '/point_of_sale/static/src/img/icons/png48/printer.png', + click: function(){ + self.print_gift(); + }, + }); + }, + refresh_gift_ticket: function(){ + var order = this.pos.get('selectedOrder'); + $('.pos-receipt-container', this.$el).html(QWeb.render('PosGiftTicket',{ + widget:this, + order: order, + orderlines: order.get('orderLines').models, + })); + }, + print: function() { + this.refresh() + this._super() + }, + print_gift: function() { + this.refresh_gift_ticket() + this.pos.get('selectedOrder')._printed = true; + setTimeout(function() { + window.print(); + }, 2000); + // window.print(); + }, + }); + +}; diff --git a/pos_gift_ticket/static/src/xml/pos.xml b/pos_gift_ticket/static/src/xml/pos.xml new file mode 100644 index 00000000..1718d3ce --- /dev/null +++ b/pos_gift_ticket/static/src/xml/pos.xml @@ -0,0 +1,55 @@ + + + + + + + + + + +
+ +
+
+
+
+
+ Phone:
+ User:
+ Shop:
+
+ +
+ +
+
+
+
GIFT TICKET
+
+ + + + + + + + + +
+ + + +
+ +
+
+ +
+
+
+
+ +
\ No newline at end of file diff --git a/pos_gift_ticket/views/pos_template.xml b/pos_gift_ticket/views/pos_template.xml new file mode 100644 index 00000000..b02e02f8 --- /dev/null +++ b/pos_gift_ticket/views/pos_template.xml @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file From e0e95e54855c61c541384a60cb376a31d5e64641 Mon Sep 17 00:00:00 2001 From: Ismael Calvo Date: Fri, 28 Aug 2015 10:54:45 +0200 Subject: [PATCH 2/4] [ADD] OCA author --- pos_gift_ticket/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pos_gift_ticket/__openerp__.py b/pos_gift_ticket/__openerp__.py index d8264d93..40e1d99f 100644 --- a/pos_gift_ticket/__openerp__.py +++ b/pos_gift_ticket/__openerp__.py @@ -24,7 +24,7 @@ { "name": "Gift Ticket", "version": "0.1", - "author": "FactorLibre", + "author": "FactorLibre, Odoo Community Association (OCA)", "website": "http://www.factorlibre.com", "license": "AGPL-3", "category": "Point Of Sale", From 41dbe7b825c43dfb421db0830a27af2d371b4540 Mon Sep 17 00:00:00 2001 From: Ismael Calvo Date: Mon, 31 Aug 2015 14:28:16 +0200 Subject: [PATCH 3/4] [ADD] Gift Ticket Missing features --- pos_gift_ticket/README.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pos_gift_ticket/README.rst b/pos_gift_ticket/README.rst index f993151e..250db58e 100644 --- a/pos_gift_ticket/README.rst +++ b/pos_gift_ticket/README.rst @@ -25,6 +25,11 @@ Configuration No configuration needed. +Known issues / Roadmap +====================== + + + Credits From 1240080e19d07cf618f7698923f518697116ff54 Mon Sep 17 00:00:00 2001 From: Ismael Calvo Date: Mon, 31 Aug 2015 14:29:20 +0200 Subject: [PATCH 4/4] [ADD] Gift Ticket Missing features --- pos_gift_ticket/README.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pos_gift_ticket/README.rst b/pos_gift_ticket/README.rst index 250db58e..408f28e3 100644 --- a/pos_gift_ticket/README.rst +++ b/pos_gift_ticket/README.rst @@ -25,11 +25,14 @@ 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