Merge pull request #210 from odoo-dev/saas-4-fix-partner-grade-access-fme
authorFabien Meghazi <agr@amigrave.com>
Mon, 26 May 2014 14:12:15 +0000 (16:12 +0200)
committerFabien Meghazi <agr@amigrave.com>
Mon, 26 May 2014 14:12:15 +0000 (16:12 +0200)
[FIX] access rights for public user on res.partner.grade

addons/report/views/layouts.xml
addons/website/static/src/js/website.seo.js
addons/website/views/website_templates.xml
addons/website_forum/controllers/main.py

index 76f2e3d..92887cf 100644 (file)
@@ -9,7 +9,8 @@
           t-att-data-main-object="repr(main_object) if editable else None"
           t-att-data-report-margin-top="data_report_margin_top if data_report_margin_top else None"
           t-att-data-report-header-spacing="data_report_header_spacing if data_report_header_spacing else None"
-          t-att-data-report-dpi="data_report_dpi if data_report_dpi else None">
+          t-att-data-report-dpi="data_report_dpi if data_report_dpi else None"
+          t-att-data-oe-company-name="res_company.name">
         <head>
             <meta name="viewport" content="width=device-width, initial-scale=1"/>
 
@@ -19,7 +20,6 @@
             <t t-if="not title and main_object and 'name' in main_object">
                 <t t-set="additional_title" t-value="main_object.name"/>
             </t>
-            <meta name="openerp.company" t-att-value="res_company.name"/>
             <meta name="description" t-att-value="main_object and 'website_meta_description' in main_object
                 and main_object.website_meta_description or website_meta_description"/>
             <meta name="keywords" t-att-value="main_object and 'website_meta_keywords' in main_object
index 8588b7a..1c4bad9 100644 (file)
         },
         description: function () {
             var $description = $('meta[name=description]');
-            return ($description.length > 0) && ($description.attr('value') && $description.attr('value').trim());
+            return ($description.length > 0) && ($description.attr('content') && $description.attr('content').trim());
         },
         changeDescription: function (description) {
             // TODO create tag if missing
-            $('meta[name=description]').attr('value', description);
+            $('meta[name=description]').attr('content', description);
             this.trigger('description-changed', description);
         },
         keywords: function () {
             var $keywords = $('meta[name=keywords]');
-            var parsed = ($keywords.length > 0) && $keywords.attr('value') && $keywords.attr('value').split(",");
+            var parsed = ($keywords.length > 0) && $keywords.attr('content') && $keywords.attr('content').split(",");
             return (parsed && parsed[0]) ? parsed: [];
         },
         changeKeywords: function (keywords) {
             // TODO create tag if missing
-            $('meta[name=keywords]').attr('value', keywords.join(","));
+            $('meta[name=keywords]').attr('content', keywords.join(","));
             this.trigger('keywords-changed', keywords);
         },
         headers: function (tag) {
             });
         },
         company: function () {
-            return $('meta[name="openerp.company"]').attr('value');
+            return $('html').attr('data-oe-company-name');
         },
         bodyText: function () {
             return $('body').children().not('.js_seo_configuration').text();
index c322528..f26d9ba 100644 (file)
           t-att-data-editable="'1' if editable else None"
           t-att-data-translatable="'1' if translatable else None"
           t-att-data-view-xmlid="xmlid if editable else None"
-          t-att-data-main-object="repr(main_object) if editable else None">
+          t-att-data-main-object="repr(main_object) if editable else None"
+          t-att-data-oe-company-name="res_company.name">
         <head>
+            <meta charset="utf-8" />
             <script type="text/javascript" src="/web/static/src/js/watch.js"></script>
             <t t-if="main_object and 'website_meta_title' in main_object">
                 <t t-set="title" t-value="main_object.website_meta_title"/>
                 <t t-set="title"><t t-raw="res_company.name"/><t t-if="additional_title"> - <t t-raw="additional_title"/></t></t>
             </t>
             <meta name="viewport" content="initial-scale=1"/>
-            <meta name="openerp.company" t-att-value="res_company.name"/>
-            <meta name="description" t-att-value="main_object and 'website_meta_description' in main_object
+            <meta name="description" t-att-content="main_object and 'website_meta_description' in main_object
                 and main_object.website_meta_description or website_meta_description"/>
-            <meta name="keywords" t-att-value="main_object and 'website_meta_keywords' in main_object
+            <meta name="keywords" t-att-content="main_object and 'website_meta_keywords' in main_object
                 and main_object.website_meta_keywords or website_meta_keywords"/>
             <title><t t-esc="title"/></title>
 
                 // Bootstrap and jQuery UI conflicts
                 $.fn.bstooltip = $.fn.tooltip;
                 $.fn.bsbutton = $.fn.button;
-                
             </script>
 
             <script type="text/javascript" src="/web/static/lib/qweb/qweb2.js"></script>
             <script type="text/javascript" src="/web/static/src/js/openerpframework.js"></script>
 
             <script type="text/javascript" src="/website/static/src/js/website.js"></script>
-            
+
             <script t-if="not translatable" type="text/javascript" src="/website/static/src/js/website.snippets.animation.js"></script>
             <script type="text/javascript" src="/web/static/lib/bootstrap/js/bootstrap.js"></script>
 
                 <footer>
                     <div class="container hidden-print" id="footer_container">
                         <div class="row">
-                            <div class="col-md-3" name="product">
+                            <div class="col-md-3">
                                 <h4>Our products &amp; Services</h4>
                                 <ul class="list-unstyled" name="products">
                                     <li><a href="/">Home</a></li>
                                 </ul>
                             </div>
                             <div class="col-md-3" name="info">
-                                <h4 name="info_title">Connect with us</h4>
+                                <h4>Connect with us</h4>
                                 <ul class="list-unstyled">
                                     <li><a href="/page/website.contactus">Contact us</a></li>
                                 </ul>
                                     <a t-att-href="website.social_github" t-if="website.social_github"><i class="fa fa-github"/></a>
                                 </h2>
                             </div>
-                            <div class="col-md-5 col-lg-offset-1" name="about_us">
+                            <div class="col-md-5 col-lg-offset-1">
                                 <div>
                                     <h4>
                                         <span t-field="res_company.name">Your Company</span>
index b94e818..b838795 100644 (file)
@@ -329,13 +329,12 @@ class WebsiteForum(http.Controller):
         cr, uid, context = request.cr, request.uid, request.context
         if kwargs.get('comment') and post.forum_id.id == forum.id:
             # TDE FIXME: check that post_id is the question or one of its answers
-            if request.registry['res.users'].has_group(cr, uid, 'website_mail.group_comment'):
-                request.registry['forum.post'].message_post(
-                    cr, uid, post.id,
-                    body=kwargs.get('comment'),
-                    type='comment',
-                    subtype='mt_comment',
-                    context=dict(context, mail_create_nosubcribe=True))
+            request.registry['forum.post'].message_post(
+                cr, uid, post.id,
+                body=kwargs.get('comment'),
+                type='comment',
+                subtype='mt_comment',
+                context=dict(context, mail_create_nosubcribe=True))
         return werkzeug.utils.redirect("/forum/%s/question/%s" % (slug(forum), slug(question)))
 
     @http.route('/forum/<model("forum.forum"):forum>/post/<model("forum.post"):post>/toggle_correct', type='json', auth="public", website=True)