From 1b8a03161890046ea66edd66ad2a4ab1071d1d2f Mon Sep 17 00:00:00 2001 From: Mathias Neef Date: Sun, 17 Aug 2014 12:07:53 +0200 Subject: [PATCH 1/4] =initial upload --- website_sale_german_additions/__init__.py | 1 + website_sale_german_additions/__openerp__.py | 67 ++++++ .../controllers/__init__.py | 1 + .../controllers/main.py | 50 ++++ website_sale_german_additions/data/data.xml | 13 ++ .../src/css/website_sale_german_additions.css | 105 +++++++++ .../static/src/img/blocks/block_address.png | Bin 0 -> 4039 bytes .../src/js/website_sale_german_additions.js | 29 +++ .../views/snippets.xml | 22 ++ .../views/wsga_snippets.xml | 30 +++ .../views/wsga_templates.xml | 132 +++++++++++ .../views/wsga_views.xml | 214 ++++++++++++++++++ 12 files changed, 664 insertions(+) create mode 100644 website_sale_german_additions/__init__.py create mode 100644 website_sale_german_additions/__openerp__.py create mode 100644 website_sale_german_additions/controllers/__init__.py create mode 100644 website_sale_german_additions/controllers/main.py create mode 100644 website_sale_german_additions/data/data.xml create mode 100644 website_sale_german_additions/static/src/css/website_sale_german_additions.css create mode 100644 website_sale_german_additions/static/src/img/blocks/block_address.png create mode 100644 website_sale_german_additions/static/src/js/website_sale_german_additions.js create mode 100644 website_sale_german_additions/views/snippets.xml create mode 100644 website_sale_german_additions/views/wsga_snippets.xml create mode 100644 website_sale_german_additions/views/wsga_templates.xml create mode 100644 website_sale_german_additions/views/wsga_views.xml diff --git a/website_sale_german_additions/__init__.py b/website_sale_german_additions/__init__.py new file mode 100644 index 0000000000..355939a492 --- /dev/null +++ b/website_sale_german_additions/__init__.py @@ -0,0 +1 @@ +import controllers \ No newline at end of file diff --git a/website_sale_german_additions/__openerp__.py b/website_sale_german_additions/__openerp__.py new file mode 100644 index 0000000000..d34325793f --- /dev/null +++ b/website_sale_german_additions/__openerp__.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2010-2013 OpenERP s.a. (). +# Copyright (C) 2014 copado MEDIA UG (). +# Author Mathias Neef +# +# 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': 'eCommerce German additions', + 'category': 'Website', + 'summary': 'German additions for eCommerce (B2C)', + 'version': '0.1', + 'description': """ +German additions for eCommerce (B2C) +========================== + +This addon installed necessary additions in accordance with statutory requirements in Germany. + +Overview +-------- + - adds terms page + - adds revocation page + - adds delivery page + - adds privacy page + - adds imprint page + - adds an easy built-in address snippet to content blocks + - adds "incl. VAT, plus shipping costs" to every price + - adds terms and revocation popup on payment site; both are taken from terms and revocation page on the frontend + +Todo +---- + - add VAT-percentage to every "incl. VAT" + - translate all into german + - create a email template which inherits all statutory required informations + - ... + +Contact for questions +--------------------- +copado MEDIA UG - Unterdorfstr. 29 - 77948 Friesenheim - Germany - Phone: +49 7821 32725 20 - info@copado.de - http:www.copado.de + """, + 'author': 'copado MEDIA UG, Mathias Neef', + 'depends': ['website_sale'], + 'data': [ + 'views/wsga_views.xml', + 'views/wsga_templates.xml', + 'views/wsga_snippets.xml', + 'data/data.xml', + ], + 'demo': [], + 'installable': True, + 'application': True, +} \ No newline at end of file diff --git a/website_sale_german_additions/controllers/__init__.py b/website_sale_german_additions/controllers/__init__.py new file mode 100644 index 0000000000..039d9715fa --- /dev/null +++ b/website_sale_german_additions/controllers/__init__.py @@ -0,0 +1 @@ +import main \ No newline at end of file diff --git a/website_sale_german_additions/controllers/main.py b/website_sale_german_additions/controllers/main.py new file mode 100644 index 0000000000..8902185c5c --- /dev/null +++ b/website_sale_german_additions/controllers/main.py @@ -0,0 +1,50 @@ +from openerp import http +from openerp.http import request + +class website_sale_german_additions(http.Controller): + @http.route(['/page/terms', '/page/website.terms'], type='http', auth='public', website=True) + def wsga_terms(self, **kw): + return http.request.render('website_sale_german_additions.wsga_terms') + + @http.route(['/page/revocation', '/page/website.revocation'], type='http', auth='public', website=True) + def wsga_revocation(self, **kw): + return http.request.render('website_sale_german_additions.wsga_revocation') + + @http.route(['/page/delivery', '/page/website.delivery'], type='http', auth='public', website=True) + def wsga_delivery(self, **kw): + return http.request.render('website_sale_german_additions.wsga_delivery') + + @http.route(['/page/privacy', '/page/website.privacy'], type='http', auth='public', website=True) + def wsga_privacy(self, **kw): + return http.request.render('website_sale_german_additions.wsga_privacy') + + @http.route(['/page/imprint', '/page/website.imprint'], type='http', auth='public', website=True) + def wsga_privacy(self, **kw): + return http.request.render('website_sale_german_additions.wsga_imprint') + +class wsga_popover(http.Controller): + @http.route('/popover/terms/', auth="public", type='http') + def wsga_popover_terms(self, **kw): + imd = request.registry['ir.model.data'] + iuv = request.registry['ir.ui.view'] + + view_id = imd.get_object_reference(request.cr, request.uid, 'website_sale_german_additions', 'wsga_terms') + view = iuv.browse(request.cr, request.uid, [(view_id[1])], context=None) + + xml_id = view_id[1] + view_result = view[0].arch + + return http.request.render('website_sale_german_additions.wsga_popover_terms', {'html_view': view_result}) + + @http.route('/popover/revocation/', auth="public", type='http') + def wsga_popover_revocation(self, **kw): + imd = request.registry['ir.model.data'] + iuv = request.registry['ir.ui.view'] + + view_id = imd.get_object_reference(request.cr, request.uid, 'website_sale_german_additions', 'wsga_revocation') + view = iuv.browse(request.cr, request.uid, [(view_id[1])], context=None) + + xml_id = view_id[1] + view_result = view[0].arch + + return http.request.render('website_sale_german_additions.wsga_popover_revocation', {'html_view': view_result}) \ No newline at end of file diff --git a/website_sale_german_additions/data/data.xml b/website_sale_german_additions/data/data.xml new file mode 100644 index 0000000000..32c4ed1f2c --- /dev/null +++ b/website_sale_german_additions/data/data.xml @@ -0,0 +1,13 @@ + + + + + + Imprint + /page/imprint + + 200 + + + + \ No newline at end of file diff --git a/website_sale_german_additions/static/src/css/website_sale_german_additions.css b/website_sale_german_additions/static/src/css/website_sale_german_additions.css new file mode 100644 index 0000000000..f85fdc4ba5 --- /dev/null +++ b/website_sale_german_additions/static/src/css/website_sale_german_additions.css @@ -0,0 +1,105 @@ +#revlabel { + border: 1px solid #fff; + padding: 5px 5px 0; +} + +#revlabel.has-error { + border: 1px solid #a94442; + padding: 5px 5px 0; + background-color: #e3b4b3; +} + +.wsga-mb10 { + margin-bottom: 10px; +} + +.wsga-mb30 { + margin-bottom: 30px; +} + +.wsga-mb60 { + margin-bottom: 60px; +} + +.wsga-hide { + display: none; +} + +.wsga-text-right { + text-align: right; +} + +.wsga-highlight { + padding: 5px; + border: 1px solid #428bca; +} + +.wsga-fs9 { + font-size: 9px; + font-weight: normal; +} + +.wsga-fs10 { + font-size: 10px; +} + +.wsga-popover { + z-index: 1060; + /* display: none; */ + padding: 1px; + text-align: left; + white-space: normal; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #ccc; + border: 2px solid rgba(53, 126, 189, 1); + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2); + box-shadow: 0 5px 10px rgba(0, 0, 0, .2); +} + +.wsga-center { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + width: 48%; + height: 59%; +} + +.wsga-popover .popover-content { + height: 90%; + overflow-y: scroll; +} + +.wsga-cursor { + cursor: pointer; + color: #357ebd; +} + +.wsga-cursor:hover, +.wsga-curster:focus { + color: #2a6496; + text-decoration: underline; +} + +.wsga-popover iframe { + border: 0; + height: 90%; + width: 100%; +} + +.wsga-popover iframe body{ + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; +} + +.oe_product_cart h5 { + margin-bottom: 20px; +} + +.oe_product_cart .product_price { + line-height: 15px; +} + \ No newline at end of file diff --git a/website_sale_german_additions/static/src/img/blocks/block_address.png b/website_sale_german_additions/static/src/img/blocks/block_address.png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%;r~<|G(45WQh4Qg_Bc8}cGK3mF|!^`4=nGfEDdR&|KqfO$-3KavI<}8`_%Ty zBnBQ97wxi9JoEbA>AAwv!rc^l%GwBV_}Qq>Xuedp#DM-m)5WH?UBB+pyZk)-2!5%| z4RVGAzrn;u?@wc6<-^uPe0sc;N-{$7<*&QTdXLnS)ta9+jg-!Oqi^gr29~v-flWu3 z?#s`3ybE)jvU!e~;Q3s#v$9h_-XmuZYz)L(siJO&jfXZz2W}r`fAp=a9_W3neBNB2 z5*s>wV}LQfRkctF>2f-?OkRo!3jXxwGn@r}c)tbW#8`>>a;-h#ZOC*`&1_k@q`UtBrtikd&Ml9HB5lzMqF zB9=(cYN_A&YxmC9z8<@>Bml4hmKN3sN^wbI3aN?C$jrIp+lo%M@L7;*XsY@{}cG%O<<7xGVgeL z?jWQ?2mtVk{418BuQ3P5O&J2ho?wFabS3x%21r}`_s!!tl*+bPrwbV=FS_T!Lho zIT|`3)C?J937wuBRqci-%;0jKcx z_#_#qvkLClp-~IFESKV`28U7~pRRQK1dN}al(wa=^@EdU{Tue8(?VuJ72OluYsE{! za2M#Han7T%dUN^L@W;O;x8k#cL+#JBZ<-TTM{$f~+#?c_7LWkWtJWq(=Nsm*B;EZ7 zO*)%5D6>fj2vq`Z7(g6&K8IK)l<4Wift_&ab(9;S3f$dUS&xim^S;UM?zwE&1toc& zrsvCtT8!f_i#!}E@*cLaE%EF?oVz-CHg8s`)kfnNHX8ZkLp@~Neczu0nkmHn@JV4C zF9^A`LcbILZ|ZMkfAy~KWgf@{>&m*yh=~6en`$`=TPN4}(aLZa6!G7sHbbB;*BZMd F{0BOwLc9O~ literal 0 HcmV?d00001 diff --git a/website_sale_german_additions/static/src/js/website_sale_german_additions.js b/website_sale_german_additions/static/src/js/website_sale_german_additions.js new file mode 100644 index 0000000000..72ca6a9bd0 --- /dev/null +++ b/website_sale_german_additions/static/src/js/website_sale_german_additions.js @@ -0,0 +1,29 @@ +$(document).ready(function () { + + //check if revocation checkbox is checked and stop submit + $("form").submit(function(e) { + if(!$('#revbox').attr('checked')) { + e.preventDefault(); + $('#revlabel').addClass('has-error'); + $('#rev').addClass('has-error'); + } + }); + + //show and hide functions for the terms and revocation popup + $("#close-terms").click(function() { + $("#wsga-terms").hide("slow"); + }); + + $("#open-terms").click(function() { + $("#wsga-terms").show("slow"); + }); + + $("#close-revo").click(function() { + $("#wsga-revo").hide("slow"); + }); + + $("#open-revo").click(function() { + $("#wsga-revo").show("slow"); + }); + +}); \ No newline at end of file diff --git a/website_sale_german_additions/views/snippets.xml b/website_sale_german_additions/views/snippets.xml new file mode 100644 index 0000000000..7ef5b4ef0e --- /dev/null +++ b/website_sale_german_additions/views/snippets.xml @@ -0,0 +1,22 @@ + + + + + + + + \ No newline at end of file diff --git a/website_sale_german_additions/views/wsga_snippets.xml b/website_sale_german_additions/views/wsga_snippets.xml new file mode 100644 index 0000000000..7749a77701 --- /dev/null +++ b/website_sale_german_additions/views/wsga_snippets.xml @@ -0,0 +1,30 @@ + + + + + + + + \ No newline at end of file diff --git a/website_sale_german_additions/views/wsga_templates.xml b/website_sale_german_additions/views/wsga_templates.xml new file mode 100644 index 0000000000..7495072fbc --- /dev/null +++ b/website_sale_german_additions/views/wsga_templates.xml @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/website_sale_german_additions/views/wsga_views.xml b/website_sale_german_additions/views/wsga_views.xml new file mode 100644 index 0000000000..942bb93adc --- /dev/null +++ b/website_sale_german_additions/views/wsga_views.xml @@ -0,0 +1,214 @@ + + + + + + + + +