From a747309ba8443e8c3aaab99bee5c568690f5c5cf Mon Sep 17 00:00:00 2001 From: Kersten Jeremy Date: Mon, 24 Mar 2014 14:44:46 +0100 Subject: [PATCH 1/5] [FIX] Add related field in sponsor model to allow public user to get logo from res partner without give all the rights. bzr revid: jke@openerp.com-20140324134446-vy2vxycwltb8oclf --- addons/website_event_track/models/event.py | 1 + addons/website_event_track/views/website_event.xml | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/website_event_track/models/event.py b/addons/website_event_track/models/event.py index cfba63cfc6b..312fb67c087 100644 --- a/addons/website_event_track/models/event.py +++ b/addons/website_event_track/models/event.py @@ -171,6 +171,7 @@ class event_sponsors(osv.osv): 'partner_id': fields.many2one('res.partner', 'Sponsor/Customer', required=True), 'url': fields.text('Sponsor Website'), 'sequence': fields.related('sponsor_type_id', 'sequence', string='Sequence', store=True), + 'image_medium': fields.related('partner_id', 'image_medium', string='Logo') } def has_access_to_partner(self, cr, uid, ids, context=None): diff --git a/addons/website_event_track/views/website_event.xml b/addons/website_event_track/views/website_event.xml index 65aa7610ec3..8f48110e416 100644 --- a/addons/website_event_track/views/website_event.xml +++ b/addons/website_event_track/views/website_event.xml @@ -15,10 +15,10 @@

Our Sponsors

-
+
-
@@ -27,7 +27,7 @@ -
From 6cf9867f15bde5edb8295c51fca4ec616109bf99 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 24 Mar 2014 15:35:58 +0100 Subject: [PATCH 2/5] [REF] *: share field is now a computed field, if the user is in the employee group or not bzr revid: dle@openerp.com-20140324143558-jqdm33c0i7wna3va --- addons/portal/portal.py | 7 ------- addons/portal/portal_data.xml | 3 --- addons/portal/portal_demo.xml | 1 - addons/portal/wizard/portal_wizard.py | 1 - addons/share/res_users.py | 20 ++++++++++++++++++-- addons/share/share_data.xml | 1 - addons/share/wizard/share_wizard.py | 2 -- 7 files changed, 18 insertions(+), 17 deletions(-) diff --git a/addons/portal/portal.py b/addons/portal/portal.py index bbab8b16cd3..d94e541eb03 100644 --- a/addons/portal/portal.py +++ b/addons/portal/portal.py @@ -30,10 +30,3 @@ class portal(osv.osv): _columns = { 'is_portal': fields.boolean('Portal', help="If checked, this group is usable as a portal."), } - -class res_users(osv.Model): - _inherit = 'res.users' - def _signup_create_user(self, cr, uid, values, context=None): - values['share'] = True - return super(res_users, self)._signup_create_user(cr, uid, values, context=context) - diff --git a/addons/portal/portal_data.xml b/addons/portal/portal_data.xml index 35dee070c71..273d1a8c463 100644 --- a/addons/portal/portal_data.xml +++ b/addons/portal/portal_data.xml @@ -6,9 +6,6 @@ - - - diff --git a/addons/portal/portal_demo.xml b/addons/portal/portal_demo.xml index 3abc9c8cef5..f6e46708bbc 100644 --- a/addons/portal/portal_demo.xml +++ b/addons/portal/portal_demo.xml @@ -22,7 +22,6 @@ Mr Demo Portal - diff --git a/addons/portal/wizard/portal_wizard.py b/addons/portal/wizard/portal_wizard.py index 3973bf6b131..3422a41baff 100644 --- a/addons/portal/wizard/portal_wizard.py +++ b/addons/portal/wizard/portal_wizard.py @@ -209,7 +209,6 @@ class wizard_user(osv.osv_memory): 'login': extract_email(wizard_user.email), 'partner_id': wizard_user.partner_id.id, 'groups_id': [(6, 0, [])], - 'share': True, } user_id = res_users.create(cr, uid, values, context=create_context) return res_users.browse(cr, uid, user_id, context) diff --git a/addons/share/res_users.py b/addons/share/res_users.py index 30200133f8e..702522478dd 100644 --- a/addons/share/res_users.py +++ b/addons/share/res_users.py @@ -38,9 +38,25 @@ class res_groups(osv.osv): class res_users(osv.osv): _name = 'res.users' _inherit = 'res.users' + + def _is_share(self, cr, uid, ids, name, args, context=None): + res = {} + for user in self.browse(cr, uid, ids, context=context): + res[user.id] = not self.has_group(cr, user.id, 'base.group_user') + return res + + def _get_users_from_group(self, cr, uid, ids, context=None): + result = set() + for group in self.pool['res.groups'].browse(cr, uid, ids, context=context): + result.update(user.id for user in group.users) + return list(result) + _columns = { - 'share': fields.boolean('Share User', readonly=True, - help="External user with limited access, created only for the purpose of sharing data.") + 'share': fields.function(_is_share, string='Share User', type='boolean', + store={ + 'res.users': (lambda self, cr, uid, ids, c={}: ids, None, 50), + 'res.groups': (_get_users_from_group, None, 50), + }, help="External user with limited access, created only for the purpose of sharing data."), } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/share/share_data.xml b/addons/share/share_data.xml index aba154a6403..c64a9099721 100644 --- a/addons/share/share_data.xml +++ b/addons/share/share_data.xml @@ -3,7 +3,6 @@ - diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py index 10937015dd6..551b08d02cf 100644 --- a/addons/share/wizard/share_wizard.py +++ b/addons/share/wizard/share_wizard.py @@ -258,7 +258,6 @@ class share_wizard(osv.TransientModel): 'name': new_user, 'email': new_user, 'groups_id': [(6,0,[group_id])], - 'share': True, 'company_id': current_user.company_id.id, 'company_ids': [(6, 0, [current_user.company_id.id])], }, context) @@ -276,7 +275,6 @@ class share_wizard(osv.TransientModel): 'password': new_pass, 'name': new_login, 'groups_id': [(6,0,[group_id])], - 'share': True, 'company_id': current_user.company_id.id, 'company_ids': [(6, 0, [current_user.company_id.id])], }, context) From e5f645df4d2f76f0c8cb7e3809be784d35bdc317 Mon Sep 17 00:00:00 2001 From: "chm@openerp.com" <> Date: Mon, 24 Mar 2014 15:54:16 +0100 Subject: [PATCH 3/5] [FIX] website: snippet editor: forward port of branch saas-3 bzr revid: chm@openerp.com-20140324145416-qn2fvylylxtgu39a --- addons/website/static/src/js/website.snippets.editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index 8336dc408b7..52deeabf5e6 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -957,6 +957,7 @@ start : function () { var self = this; this._super(); + this.$target.carousel({interval: false}); this.id = this.$target.attr("id"); this.$inner = this.$target.find('.carousel-inner'); this.$indicators = this.$target.find('.carousel-indicators'); @@ -1376,7 +1377,6 @@ this.grid.size = 8; return this.grid; }, - this.$target.carousel({interval: false}); }); website.snippet.options.parallax = website.snippet.Option.extend({ From a8e1aba23bc3228ef99fcb986992de75b5c29b74 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 24 Mar 2014 17:12:57 +0100 Subject: [PATCH 4/5] [FIX] http: when generating static routes, only wrap dispatcher only if there is any new static directory found bzr revid: chs@openerp.com-20140324161257-fi1cpgyd97825b14 --- openerp/http.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/openerp/http.py b/openerp/http.py index 8c73b33c8a0..7e182385f5c 100644 --- a/openerp/http.py +++ b/openerp/http.py @@ -1089,17 +1089,14 @@ class Root(object): """ Handle a WSGI request """ if not self._loaded: - self.load_addons() self._loaded = True + self.load_addons() return self.dispatch(environ, start_response) def load_addons(self): """ Load all addons from addons patch containg static files and controllers and configure them. """ # TODO should we move this to ir.http so that only configured modules are served ? - _logger.info("HTTP Configuring static files") - - self.__dict__.pop('dispatch', None) statics = {} for addons_path in openerp.modules.module.ad_paths: @@ -1113,12 +1110,16 @@ class Root(object): _logger.debug("Loading %s", module) if 'openerp.addons' in sys.modules: m = __import__('openerp.addons.' + module) + else: + m = None addons_module[module] = m addons_manifest[module] = manifest statics['/%s/static' % module] = path_static - app = werkzeug.wsgi.SharedDataMiddleware(self.dispatch, statics) - self.dispatch = DisableCacheMiddleware(app) + if statics: + _logger.info("HTTP Configuring static files") + app = werkzeug.wsgi.SharedDataMiddleware(self.dispatch, statics) + self.dispatch = DisableCacheMiddleware(app) def setup_session(self, httprequest): # recover or create session From a9001aedb170bb81df82b7f86ad9edc34efea169 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 24 Mar 2014 17:25:24 +0100 Subject: [PATCH 5/5] [FIX] website_blog: typo, platform instead of plateform bzr revid: dle@openerp.com-20140324162524-ew3c3eauj3kcnefi --- addons/website_blog/static/description/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website_blog/static/description/index.html b/addons/website_blog/static/description/index.html index 3f44eea9b4d..1f198c11678 100644 --- a/addons/website_blog/static/description/index.html +++ b/addons/website_blog/static/description/index.html @@ -1,7 +1,7 @@
-

Awesome Open Source Blogging Plateform

+

Awesome Open Source Blogging Platform

Write, Design, Promote, Engage

@@ -15,7 +15,7 @@

Express yourself with the OpenERP enterprise grade blogging - plateform. Write beautiful blog posts, engage with visitors, + platform. Write beautiful blog posts, engage with visitors, translate content and moderate social streams.

Get your blog posts efficiently referenced in Google and