Explorar o código

commit inicial

Rodney Elpidio Enciso Arias %!s(int64=7) %!d(string=hai) anos
achega
8000db0644

+ 1 - 0
__init__.py

@@ -0,0 +1 @@
+import pos

BIN=BIN
__init__.pyc


+ 51 - 0
__openerp__.py

@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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': 'Point of Sale (pos) Logo and Time',
+    'category': 'Point Of Sale', 
+    'version': '1.0',
+    'description': """
+Addons to Point of Sale
+========================================
+
+To add features like,
+
+To Update Point of Sale Logo from pos config
+To display Time in Point of Sale which shall be configured at Pos Config for 12/24 Hours Format
+
+    """,
+    'author': 'Murali Krishna Reddy',
+    'website': 'http://www.credativ.in',
+    'sequence':0,
+    'depends': ['base', 'web', 'point_of_sale'],
+    'images':['main_screenshot.png'],
+    'data': [
+        'pos_view.xml',
+    ],
+    'qweb': ['static/src/xml/*.xml'],
+    'installable': True,
+    'auto_install': False,
+    'application': False,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 51 - 0
__openerp__.py~

@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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': 'Point of Sale Logo and Time',
+    'category': 'Point Of Sale', 
+    'version': '1.0',
+    'description': """
+Addons to Point of Sale
+========================================
+
+To add features like,
+
+To Update Point of Sale Logo from pos config
+To display Time in Point of Sale which shall be configured at Pos Config for 12/24 Hous Format
+
+    """,
+    'author': 'Murali Krishna Reddy',
+    'website': 'http://www.credativ.in',
+    'sequence':0,
+    'depends': ['base', 'web', 'point_of_sale'],
+    'images':['images/main_screenshot.png'],
+    'data': [
+        'pos_view.xml',
+    ],
+    'qweb': ['static/src/xml/*.xml'],
+    'installable': True,
+    'auto_install': False,
+    'application': False,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 3 - 0
controllers/__init__.py

@@ -0,0 +1,3 @@
+import main
+
+# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4:

+ 66 - 0
controllers/main.py

@@ -0,0 +1,66 @@
+import functools
+import logging
+from datetime import datetime, timedelta
+import time
+import simplejson
+import urlparse
+import werkzeug.utils
+from werkzeug.exceptions import BadRequest
+
+import openerp
+from openerp import SUPERUSER_ID
+from openerp import http
+from openerp.http import request
+from openerp.addons.web.controllers.main import db_monodb, ensure_db, set_cookie_and_redirect, login_and_redirect
+from openerp.addons.auth_signup.controllers.main import AuthSignupHome as Home
+from openerp.modules.registry import RegistryManager
+from openerp.tools.translate import _
+import openerp.pooler as pooler
+_logger = logging.getLogger(__name__)
+
+
+#----------------------------------------------------------
+# Controller
+#----------------------------------------------------------
+class LockoutSign(openerp.addons.web.controllers.main.Home):
+    
+    @http.route()
+    def web_login(self, *args, **kw):        
+        ensure_db() 
+        dbname = request.session.db        
+        registry = RegistryManager.get(dbname)
+        #cr = registry.cursor()
+        cr = request.cr
+        response = super(LockoutSign, self).web_login(*args, **kw)  
+        if response.is_qweb and response.qcontext.has_key('error'):
+            error = response.qcontext['error']
+            if error:
+                if request.httprequest.method == 'POST':
+                    old_uid = request.uid
+                    company_ids = pooler.get_pool(request.session.db).get('res.company').search(cr, SUPERUSER_ID, [])
+                    company = pooler.get_pool(request.session.db).get('res.company').browse(cr, SUPERUSER_ID, company_ids[0])
+                    attempt_cnt = company.attempt_cnt
+                    unlock_after = company.lockouttime_id.value
+                    unlock_after_name = company.lockouttime_id.name
+                    uid = request.session.authenticate(request.session.db, request.params['login'], request.params['password'])
+                    if uid is False:
+                        uloginids = pooler.get_pool(request.session.db).get('res.users').search(cr, SUPERUSER_ID, [('login','=',request.params['login'])])
+                        for lid in pooler.get_pool(request.session.db).get('res.users').browse(cr, SUPERUSER_ID, uloginids):
+                            if lid.flg_userlocked:
+                                if unlock_after==0:
+                                    error = 'Your Login is temporarily Locked. Please Contact Administrator to Unlock it.'
+                                else:
+                                    error = 'Your Login is temporarily Locked. Please try after '+unlock_after_name
+                            else:        
+                                wronglogin_cnt = lid.wronglogin_cnt and lid.wronglogin_cnt+1 or 1
+                                pooler.get_pool(request.session.db).get('res.users').write(cr, SUPERUSER_ID,[lid.id],{'wronglogin_cnt': wronglogin_cnt})
+                                if int(lid.wronglogin_cnt)>=int(attempt_cnt):
+                                    pooler.get_pool(request.session.db).get('res.users').write(cr, SUPERUSER_ID,[lid.id],{'flg_userlocked': True,'userlocked_datetime':time.strftime('%Y-%m-%d %H:%M:%S')})
+                                    if unlock_after==0:
+                                        error = 'Your Login is temporarily Locked. Please Contact Administrator to Unlock it.'
+                                    else:
+                                        error = 'Your Login is temporarily Locked. Please try after '+unlock_after_name
+                response.qcontext['error'] = error
+        return response
+        
+# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4:

+ 66 - 0
controllers/main.py~

@@ -0,0 +1,66 @@
+import functools
+import logging
+from datetime import datetime, timedelta
+import time
+import simplejson
+import urlparse
+import werkzeug.utils
+from werkzeug.exceptions import BadRequest
+
+import openerp
+from openerp import SUPERUSER_ID
+from openerp import http
+from openerp.http import request
+from openerp.addons.web.controllers.main import db_monodb, ensure_db, set_cookie_and_redirect, login_and_redirect
+from openerp.addons.auth_signup.controllers.main import AuthSignupHome as Home
+from openerp.modules.registry import RegistryManager
+from openerp.tools.translate import _
+import openerp.pooler as pooler
+_logger = logging.getLogger(__name__)
+
+
+#----------------------------------------------------------
+# Controller
+#----------------------------------------------------------
+class LockoutSign(openerp.addons.web.controllers.main.Home):
+    
+    @http.route()
+    def web_login(self, *args, **kw):        
+        ensure_db() 
+        dbname = request.session.db        
+        registry = RegistryManager.get(dbname)
+        #cr = registry.cursor()
+        cr = request.cr
+        response = super(LockoutSign, self).web_login(*args, **kw)  
+        if response.is_qweb and response.qcontext.has_key('error'):
+            error = response.qcontext['error']
+            if error:
+                if request.httprequest.method == 'POST':
+                    old_uid = request.uid
+                    company_ids = pooler.get_pool(request.session.db).get('res.company').search(cr, SUPERUSER_ID, [])
+                    company = pooler.get_pool(request.session.db).get('res.company').browse(cr, SUPERUSER_ID, company_ids[0])
+                    attempt_cnt = company.attempt_cnt
+                    unlock_after = company.lockouttime_id.value
+                    unlock_after_name = company.lockouttime_id.name
+                    uid = request.session.authenticate(request.session.db, request.params['login'], request.params['password'])
+                    if uid is False:
+                        uloginids = pooler.get_pool(request.session.db).get('res.users').search(cr, SUPERUSER_ID, [('login','=',request.params['login'])])
+                        for lid in pooler.get_pool(request.session.db).get('res.users').browse(cr, SUPERUSER_ID, uloginids):
+                            if lid.flg_userlocked:
+                                if unlock_after==0:
+                                    error = 'Your Login is temporarily Locked. Please Contact Administrator to Unlock it.'
+                                else:
+                                    error = 'Your Login is temporarily Locked. Please try after '+unlock_after_name
+                            else:        
+                                wronglogin_cnt = lid.wronglogin_cnt and lid.wronglogin_cnt+1 or 1
+                                pooler.get_pool(request.session.db).get('res.users').write(cr, SUPERUSER_ID,[lid.id],{'wronglogin_cnt': wronglogin_cnt})
+                                if int(lid.wronglogin_cnt)>int(attempt_cnt):
+                                    pooler.get_pool(request.session.db).get('res.users').write(cr, SUPERUSER_ID,[lid.id],{'flg_userlocked': True,'userlocked_datetime':time.strftime('%Y-%m-%d %H:%M:%S')})
+                                    if unlock_after==0:
+                                        error = 'Your Login is temporarily Locked. Please Contact Administrator to Unlock it.'
+                                    else:
+                                        error = 'Your Login is temporarily Locked. Please try after '+unlock_after_name
+                response.qcontext['error'] = error
+        return response
+        
+# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4:

BIN=BIN
main_screenshot.png


+ 90 - 0
pos.py

@@ -0,0 +1,90 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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/>.
+#
+##############################################################################
+
+import logging
+import time
+
+from openerp import tools
+from openerp.osv import fields, osv
+from openerp.tools.translate import _
+
+import openerp.addons.decimal_precision as dp
+import openerp.addons.product.product
+import base64
+
+_logger = logging.getLogger(__name__)
+
+class pos_config(osv.osv):
+    _inherit = 'pos.config'    
+    
+    def _get_image(self, cr, uid, ids, name, args, context=None):
+        result = dict.fromkeys(ids, False)
+        for obj in self.browse(cr, uid, ids, context=context):
+            result[obj.id] = tools.image_get_resized_images(obj.image)
+        return result
+
+    def _set_image(self, cr, uid, id, name, value, args, context=None):
+        return self.write(cr, uid, [id], {'image': tools.image_resize_image_big(value)}, context=context)
+        
+
+        
+    
+    def _get_default_image(self, cr, uid, context=None):
+        image_path = openerp.modules.get_module_resource('pos_logo', 'static/src/img', 'default.png')
+        return tools.image_resize_image_big(open(image_path, 'rb').read().encode('base64'))       
+        
+        
+    _columns = {
+        'image': fields.binary("Logo",
+            		help="This field holds the image, limited to 1024x1024px."),
+	'image_medium': fields.function(_get_image, fnct_inv=_set_image,
+            	string="Medium-sized photo", type="binary", multi="_get_image",
+            	     store = {
+                	'pos.config': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
+            	},
+            	     help="Medium-sized photo of the student. It is automatically "\
+                 "resized as a 128x128px image, with aspect ratio preserved. "\
+                 "Use this field in form views or some kanban views."),
+	'image_small': fields.function(_get_image, fnct_inv=_set_image,
+		    string="Small-sized photo", type="binary", multi="_get_image",
+		    store = {
+		        'pos.config': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
+		    },
+		    help="Small-sized photo of the employee. It is automatically "\
+		         "resized as a 64x64px image, with aspect ratio preserved. "\
+		         "Use this field anywhere a small image is required."),
+        'time_format':fields.selection([('12','12 Hour Format'),('24','24 Hour Format')],'Time Format'),
+    }
+    _defaults={
+        'image_medium':_get_default_image,
+        'time_format':'24',
+    }
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+

BIN=BIN
pos.pyc


+ 90 - 0
pos.py~

@@ -0,0 +1,90 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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/>.
+#
+##############################################################################
+
+import logging
+import time
+
+from openerp import tools
+from openerp.osv import fields, osv
+from openerp.tools.translate import _
+
+import openerp.addons.decimal_precision as dp
+import openerp.addons.product.product
+import base64
+
+_logger = logging.getLogger(__name__)
+
+class pos_config(osv.osv):
+    _inherit = 'pos.config'    
+    
+    def _get_image(self, cr, uid, ids, name, args, context=None):
+        result = dict.fromkeys(ids, False)
+        for obj in self.browse(cr, uid, ids, context=context):
+            result[obj.id] = tools.image_get_resized_images(obj.image)
+        return result
+
+    def _set_image(self, cr, uid, id, name, value, args, context=None):
+        return self.write(cr, uid, [id], {'image': tools.image_resize_image_big(value)}, context=context)
+        
+
+        
+    
+    def _get_default_image(self, cr, uid, context=None):
+        image_path = openerp.modules.get_module_resource('pos_logo', 'static/src/img', 'default.png')
+        return tools.image_resize_image_big(open(image_path, 'rb').read().encode('base64'))       
+        
+        
+    _columns = {
+        'image': fields.binary("Logo",
+            		help="This field holds the image, limited to 1024x1024px."),
+	'image_medium': fields.function(_get_image, fnct_inv=_set_image,
+            	string="Medium-sized photo", type="binary", multi="_get_image",
+            	     store = {
+                	'pos.config': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
+            	},
+            	     help="Medium-sized photo of the student. It is automatically "\
+                 "resized as a 128x128px image, with aspect ratio preserved. "\
+                 "Use this field in form views or some kanban views."),
+	'image_small': fields.function(_get_image, fnct_inv=_set_image,
+		    string="Small-sized photo", type="binary", multi="_get_image",
+		    store = {
+		        'pos.config': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
+		    },
+		    help="Small-sized photo of the employee. It is automatically "\
+		         "resized as a 64x64px image, with aspect ratio preserved. "\
+		         "Use this field anywhere a small image is required."),
+        'time_format':fields.selection([('12','12 Hours Format'),('24','24 Hours Format')],'Time Format'),
+    }
+    _defaults={
+        'image_medium':_get_default_image,
+        'time_format':'24',
+    }
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+

+ 28 - 0
pos_view.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+        
+        <record model="ir.ui.view" id="view_pos_config_form_inh_poslogo">
+            <field name="name">pos.config.form.view.inh.poslogo</field>
+            <field name="model">pos.config</field>
+	    <field name="inherit_id" ref="point_of_sale.view_pos_config_form"/>
+            <field name="arch" type="xml">
+                <label for="name" position="before">
+                    <group>
+			<field name="image_medium" widget='image' class="oe_left oe_avatar" nolabel="1"/>
+		    </group>
+                </label>
+                <field name="iface_big_scrollbars" position="after">
+		    <field name="time_format" required="1"/>
+                </field>
+	    </field>
+	</record>
+	
+	<template id="pos_logo_extend" name="pos_logo" inherit_id="web.assets_backend">
+            <xpath expr="." position="inside">
+                <script type="text/javascript" src="/pos_logo/static/src/js/pos_logo.js"></script>               
+            </xpath>
+        </template>
+
+    </data>
+</openerp>

+ 28 - 0
pos_view.xml~

@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+        
+        <record model="ir.ui.view" id="view_pos_config_form_inh_poslogo">
+            <field name="name">pos.config.form.view.inh.poslogo</field>
+            <field name="model">pos.config</field>
+	    <field name="inherit_id" ref="point_of_sale.view_pos_config_form"/>
+            <field name="arch" type="xml">
+                <label for="name" position="before">
+                    <group>
+			<field name="image_medium" widget='image' class="oe_left oe_avatar" nolabel="1"/>
+		    </group>
+                </label>
+                <field name="iface_invoicing" position="after">
+		    <field name="time_format" required="1"/>
+                </field>
+	    </field>
+	</record>
+	
+	<template id="pos_logo_extend" name="pos_logo" inherit_id="web.assets_backend">
+            <xpath expr="." position="inside">
+                <script type="text/javascript" src="/pos_logo/static/src/js/pos_logo.js"></script>               
+            </xpath>
+        </template>
+
+    </data>
+</openerp>

BIN=BIN
static/description/icon.png


+ 39 - 0
static/description/index.html

@@ -0,0 +1,39 @@
+<section class="oe_container">
+    <div class="oe_row oe_spaced">
+        <div class="oe_span12">
+            <h2 class="oe_slogan">POS with Configured Logo and Current Time</h2>
+            <h3 class="oe_slogan">To show Logo added at point of Sales Configuration and also to show Current Time in 12/24 Hour Format</h3>
+        </div>
+        <div class="oe_span6">
+            <p class="oe_mt32">
+Configute the Point of Sales and add the Image which shall be shown with that Point of Sale while doing Sales.
+            </p>
+        </div>
+        <div class="oe_span6">
+            <div class="oe_row_img oe_centered">
+                <img class="oe_picture oe_screenshot" src="pos_screen1.png">
+            </div>
+        </div>
+        <div class="oe_span6">
+            <p class="oe_mt32">
+Configute the Point of Sales for Time Format.
+            </p>
+        </div>
+        <div class="oe_span6">
+            <div class="oe_row_img oe_centered">
+                <img class="oe_picture oe_screenshot" src="pos_screen2.png">
+            </div>
+        </div>
+        <div class="oe_span6">
+            <p class="oe_mt32">
+You shall be able to get the Configured Image and Time at Point of Sales selling Screen.
+            </p>
+        </div>
+        <div class="oe_span6">
+            <div class="oe_row_img oe_centered">
+                <img class="oe_picture oe_screenshot" src="pos_screen3.png">
+            </div>
+        </div>
+    </div>
+</section>
+

+ 39 - 0
static/description/index.html~

@@ -0,0 +1,39 @@
+<section class="oe_container">
+    <div class="oe_row oe_spaced">
+        <div class="oe_span12">
+            <h2 class="oe_slogan">POS with Configured Logo and Current Time</h2>
+            <h3 class="oe_slogan">Point of Sale with Logo added at point of Sales Configuration and also to show Current Time in 12/24 Hour Format</h3>
+        </div>
+        <div class="oe_span6">
+            <p class="oe_mt32">
+Configute the Point of Sales and add the Image which shall be shown with that Point of Sale while doing Sales.
+            </p>
+        </div>
+        <div class="oe_span6">
+            <div class="oe_row_img oe_centered">
+                <img class="oe_picture oe_screenshot" src="pos_screen1.png">
+            </div>
+        </div>
+        <div class="oe_span6">
+            <p class="oe_mt32">
+Configute the Point of Sales for Time Format.
+            </p>
+        </div>
+        <div class="oe_span6">
+            <div class="oe_row_img oe_centered">
+                <img class="oe_picture oe_screenshot" src="pos_screen2.png">
+            </div>
+        </div>
+        <div class="oe_span6">
+            <p class="oe_mt32">
+You shall be able to get the Configured Image and Time at Point of Sales selling Screen.
+            </p>
+        </div>
+        <div class="oe_span6">
+            <div class="oe_row_img oe_centered">
+                <img class="oe_picture oe_screenshot" src="pos_screen3.png">
+            </div>
+        </div>
+    </div>
+</section>
+

BIN=BIN
static/description/pos_screen1.png


BIN=BIN
static/description/pos_screen2.png


BIN=BIN
static/description/pos_screen3.png


BIN=BIN
static/description/support.png


BIN=BIN
static/images/main_screenshot.png


BIN=BIN
static/src/img/default.png


+ 117 - 0
static/src/js/pos_logo.js

@@ -0,0 +1,117 @@
+openerp.pos_logo = function(instance){
+     var module = instance.point_of_sale;
+     var Qweb = instance.web.qweb;
+     var _t =    instance.web._t;
+    
+    module.ImageWidget = module.PosWidget.include({
+       start: function() {
+            var self = this;
+            return self.pos.ready.done(function() {
+                if ($.browser.chrome) {
+                    var chrome_version = $.browser.version.split('.')[0];
+                    if (parseInt(chrome_version, 10) >= 50) {
+                        openerp.loadCSS('/point_of_sale/static/src/css/chrome50.css');
+                    }
+                }
+
+                // remove default webclient handlers that induce click delay
+                $(document).off();
+                $(window).off();
+                $('html').off();
+                $('body').off();
+                $(self.$el).parent().off();
+                $('document').off();
+                $('.oe_web_client').off();
+                $('.openerp_webclient_container').off();
+
+
+                self.renderElement();
+                
+                self.$('.neworder-button').click(function(){
+                    self.pos.add_new_order();
+                });
+
+                self.$('.deleteorder-button').click(function(){
+                    if( !self.pos.get('selectedOrder').is_empty() ){
+                        self.screen_selector.show_popup('confirm',{
+                            message: _t('Destroy Current Order ?'),
+                            comment: _t('You will lose any data associated with the current order'),
+                            confirm: function(){
+                                self.pos.delete_current_order();
+                            },
+                        });
+                    }else{
+                        self.pos.delete_current_order();
+                    }
+                });
+                
+                //when a new order is created, add an order button widget
+                self.pos.get('orders').bind('add', function(new_order){
+                    var new_order_button = new module.OrderButtonWidget(null, {
+                        order: new_order,
+                        pos: self.pos
+                    });
+                    new_order_button.appendTo(this.$('.orders'));
+                    new_order_button.selectOrder();
+                }, self);
+
+                self.pos.add_new_order();
+
+                self.build_widgets();
+
+                if(self.pos.config.iface_big_scrollbars){
+                    self.$el.addClass('big-scrollbars');
+                }
+
+                self.screen_selector.set_default_screen();
+
+                self.pos.barcode_reader.connect();
+
+                instance.webclient.set_content_full_screen(true);
+
+                self.$('.loader').animate({opacity:0},1500,'swing',function(){self.$('.loader').addClass('oe_hidden');});
+                
+                instance.web.cordova.send('posready');
+
+                self.pos.push_order();
+                var $image = self.$('#image');
+                $image.attr("src",'/web/binary/image?model=pos.config&field=image&id='+self.pos.config.id);
+                $image.css( { marginLeft : "5px", marginTop : "3px", width:'60px', 'border-radius':'3px' } );
+                
+                var $time = self.$('#timeSpan');
+                $time.text("testing");
+                $time.css( { color : "#DDD", fontSize:'20px', marginLeft:'15px', fontStyle:'italic', verticalAlign:'100%' } );
+                
+                self.loaded();
+            }).fail(function(err){   // error when loading models data from the backend
+                self.loading_error(err);
+            });
+        },
+        loaded:function(){
+        var self = this; 
+        time_format = self.pos.config.time_format;
+        startTime(time_format);        
+        },
+        
+    });
+    function startTime(time_format) {
+                time_format = time_format;
+                var self = this; 
+    		var today = new Date();
+		var h = today.getHours();
+    		var m = today.getMinutes();
+    		var s = today.getSeconds();
+    		var ampm = '';
+    		if(time_format=='12'){
+    		h = h % 12;
+  		h = h ? h : 12;
+    		ampm = h >= 12 ? 'PM' : 'AM';
+    		}
+    		h = h<10? "0"+h :h;
+    		m = m<10? "0"+m :m;
+    		s = s<10? "0"+s :s;
+    		var $time = self.$('#timeSpan');
+                $time.text(h + ":" + m + ":" + s + " " + ampm);
+                var t=setTimeout(startTime,500,time_format);
+	}
+};

+ 109 - 0
static/src/js/pos_logo.js~

@@ -0,0 +1,109 @@
+openerp.pos_logo = function(instance){
+     var module = instance.point_of_sale;
+     var Qweb = instance.web.qweb;
+     var _t =    instance.web._t;
+    
+    module.ImageWidget = module.PosWidget.include({
+       start: function() {
+            var self = this;
+            return self.pos.ready.done(function() {
+                // remove default webclient handlers that induce click delay
+                $(document).off();
+                $(window).off();
+                $('html').off();
+                $('body').off();
+                $(self.$el).parent().off();
+                $('document').off();
+                $('.oe_web_client').off();
+                $('.openerp_webclient_container').off();
+
+                self.build_currency_template();
+                self.renderElement();
+                
+                self.$('.neworder-button').click(function(){
+                    self.pos.add_new_order();
+                });
+
+                self.$('.deleteorder-button').click(function(){
+                    if( !self.pos.get('selectedOrder').is_empty() ){
+                        self.screen_selector.show_popup('confirm',{
+                            message: _t('Destroy Current Order ?'),
+                            comment: _t('You will lose any data associated with the current order'),
+                            confirm: function(){
+                                self.pos.delete_current_order();
+                            },
+                        });
+                    }else{
+                        self.pos.delete_current_order();
+                    }
+                });
+                
+                //when a new order is created, add an order button widget
+                self.pos.get('orders').bind('add', function(new_order){
+                    var new_order_button = new module.OrderButtonWidget(null, {
+                        order: new_order,
+                        pos: self.pos
+                    });
+                    new_order_button.appendTo(this.$('.orders'));
+                    new_order_button.selectOrder();
+                }, self);
+
+                self.pos.add_new_order();
+
+                self.build_widgets();
+
+                if(self.pos.config.iface_big_scrollbars){
+                    self.$el.addClass('big-scrollbars');
+                }
+
+                self.screen_selector.set_default_screen();
+
+                self.pos.barcode_reader.connect();
+
+                instance.webclient.set_content_full_screen(true);
+
+                self.$('.loader').animate({opacity:0},1500,'swing',function(){self.$('.loader').addClass('oe_hidden');});
+
+                self.pos.push_order();
+                var $image = self.$('#image');
+                $image.attr("src",'/web/binary/image?model=pos.config&field=image&id='+self.pos.config.id);
+                $image.css( { marginLeft : "5px", marginTop : "3px", width:'60px', 'border-radius':'3px' } );
+                
+                var $time = self.$('#timeSpan');
+                $time.text("testing");
+                $time.css( { color : "#DDD", fontSize:'20px', marginLeft:'15px', fontStyle:'italic', verticalAlign:'100%' } );
+                
+                self.loaded();
+            }).fail(function(err){   // error when loading models data from the backend
+                self.loading_error(err);
+            });
+        },
+        loaded:function(){
+        var self = this; 
+        time_format = self.pos.config.time_format;
+        startTime(time_format);
+        
+        },
+        
+    });
+    function startTime(time_format) {
+                time_format = time_format;
+                var self = this; 
+    		var today = new Date();
+		var h = today.getHours();
+    		var m = today.getMinutes();
+    		var s = today.getSeconds();
+    		var ampm = '';
+    		if(time_format=='12'){
+    		h = h % 12;
+  		h = h ? h : 12;
+    		ampm = h >= 12 ? 'PM' : 'AM';
+    		}
+    		h = h<10? "0"+h :h;
+    		m = m<10? "0"+m :m;
+    		s = s<10? "0"+s :s;
+    		var $time = self.$('#timeSpan');
+                $time.text(h + ":" + m + ":" + s + " " + ampm);
+                var t=setTimeout(startTime,500,time_format);
+	}
+};

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

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vim:fdl=1:
+-->
+<templates id="template" xml:space="preserve">   
+<t t-extend="PosWidget" name="ImageWidget">
+    <t t-jquery="div.pos-branding" t-operation="replace">
+        <div class="pos-branding">
+            <img id="image" style="max-height:1cm; max-width:4cm;"/>
+            <span id="timeSpan"></span>
+            <span class="placeholder-UsernameWidget"></span>
+        </div>        
+    </t>
+</t>
+</templates>
+

+ 15 - 0
static/src/xml/pos.xml~

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vim:fdl=1:
+-->
+<templates id="template" xml:space="preserve">   
+<t t-extend="PosWidget" name="ImageWidget">
+    <t t-jquery="div.pos-branding" t-operation="replace">
+        <div class="pos-branding">
+            <img id="image" style="max-height:1cm; max-width:4cm;"/>
+            <canvas id="timeSpan"></canvas>
+            <span class="placeholder-UsernameWidget"></span>
+        </div>        
+    </t>
+</t>
+</templates>
+