X-Git-Url: http://git.cyclocoop.org/?p=burette%2Fpos_membership.git;a=blobdiff_plain;f=controllers%2Fmain.py;h=494c8a4cd78deadc2a685baed39020d34c9f7b1e;hp=7b2cdb2a37cb4fec158c921c523a931473c51d37;hb=f79e0489efc827e5a6b78c838d42ba5214fb6d71;hpb=e1221a0a6ff32ce1b241a4cd9f43e4c81d35d8dd diff --git a/controllers/main.py b/controllers/main.py index 7b2cdb2..494c8a4 100644 --- a/controllers/main.py +++ b/controllers/main.py @@ -1,4 +1,25 @@ # -*- coding: utf-8 -*- +############################################################################## +# +# POS Membership module for OpenERP, Manage membership payments from POS. +# Copyright (C) 2013 L'Heureux Cyclage () +# +# This file is a part of POS Membership +# +# POS Membership is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ReMembership 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## import os import openerp @@ -26,7 +47,7 @@ class PointOfSaleController(PointOfSaleController): @openerp.addons.web.http.httprequest def manifest(self, req, **kwargs): - """ This generates a HTML5 cache manifest files that preloads the categories and products thumbnails + """ This generates a HTML5 cache manifest files that preloads the categories and products thumbnails and other ressources necessary for the point of sale to work offline """ ml = ["CACHE MANIFEST"] @@ -42,19 +63,19 @@ class PointOfSaleController(PointOfSaleController): imgdir = openerp.modules.get_module_resource('point_of_sale','static/src/img'); load_css_img(imgdir,'/point_of_sale/static/src/img') - + products = req.session.model('product.product') for p in products.search_read([('pos_categ_id','!=',False)], ['name']): product_id = p['id'] url = "/web/binary/image?session_id=%s&model=product.product&field=image&id=%s" % (req.session_id, product_id) ml.append(url) - + categories = req.session.model('pos.category') for c in categories.search_read([],['name']): category_id = c['id'] url = "/web/binary/image?session_id=%s&model=pos.category&field=image&id=%s" % (req.session_id, category_id) ml.append(url) - + partners = req.session.model('res.partner') for c in partners.search_read([],['name']): partner_id = c['id'] @@ -68,3 +89,4 @@ class PointOfSaleController(PointOfSaleController): return m PointOfSaleController() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: