From 1e6e353be7e18f5f9b64322796f08f2659887693 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Sat, 15 Nov 2014 17:23:08 +0100 Subject: [PATCH] [ADD] 7.0 'pos_second_header' new module to have an extra header in Point Of Sale Front End View --- pos_second_header/__init__.py | 21 ++++++++ pos_second_header/__openerp__.py | 58 +++++++++++++++++++++ pos_second_header/static/src/css/psh.css | 59 ++++++++++++++++++++++ pos_second_header/static/src/img/icon.png | Bin 0 -> 5019 bytes pos_second_header/static/src/js/psh.js | 47 +++++++++++++++++ pos_second_header/static/src/xml/psh.xml | 26 ++++++++++ 6 files changed, 211 insertions(+) create mode 100644 pos_second_header/__init__.py create mode 100644 pos_second_header/__openerp__.py create mode 100644 pos_second_header/static/src/css/psh.css create mode 100644 pos_second_header/static/src/img/icon.png create mode 100644 pos_second_header/static/src/js/psh.js create mode 100644 pos_second_header/static/src/xml/psh.xml diff --git a/pos_second_header/__init__.py b/pos_second_header/__init__.py new file mode 100644 index 00000000..2af95374 --- /dev/null +++ b/pos_second_header/__init__.py @@ -0,0 +1,21 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Point Of Sale - Second Header module for OpenERP +# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) +# @author Sylvain LE GAL (https://twitter.com/legalsylvain) +# +# 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 . +# +############################################################################## diff --git a/pos_second_header/__openerp__.py b/pos_second_header/__openerp__.py new file mode 100644 index 00000000..e866cefd --- /dev/null +++ b/pos_second_header/__openerp__.py @@ -0,0 +1,58 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Point Of Sale - Second Header module for OpenERP +# Copyright (C) 2014 GRAP (http://www.grap.coop) +# @author Sylvain LE GAL (https://twitter.com/legalsylvain) +# +# 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': 'Point Of Sale - Second Header', + 'summary': 'Add a second header in the Point Of Sale (front-end)', + 'version': '0.1', + 'category': 'sale', + 'description': """ +Add a second header in the Point Of Sale (front-end) +==================================================== + +Functionality: +-------------- + * Add a second banner in the point of sale page under the the first one,""" + """dedicated to extra-information of the current pos order; + +Copyright, Authors and Licence: +------------------------------- + * Copyright: 2014, GRAP: Groupement Régional Alimentaire de Proximité; + * Author: + * Sylvain LE GAL (https://twitter.com/legalsylvain); + * Licence: AGPL-3 (http://www.gnu.org/licenses/);""", + 'author': 'GRAP', + 'website': 'http://www.grap.coop', + 'license': 'AGPL-3', + 'depends': [ + 'point_of_sale', + ], + 'qweb': [ + 'static/src/xml/psh.xml', + ], + 'js': [ + 'static/src/js/psh.js', + ], + 'css': [ + 'static/src/css/psh.css', + ], +} diff --git a/pos_second_header/static/src/css/psh.css b/pos_second_header/static/src/css/psh.css new file mode 100644 index 00000000..0b2b26ce --- /dev/null +++ b/pos_second_header/static/src/css/psh.css @@ -0,0 +1,59 @@ +/****************************************************************************** + Point Of Sale - Second Header module for OpenERP + Copyright (C) 2014 GRAP (http://www.grap.coop) + @author Sylvain LE GAL (https://twitter.com/legalsylvain) + + 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 . +******************************************************************************/ + +/* + Overload: default display of point of sale +*/ +.point-of-sale #topheader { + height: 65px; +} + +.point-of-sale #content { + top: 65px; +} + +/* + Define: PosOrderHeaderWidget CSS +*/ +.point-of-sale #topheader #rightheader #pos_order_header{ + height: 32px; + border-top: 1px solid #373737; +} + +/* + Define: New class for further content +*/ +.point-of-sale #rightheader .extra-label{ + float:left; + color:#DDD; +/* border-right: 1px solid #373737;*/ + height:100%; + overflow:hidden; + text-overflow: ellipsis; + text-align:center; +} + +.point-of-sale #rightheader .extra-label .extra-text{ + font-size:15px; + font-style:italic; + position: relative; + top: 50%; + transform: translateY(-50%); + -webkit-transform: translateY(-50%); +} diff --git a/pos_second_header/static/src/img/icon.png b/pos_second_header/static/src/img/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..d649795a707fe9591aa83ef8ca0118933c43f3d8 GIT binary patch literal 5019 zcmZ`-XH-*7v<;DtpcD}$AcPJn>BOKnpyX(bLX71_g?G9>FGS7rM^!M003y!pTZ4@R_WiOBqu&` zj_xx=L+Yubj-VutKuUBhaZly;)YKCIpzHXzNYaJqSc!)`7&Q|N+6rSUW8+~x}qKJ{QiFjVJAu!0Dxgi9j=V<&DqWh za7K;hb}OFznp*Tb6+0eZ92>7@?EZCbP94RK9gLJv;TK%sG#jE;RvXFqRHElFqGH-N zj4Mg#02<(92~oI@&m%IbZmUqzg++2NDTi;5C(Tw?%kO3e?7Ci81xfNwnCD0p4zCCi z6j!D_Lr!vb&vIwaE?a!&pjW|SueJI+gJV3ZEk(^S-3->TVd3E%lzKb8%?^tfO&kS6 z_usxMv{7y=#f?J*$sY0n;G4XL z{Gmu>k5iW#Yd6nPXc*j}XaeG>{RGLhg$qX_^_j@X^z`(2A7gbskr2I+Nd6{D3paJS zf|oEsD(zy)ybfGaQ=^x4X%;7ce1YvFv#jiUt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QSoX&87Rv6iIP#{KjYTFNYe(lLX(e1nS;!~K0L^|%Ujzj{$i*1GT3fv zhtOm@ibF17WOyVcjaPnTauFG-Ou+wJL*2X7R4!Xv+k=t(D}+%6$}b~VayHPgufPAF zj%|$Mms6gw)Bj4jlt26-Zn$*FqnYvVdf3`p!@23dZMLW`+l$Imkx9#{yo^Q%4&r|? OfV!Fvyh7!9`2PS;`j=b) literal 0 HcmV?d00001 diff --git a/pos_second_header/static/src/js/psh.js b/pos_second_header/static/src/js/psh.js new file mode 100644 index 00000000..a7ba8f4e --- /dev/null +++ b/pos_second_header/static/src/js/psh.js @@ -0,0 +1,47 @@ +/****************************************************************************** + Point Of Sale - Second Header module for OpenERP + Copyright (C) 2014 GRAP (http://www.grap.coop) + @author Sylvain LE GAL (https://twitter.com/legalsylvain) + + 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 . +******************************************************************************/ + +openerp.pos_second_header = function (instance) { + module = instance.point_of_sale; + + /* + Define : PosOrderHeaderWidget to allow possibility to include inside + some extra informations. + */ + module.PosOrderHeaderWidget = module.PosBaseWidget.extend({ + template: 'PosOrderHeaderWidget', + + init: function(parent, options){ + this._super(parent,options); + }, + }); + + /* + Overload : PosWidget to include PosOrderHeaderWidget inside. + */ + module.PosWidget = module.PosWidget.extend({ + build_widgets: function(){ + this._super(); + this.pos_order_header = new module.PosOrderHeaderWidget(this,{}); + this.pos_order_header.appendTo(this.$('#rightheader')); + + }, + }); + +}; diff --git a/pos_second_header/static/src/xml/psh.xml b/pos_second_header/static/src/xml/psh.xml new file mode 100644 index 00000000..ae4cafed --- /dev/null +++ b/pos_second_header/static/src/xml/psh.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + +
+ + +