From 0888a92075860e5adeca9e998f4b7c2156ad2a22 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Fri, 5 Sep 2014 14:51:08 +0200 Subject: [PATCH 01/14] [IMP] website: google analytic - use Automatic Cookie Domain Configuration. Automatic Cookie Domain Configuration simplifies cross domain tracking implementations by automatically writing cookies to the highest level domain possible when the auto parameter is used. When used on the domain www.example.co.uk, it will try to write cookies in the following order: co.uk example.co.uk www.example.co.uk Analytics.js will fail to write a cookie on co.uk but will succeed on example.co.uk. Since a cookie was succesfully written on a higher level domain, www.example.co.uk will be skipped. --- addons/website/views/website_templates.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml index a6b91db0ced..f7915b98874 100644 --- a/addons/website/views/website_templates.xml +++ b/addons/website/views/website_templates.xml @@ -100,7 +100,7 @@ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); - ga('create',_.str.trim('')); + ga('create', _.str.trim(''), 'auto'); ga('send','pageview'); From 70dc7c819b1b48bee005ea2fa5e3fc43e86d737e Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Fri, 5 Sep 2014 15:18:07 +0200 Subject: [PATCH 02/14] [IMP] base: Odoo-ification and bootstrapification from the "About Us" popup --- addons/web/static/src/css/base.css | 100 +++++++++++++++++++--------- addons/web/static/src/css/base.sass | 74 +++++++++++++++----- addons/web/static/src/xml/base.xml | 81 +++++++++++++++++++--- 3 files changed, 198 insertions(+), 57 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 913573a038f..edd6651b431 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1,4 +1,4 @@ -@charset "UTF-8"; +@charset "utf-8"; @font-face { font-family: "mnmliconsRegular"; src: url("/web/static/src/font/mnmliconsv21-webfont.eot") format("eot"); @@ -975,42 +975,82 @@ .openerp .oe_secondary_submenu .oe_secondary_submenu li { margin-left: 20px; } -.openerp .oe_about { - background-color: white; - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAKUlEQVQIHWO8e/fufwYsgAUkJigoiCIF5DMyoYggcUiXgNnBiGQKmAkARpcEQeriln4AAAAASUVORK5CYII=); - -moz-border-radius: 0 0 2px 2px; - -webkit-border-radius: 0 0 2px 2px; - border-radius: 0 0 2px 2px; +.openerp .oe_about .label { + background-color: #a24689; } .openerp .oe_about a { - color: #7c7bad; + color: #a24689; } -.openerp .oe_about a:hover { - text-decoration: underline; +.openerp .oe_about .user-details { + position: relative; + padding: 0; + margin-bottom: 275px; } -.openerp .oe_about a:focus { - outline: none; +.openerp .oe_about .user-details .user-image { + width: 100%; + text-align: center; } -.openerp .oe_about .oe_logo { - margin-left: -6px; +.openerp .oe_about .user-details .user-info-block { + width: 100%; + position: absolute; + top: 55px; + padding-top: 35px; } -.openerp .oe_about .oe_bottom { - text-shadow: 0 1px 1px #999999; - background-color: #8a0e0e; - background-image: -webkit-gradient(linear, left top, left bottom, from(#b41616), to(#600606)); - background-image: -webkit-linear-gradient(top, #b41616, #600606); - background-image: -moz-linear-gradient(top, #b41616, #600606); - background-image: -ms-linear-gradient(top, #b41616, #600606); - background-image: -o-linear-gradient(top, #b41616, #600606); - background-image: linear-gradient(to bottom, #b41616, #600606); - color: #eeeeee; - padding: 0 16px; - -moz-border-radius: 0 0 2px 2px; - -webkit-border-radius: 0 0 2px 2px; - border-radius: 0 0 2px 2px; +.openerp .oe_about .user-details .user-info-block .user-heading { + text-align: center; + margin: 10px 0 0; } -.openerp .oe_about .oe_bottom a { - color: #eeeeee; +.openerp .oe_about .user-details .user-info-block .navigation { + float: left; + width: auto; + padding: 0; + margin-left: 25%; + list-style: none; + border: 1px solid #a24689; +} +.openerp .oe_about .user-details .user-info-block .navigation li { + float: left; +} +.openerp .oe_about .user-details .user-info-block .navigation li a { + padding: 20px 30px; + float: left; +} +.openerp .oe_about .user-details .user-info-block .navigation li.active a { + background: #a24689; + color: white; +} +.openerp .oe_about .user-details .user-info-block .user-body { + text-align: center; +} +.openerp .oe_about .user-details .user-info-block .user-body .tab-content > div { + float: left; + width: 100%; +} +.openerp .oe_about a.oe_activate_debug_mode { + color: white !important; + font-size: 100%; +} +.openerp .oe_about #social i { + margin: 10px; +} +.openerp .oe_about #social i:hover { + -webkit-transform: scale(1.3); + -moz-transform: scale(1.3); + -ms-transform: scale(1.3); + -o-transform: scale(1.3); + transform: scale(1.3); +} +.openerp .oe_about #social .social-fb:hover { + color: #3b5998; +} +.openerp .oe_about #social .social-tw:hover { + color: #4099ff; +} +.openerp .oe_about #social .social-gp:hover { + color: #d34836; +} +.openerp .oe_about #social .social-lk:hover { + color: #007bb6; } .openerp a.oe_form_uri:hover { text-decoration: underline; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 2977c77ea9c..955039e0275 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -846,26 +846,64 @@ $sheet-padding: 16px margin-left: 20px // }}} // About openerp {{{ + $link-color-odoo: #a24689 .oe_about - background-color: white - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAKUlEQVQIHWO8e/fufwYsgAUkJigoiCIF5DMyoYggcUiXgNnBiGQKmAkARpcEQeriln4AAAAASUVORK5CYII=) - @include radius(0 0 2px 2px) + .label + background-color: $link-color-odoo a - color: $link-color - &:hover - text-decoration: underline - &:focus - outline: none - .oe_logo - margin-left: -6px - .oe_bottom - text-shadow: 0 1px 1px #999999 - @include vertical-gradient(#b41616, #600606) - color: #eee - padding: 0 16px - @include radius(0 0 2px 2px) - a - color: #eee + color: $link-color-odoo + + .user-details + position: relative + padding: 0 + margin-bottom: 275px + .user-image + width: 100% + text-align: center + .user-info-block + width: 100% + position: absolute + top: 55px + padding-top: 35px + .user-heading + text-align: center + margin: 10px 0 0 + .navigation + float: left + width: auto + padding: 0 + margin-left: 25% + list-style: none + border: 1px solid $link-color-odoo + li + float: left + a + padding: 20px 30px + float: left + &.active a + background: $link-color-odoo + color: #fff + .user-body + text-align: center + .tab-content > div + float: left + width: 100% + a.oe_activate_debug_mode + color: white !important + font-size: 100% + #social + i + margin: 10px + &:hover + @include transform(scale(1.3)) + .social-fb:hover + color: #3B5998 + .social-tw:hover + color: #4099FF + .social-gp:hover + color: #d34836 + .social-lk:hover + color: #007bb6 // }}} // ActionManager {{{ a.oe_form_uri:hover diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index d54e4fb964e..c5e0f743335 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -366,16 +366,79 @@
- Activate the developer mode - -

Version

+ Activate the developer mode -
-

Copyright © 2004-TODAY OpenERP SA. All Rights Reserved.
- Odoo is a trademark of the OpenERP SA Company.

-

Licenced under the terms of GNU Affero General Public License

-

For more information visit Odoo.com

-
+ + +
+
+
+
+ Odoo (Formerly OpenERP) +
+ +
+
+
From fc5c53ca47c6a5822978395e96f9e1978e7bc1b5 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 5 Sep 2014 15:59:07 +0200 Subject: [PATCH 03/14] [FIX] point_of_sale: field type on bank statement line no longer exists --- addons/point_of_sale/views/report_sessionsummary.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/point_of_sale/views/report_sessionsummary.xml b/addons/point_of_sale/views/report_sessionsummary.xml index 5f0f2617654..2f44afaa61b 100644 --- a/addons/point_of_sale/views/report_sessionsummary.xml +++ b/addons/point_of_sale/views/report_sessionsummary.xml @@ -97,7 +97,6 @@ Description Reference Partner - Type Account Amount @@ -108,7 +107,6 @@ - Date: Thu, 4 Sep 2014 16:31:30 +0200 Subject: [PATCH 04/14] [FIX] Restore /login redirection on SessionExpired The feature was broken due to an incompatibility when forward porting 624f256 and a78e27f --- addons/website/models/ir_http.py | 12 ++++++++---- openerp/addons/base/ir/ir_http.py | 18 ++++++------------ openerp/http.py | 6 ++++++ 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/addons/website/models/ir_http.py b/addons/website/models/ir_http.py index a145a30860e..9e30a07a64a 100644 --- a/addons/website/models/ir_http.py +++ b/addons/website/models/ir_http.py @@ -54,10 +54,14 @@ class ir_http(orm.AbstractModel): request.website_multilang = request.website_enabled and func and func.routing.get('multilang', True) if request.website_enabled: - if func: - self._authenticate(func.routing['auth']) - else: - self._auth_method_public() + try: + if func: + self._authenticate(func.routing['auth']) + else: + self._auth_method_public() + except Exception as e: + return self._handle_exception(e) + request.redirect = lambda url: werkzeug.utils.redirect(url_for(url)) request.website = request.registry['website'].get_current_website(request.cr, request.uid, context=request.context) if first_pass: diff --git a/openerp/addons/base/ir/ir_http.py b/openerp/addons/base/ir/ir_http.py index 21c8b7ef941..b3a2e785ca3 100644 --- a/openerp/addons/base/ir/ir_http.py +++ b/openerp/addons/base/ir/ir_http.py @@ -58,12 +58,6 @@ class ir_http(osv.AbstractModel): def _auth_method_user(self): request.uid = request.session.uid if not request.uid: - if not request.params.get('noredirect'): - query = werkzeug.url_encode({ - 'redirect': request.httprequest.url, - }) - response = werkzeug.utils.redirect('/web/login?%s' % query) - werkzeug.exceptions.abort(response) raise http.SessionExpiredException("Session expired") def _auth_method_none(self): @@ -97,7 +91,10 @@ class ir_http(osv.AbstractModel): def _handle_exception(self, exception): # If handle_exception returns something different than None, it will be used as a response - return request._handle_exception(exception) + try: + return request._handle_exception(exception) + except openerp.exceptions.AccessDenied: + return werkzeug.exceptions.Forbidden() def _dispatch(self): # locate the controller method @@ -110,11 +107,8 @@ class ir_http(osv.AbstractModel): # check authentication level try: auth_method = self._authenticate(func.routing["auth"]) - except Exception: - # force a Forbidden exception with the original traceback - return self._handle_exception( - convert_exception_to( - werkzeug.exceptions.Forbidden)) + except Exception as e: + return self._handle_exception(e) processing = self._postprocess_args(arguments, rule) if processing: diff --git a/openerp/http.py b/openerp/http.py index fe332c9ecb9..448a14e5958 100644 --- a/openerp/http.py +++ b/openerp/http.py @@ -542,6 +542,12 @@ class HttpRequest(WebRequest): be used as response.""" try: return super(HttpRequest, self)._handle_exception(exception) + except SessionExpiredException: + if not request.params.get('noredirect'): + query = werkzeug.urls.url_encode({ + 'redirect': request.httprequest.url, + }) + return werkzeug.utils.redirect('/web/login?%s' % query) except werkzeug.exceptions.HTTPException, e: return e From f3333f9c57cd14ee49917091028d3b9d39f0678c Mon Sep 17 00:00:00 2001 From: David Monjoie Date: Fri, 5 Sep 2014 17:09:12 +0200 Subject: [PATCH 05/14] [ADD] website_sale_digital --- addons/website_sale_digital/__init__.py | 1 + addons/website_sale_digital/__openerp__.py | 21 +++++ .../controllers/__init__.py | 1 + .../website_sale_digital/controllers/main.py | 94 +++++++++++++++++++ .../views/website_sale_digital.xml | 79 ++++++++++++++++ openerp/sql_db.py | 4 + 6 files changed, 200 insertions(+) create mode 100644 addons/website_sale_digital/__init__.py create mode 100644 addons/website_sale_digital/__openerp__.py create mode 100644 addons/website_sale_digital/controllers/__init__.py create mode 100644 addons/website_sale_digital/controllers/main.py create mode 100644 addons/website_sale_digital/views/website_sale_digital.xml diff --git a/addons/website_sale_digital/__init__.py b/addons/website_sale_digital/__init__.py new file mode 100644 index 00000000000..0d6ef6db7ce --- /dev/null +++ b/addons/website_sale_digital/__init__.py @@ -0,0 +1 @@ +import controllers # NOQA diff --git a/addons/website_sale_digital/__openerp__.py b/addons/website_sale_digital/__openerp__.py new file mode 100644 index 00000000000..72610a9db64 --- /dev/null +++ b/addons/website_sale_digital/__openerp__.py @@ -0,0 +1,21 @@ +{ + 'name': 'Website Sale Digital - Sell digital products', + 'version': '0.0.1', + 'description': """ +Sell data product through attachments +""", + 'author': 'OpenERP S.A.', + 'depends': [ + 'website_sale', + ], + 'website': 'http://apps.openerp.com', + 'active': False, + 'installable': True, + 'data': [ + 'views/website_sale_digital.xml', + ], + 'demo': [ + ], + 'qweb': [ + ], +} diff --git a/addons/website_sale_digital/controllers/__init__.py b/addons/website_sale_digital/controllers/__init__.py new file mode 100644 index 00000000000..8ee9bae18d9 --- /dev/null +++ b/addons/website_sale_digital/controllers/__init__.py @@ -0,0 +1 @@ +import main diff --git a/addons/website_sale_digital/controllers/main.py b/addons/website_sale_digital/controllers/main.py new file mode 100644 index 00000000000..c0344d8ed4a --- /dev/null +++ b/addons/website_sale_digital/controllers/main.py @@ -0,0 +1,94 @@ +# -*- coding: utf-8 -*- + +import base64 +from openerp import SUPERUSER_ID as SU +from openerp.addons.web import http +from openerp.addons.web.http import request +from openerp.addons.website_sale.controllers.main import website_sale +from itertools import groupby +from werkzeug.exceptions import NotFound + + +class website_sale_digital(website_sale): + + @http.route([ + '/shop/confirmation', + ], type='http', auth="public", website=True) + def display_attachments(self, **post): + r = super(website_sale_digital, self).payment_confirmation(**post) + return r + + @http.route([ + '/shop/attachment', + ], auth='public') + def download_attachment(self, attachment_id): + res = request.env(user=SU)['ir.attachment'].search_read([('id', '=', int(attachment_id))], ["name", "datas", "file_type"]) + if res: + res = res[0] + else: + raise NotFound() + data = base64.standard_b64decode(res["datas"]) + headers = [ + ('Content-Type', res['file_type']), + ('Content-Length', len(data)), + ('Content-Disposition', 'attachment; filename="' + res['name'] + '"') + ] + return request.make_response(data, headers) + + @http.route([ + '/website_sale_digital/downloads', + ], type='http', auth='public', website=True) + def get_downloads(self): + user = request.env['res.users'].browse(request.uid) + partner = user.partner_id + + # purchased_products = request.env['sale.order.line'].read_group( + # domain = ['&', ('order_id.partner_id', '=', partner.id), ('state', '=', 'confirmed')],#, ('product_id.data','=' true)]) + # fields = ['order_id', product_id'], + # groupby = 'product_id', + # #orderby = 'order_id', + # ) + + purchased_products = request.env['sale.order.line'].search_read( + domain = ['&', ('order_id.partner_id', '=', partner.id), ('state', '=', 'confirmed')],#, ('product_id.data','=' true)]) + fields = ['product_id'], + ) + + products_ids = [] + names = {} + attachments = {} + A = request.env['ir.attachment'] + P = request.env['product.product'] + for product in purchased_products: + # Ignore duplicate products + p_id = product['product_id'][0] + if p_id in products_ids: + continue + + # Search for product attachments + p_name = product['product_id'][1] + p_obj = P.browse(p_id) + template = p_obj.product_tmpl_id + att = A.search_read( + domain = ['|', '&', ('res_model', '=', 'product.product'), ('res_id', '=', p_id), '&', ('res_model', '=', 'product.template'), ('res_id', '=', template.id)], + fields = ['name'], + ) + + # Ignore products with no attachments + if not att: + continue + + # Store values for QWeb + products_ids.append(p_id) + attributes = p_obj.attribute_value_ids + if attributes: + names[p_id] = template.name + ' (' + ', '.join([a.name for a in attributes]) + ')' + else: + names[p_id] = template.name + attachments[p_id] = att + + return request.website.render('website_sale_digital.downloads', { + 'products': products_ids, + 'names': names, + 'attachments': attachments + }) \ No newline at end of file diff --git a/addons/website_sale_digital/views/website_sale_digital.xml b/addons/website_sale_digital/views/website_sale_digital.xml new file mode 100644 index 00000000000..c88521c409e --- /dev/null +++ b/addons/website_sale_digital/views/website_sale_digital.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/openerp/sql_db.py b/openerp/sql_db.py index 739c32a4f12..7cf48568dec 100644 --- a/openerp/sql_db.py +++ b/openerp/sql_db.py @@ -233,6 +233,10 @@ class Cursor(object): params = params or None res = self._obj.execute(query, params) except psycopg2.ProgrammingError, pe: + print self + print self._obj + print query + print params if self._default_log_exceptions if log_exceptions is None else log_exceptions: _logger.error("Programming error: %s, in query %s", pe, query) raise From 6e5b09acfa0e63a1b5b455840461648e36120174 Mon Sep 17 00:00:00 2001 From: David Monjoie Date: Fri, 5 Sep 2014 17:12:49 +0200 Subject: [PATCH 06/14] [FIX] removed bad comments from previous commit --- openerp/sql_db.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/openerp/sql_db.py b/openerp/sql_db.py index 7cf48568dec..739c32a4f12 100644 --- a/openerp/sql_db.py +++ b/openerp/sql_db.py @@ -233,10 +233,6 @@ class Cursor(object): params = params or None res = self._obj.execute(query, params) except psycopg2.ProgrammingError, pe: - print self - print self._obj - print query - print params if self._default_log_exceptions if log_exceptions is None else log_exceptions: _logger.error("Programming error: %s, in query %s", pe, query) raise From 31b58d553cf82b2a6b0d38c3688790f423fae13e Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 5 Sep 2014 17:22:56 +0200 Subject: [PATCH 07/14] [REVERT] 2 previous commits (f3333f9 and 6e5b09a) --- addons/website_sale_digital/__init__.py | 1 - addons/website_sale_digital/__openerp__.py | 21 ----- .../controllers/__init__.py | 1 - .../website_sale_digital/controllers/main.py | 94 ------------------- .../views/website_sale_digital.xml | 79 ---------------- 5 files changed, 196 deletions(-) delete mode 100644 addons/website_sale_digital/__init__.py delete mode 100644 addons/website_sale_digital/__openerp__.py delete mode 100644 addons/website_sale_digital/controllers/__init__.py delete mode 100644 addons/website_sale_digital/controllers/main.py delete mode 100644 addons/website_sale_digital/views/website_sale_digital.xml diff --git a/addons/website_sale_digital/__init__.py b/addons/website_sale_digital/__init__.py deleted file mode 100644 index 0d6ef6db7ce..00000000000 --- a/addons/website_sale_digital/__init__.py +++ /dev/null @@ -1 +0,0 @@ -import controllers # NOQA diff --git a/addons/website_sale_digital/__openerp__.py b/addons/website_sale_digital/__openerp__.py deleted file mode 100644 index 72610a9db64..00000000000 --- a/addons/website_sale_digital/__openerp__.py +++ /dev/null @@ -1,21 +0,0 @@ -{ - 'name': 'Website Sale Digital - Sell digital products', - 'version': '0.0.1', - 'description': """ -Sell data product through attachments -""", - 'author': 'OpenERP S.A.', - 'depends': [ - 'website_sale', - ], - 'website': 'http://apps.openerp.com', - 'active': False, - 'installable': True, - 'data': [ - 'views/website_sale_digital.xml', - ], - 'demo': [ - ], - 'qweb': [ - ], -} diff --git a/addons/website_sale_digital/controllers/__init__.py b/addons/website_sale_digital/controllers/__init__.py deleted file mode 100644 index 8ee9bae18d9..00000000000 --- a/addons/website_sale_digital/controllers/__init__.py +++ /dev/null @@ -1 +0,0 @@ -import main diff --git a/addons/website_sale_digital/controllers/main.py b/addons/website_sale_digital/controllers/main.py deleted file mode 100644 index c0344d8ed4a..00000000000 --- a/addons/website_sale_digital/controllers/main.py +++ /dev/null @@ -1,94 +0,0 @@ -# -*- coding: utf-8 -*- - -import base64 -from openerp import SUPERUSER_ID as SU -from openerp.addons.web import http -from openerp.addons.web.http import request -from openerp.addons.website_sale.controllers.main import website_sale -from itertools import groupby -from werkzeug.exceptions import NotFound - - -class website_sale_digital(website_sale): - - @http.route([ - '/shop/confirmation', - ], type='http', auth="public", website=True) - def display_attachments(self, **post): - r = super(website_sale_digital, self).payment_confirmation(**post) - return r - - @http.route([ - '/shop/attachment', - ], auth='public') - def download_attachment(self, attachment_id): - res = request.env(user=SU)['ir.attachment'].search_read([('id', '=', int(attachment_id))], ["name", "datas", "file_type"]) - if res: - res = res[0] - else: - raise NotFound() - data = base64.standard_b64decode(res["datas"]) - headers = [ - ('Content-Type', res['file_type']), - ('Content-Length', len(data)), - ('Content-Disposition', 'attachment; filename="' + res['name'] + '"') - ] - return request.make_response(data, headers) - - @http.route([ - '/website_sale_digital/downloads', - ], type='http', auth='public', website=True) - def get_downloads(self): - user = request.env['res.users'].browse(request.uid) - partner = user.partner_id - - # purchased_products = request.env['sale.order.line'].read_group( - # domain = ['&', ('order_id.partner_id', '=', partner.id), ('state', '=', 'confirmed')],#, ('product_id.data','=' true)]) - # fields = ['order_id', product_id'], - # groupby = 'product_id', - # #orderby = 'order_id', - # ) - - purchased_products = request.env['sale.order.line'].search_read( - domain = ['&', ('order_id.partner_id', '=', partner.id), ('state', '=', 'confirmed')],#, ('product_id.data','=' true)]) - fields = ['product_id'], - ) - - products_ids = [] - names = {} - attachments = {} - A = request.env['ir.attachment'] - P = request.env['product.product'] - for product in purchased_products: - # Ignore duplicate products - p_id = product['product_id'][0] - if p_id in products_ids: - continue - - # Search for product attachments - p_name = product['product_id'][1] - p_obj = P.browse(p_id) - template = p_obj.product_tmpl_id - att = A.search_read( - domain = ['|', '&', ('res_model', '=', 'product.product'), ('res_id', '=', p_id), '&', ('res_model', '=', 'product.template'), ('res_id', '=', template.id)], - fields = ['name'], - ) - - # Ignore products with no attachments - if not att: - continue - - # Store values for QWeb - products_ids.append(p_id) - attributes = p_obj.attribute_value_ids - if attributes: - names[p_id] = template.name + ' (' + ', '.join([a.name for a in attributes]) + ')' - else: - names[p_id] = template.name - attachments[p_id] = att - - return request.website.render('website_sale_digital.downloads', { - 'products': products_ids, - 'names': names, - 'attachments': attachments - }) \ No newline at end of file diff --git a/addons/website_sale_digital/views/website_sale_digital.xml b/addons/website_sale_digital/views/website_sale_digital.xml deleted file mode 100644 index c88521c409e..00000000000 --- a/addons/website_sale_digital/views/website_sale_digital.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file From 7558e2e786f34e38dbf324ba24644e6ef0e5bc52 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 8 Sep 2014 11:14:44 +0200 Subject: [PATCH 08/14] [IMP] distribute branding on @groups instead of disabling edition Avoids 2 rendering passes, and allows editing e.g. events detail page, which couldn't be done (due to groups=public in a mail component) fixes #1994 --- addons/report/models/report.py | 1 - addons/website/views/website_templates.xml | 1 - openerp/addons/base/ir/ir_qweb.py | 8 +------- openerp/addons/base/ir/ir_ui_view.py | 2 +- openerp/http.py | 19 +++---------------- 5 files changed, 5 insertions(+), 26 deletions(-) diff --git a/addons/report/models/report.py b/addons/report/models/report.py index fbb8044f129..38492e09f0c 100644 --- a/addons/report/models/report.py +++ b/addons/report/models/report.py @@ -125,7 +125,6 @@ class Report(osv.Model): user=user, res_company=user.company_id, website=website, - editable_no_editor=_("The preferred way to edit a report is to use the HTML Editor"), ) return view_obj.render(cr, uid, template, values, context=context) diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml index f7915b98874..b8b9234a60b 100644 --- a/addons/website/views/website_templates.xml +++ b/addons/website/views/website_templates.xml @@ -59,7 +59,6 @@ Date: Fri, 5 Sep 2014 13:59:48 +0200 Subject: [PATCH 09/14] [FIX] stock_account: Preserve action_done return value stock_account module override the action_done method of stock.move but does not return the same value This causes problems when calling this function from xmlrpc because the resulting value is now None and that is not allowed to be marshaled by default. --- addons/stock_account/stock_account.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/stock_account/stock_account.py b/addons/stock_account/stock_account.py index 545bdc05fec..6edc241aed4 100644 --- a/addons/stock_account/stock_account.py +++ b/addons/stock_account/stock_account.py @@ -256,8 +256,9 @@ class stock_move(osv.osv): def action_done(self, cr, uid, ids, context=None): self.product_price_update_before_done(cr, uid, ids, context=context) - super(stock_move, self).action_done(cr, uid, ids, context=context) + res = super(stock_move, self).action_done(cr, uid, ids, context=context) self.product_price_update_after_done(cr, uid, ids, context=context) + return res def _store_average_cost_price(self, cr, uid, move, context=None): ''' move is a browe record ''' From 74aa7406bf1cd1794f9832ed36141482f7ff9353 Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Mon, 8 Sep 2014 14:00:42 +0200 Subject: [PATCH 10/14] [FIX] web: webclient_bootstrap: render the menus when the user is really a user The webclient rendering is done in two parts: the server renders the boilerplates including the menus, and then the javascript launch the webclient using the server-side boilerplates. In some case, we want to render the boilerplates but not the menus (auth_calendar). Added groups around the t-call to the menu in the web template. Fixes issue #2044. --- addons/web/views/webclient_templates.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/views/webclient_templates.xml b/addons/web/views/webclient_templates.xml index bdb1ed5c162..98e506863c1 100644 --- a/addons/web/views/webclient_templates.xml +++ b/addons/web/views/webclient_templates.xml @@ -214,7 +214,7 @@
-