diff options
| author | Thibault Delavallée <tde@openerp.com> | 2014-01-14 18:17:38 +0100 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2014-01-14 18:17:38 +0100 |
| commit | 5be1dfda6efab3be1abe040be6a73e8a9c55d7a6 (patch) | |
| tree | d8f0579b94f6315a0a7d71da8311b96559cad8e4 | |
| parent | 0aa495f5cbff9c77757c9f870b36c8888b5edd19 (diff) | |
| parent | 45feba1f864565f01919f37c9411ac71b7c178ae (diff) | |
[MERGE] Sync with website-al
bzr revid: tde@openerp.com-20140114171738-zz4apq7nk5dcov0i
| -rw-r--r-- | addons/product/product_view.xml | 8 | ||||
| -rw-r--r-- | addons/website/static/src/css/editor.css | 15 | ||||
| -rw-r--r-- | addons/website/static/src/css/editor.sass | 9 | ||||
| -rw-r--r-- | addons/website/static/src/css/website.css | 19 | ||||
| -rw-r--r-- | addons/website/static/src/css/website.sass | 11 | ||||
| -rw-r--r-- | addons/website/static/src/img/under_construction.png | bin | 0 -> 6574 bytes | |||
| -rw-r--r-- | addons/website_blog/controllers/main.py | 24 | ||||
| -rw-r--r-- | addons/website_blog/views/website_blog_templates.xml | 6 | ||||
| -rw-r--r-- | addons/website_mail/static/src/css/website_mail.css | 4 | ||||
| -rw-r--r-- | addons/website_sale/controllers/main.py | 16 | ||||
| -rw-r--r-- | addons/website_sale/data/website_sale_demo.xml | 1 | ||||
| -rw-r--r-- | addons/website_sale/views/website_sale.xml | 3 | ||||
| -rw-r--r-- | addons/website_sale_delivery/controllers/main.py | 5 |
13 files changed, 88 insertions, 33 deletions
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 1a75a6e023b..1ea85cc96d4 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -400,7 +400,7 @@ <field name="name">product.public.category.form</field> <field name="model">product.public.category</field> <field name="arch" type="xml"> - <form string="Product Categories" version="7.0"> + <form string="Pos/Public Categories" version="7.0"> <sheet> <field name="image_medium" widget='image' class="oe_avatar oe_right"/> <div class="oe_left"> @@ -426,7 +426,7 @@ </field> </record> <record id="product_public_category_action" model="ir.actions.act_window"> - <field name="name">Public Categories</field> + <field name="name">Pos/Public Product Categories</field> <field name="type">ir.actions.act_window</field> <field name="res_model">product.public.category</field> <field name="view_type">form</field> @@ -445,7 +445,7 @@ </p> </field> </record> - <menuitem action="product_public_category_action" id="menu_product_public_category" parent="base.menu_product" sequence="10" /> + <menuitem action="product_public_category_action" id="menu_product_public_category" parent="prod_config_main" sequence="10" /> <!-- END --> <!-- Unit of Measure --> @@ -802,7 +802,7 @@ <field name="mes_type"/> </group> - <group colspan="4" string="Product Variants"> + <group colspan="4" string="Product Variants" groups="product.group_product_variant"> <field colspan="4" name="product_variant_ids" nolabel="1"> <tree string="Product Variants" editable="bottom"> <field name="active"/> diff --git a/addons/website/static/src/css/editor.css b/addons/website/static/src/css/editor.css index 79fcdb68ce0..d786830c8f5 100644 --- a/addons/website/static/src/css/editor.css +++ b/addons/website/static/src/css/editor.css @@ -81,6 +81,10 @@ outline: none !important; } +.css_editable_display { + display: block !important; +} + .css_non_editable_mode_hidden { display: none; } @@ -103,6 +107,14 @@ top: 2px; } +.oe_structure.oe_empty:empty, [data-oe-type=html]:empty, .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child { + background-image: url("/website/static/src/img/edit_here.png") !important; +} + +.oe_structure.oe_empty:empty:before, [data-oe-type=html]:empty:before, .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child:before, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child:before { + content: "Press The Top-Left Edit Button" !important; +} + /* ---- EDITOR BAR ---- {{{ */ table.editorbar-panel { cursor: pointer; @@ -433,8 +445,9 @@ ul.oe_menu_editor .disclose { /* ---- SNIPPET MANIPULATOR ---- {{{ */ .resize_editor_busy { - background-color: rgba(0,0,0,0.1); + background-color: rgba(0, 0, 0, 0.3); } + .oe_overlay { display: none; position: absolute; diff --git a/addons/website/static/src/css/editor.sass b/addons/website/static/src/css/editor.sass index 78af810448f..66665252379 100644 --- a/addons/website/static/src/css/editor.sass +++ b/addons/website/static/src/css/editor.sass @@ -67,6 +67,9 @@ .oe_editable:focus outline: none !important +.css_editable_display + display: block !important + .css_non_editable_mode_hidden display: none @@ -85,6 +88,12 @@ position: relative !important top: +2px +.oe_structure.oe_empty:empty, [data-oe-type=html]:empty, .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child + background-image: url('/website/static/src/img/edit_here.png') !important + +.oe_structure.oe_empty:empty:before, [data-oe-type=html]:empty:before, .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child:before, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child:before + content: 'Press The Top-Left Edit Button' !important + // }}} /* ---- EDITOR BAR ---- {{{ */ diff --git a/addons/website/static/src/css/website.css b/addons/website/static/src/css/website.css index ca59f4c5697..a047753ebfc 100644 --- a/addons/website/static/src/css/website.css +++ b/addons/website/static/src/css/website.css @@ -1,3 +1,4 @@ +@charset "utf-8"; /* THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY * * css for editor buttons, openerp widget included in the website and other @@ -233,7 +234,7 @@ footer { } .oe_structure.oe_empty:empty, [data-oe-type=html]:empty, .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child { - background-image: url("/website/static/src/img/edit_here.png"); + background-image: url("/website/static/src/img/under_construction.png"); background-repeat: no-repeat; background-position: center; height: 220px !important; @@ -244,7 +245,7 @@ footer { } .oe_structure.oe_empty:empty:before, [data-oe-type=html]:empty:before, .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child:before, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child:before { - content: "Press The Top-Left Edit Button"; + content: "This page is under construction"; text-align: center; display: block; padding-top: 160px; @@ -257,6 +258,10 @@ footer { content: "Drag Building Blocks Here"; } +.css_editable_display { + display: none; +} + /* ---- HACK FOR COVERING UP CK EDITOR BOGUS P INSERTION --- */ .navbar .nav > li > p { margin-bottom: 0px; @@ -334,10 +339,15 @@ ul.nav-stacked > li > a { } /* ---- SNIPPETS --- */ -[data-snippet-id],.colmd,.hr,.blockquote { - overflow: hidden; +[data-snippet-id], .colmd, .hr, .blockquote { + overflow: hidden; } +@media (max-width: 400px) { + [data-snippet-id] { + height: auto !important; + } +} .carousel-inner { height: 100%; } @@ -345,6 +355,7 @@ ul.nav-stacked > li > a { height: 100%; background-size: 100%; } + .carousel .carousel-caption { left: auto; right: auto; diff --git a/addons/website/static/src/css/website.sass b/addons/website/static/src/css/website.sass index ab13d795465..c509bebce55 100644 --- a/addons/website/static/src/css/website.sass +++ b/addons/website/static/src/css/website.sass @@ -154,7 +154,7 @@ footer background-image: url('/website/static/src/img/drag_here.png') .oe_structure.oe_empty:empty, [data-oe-type=html]:empty, .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child - background-image: url('/website/static/src/img/edit_here.png') + background-image: url('/website/static/src/img/under_construction.png') background-repeat: no-repeat background-position: center height: 220px !important @@ -163,7 +163,7 @@ footer position: static .oe_structure.oe_empty:empty:before, [data-oe-type=html]:empty:before, .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child:before, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child:before - content: 'Press The Top-Left Edit Button' + content: 'This page is under construction' text-align: center display: block padding-top: 160px @@ -174,6 +174,9 @@ footer .oe_structure.oe_editable.oe_empty:empty:before, .oe_editable[data-oe-type=html]:empty:before, .oe_structure.oe_editable.oe_empty > .oe_drop_zone.oe_insert:only-child:before, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child:before content: 'Drag Building Blocks Here' +.css_editable_display + display: none + /* ---- HACK FOR COVERING UP CK EDITOR BOGUS P INSERTION --- */ .navbar .nav > li > p @@ -245,6 +248,10 @@ ul.nav-stacked > li > a [data-snippet-id],.colmd,.hr,.blockquote overflow: hidden +@media (max-width: 400px) + [data-snippet-id] + height: auto !important + .carousel-inner height: 100% .item diff --git a/addons/website/static/src/img/under_construction.png b/addons/website/static/src/img/under_construction.png Binary files differnew file mode 100644 index 00000000000..2d5ee85de9b --- /dev/null +++ b/addons/website/static/src/img/under_construction.png diff --git a/addons/website_blog/controllers/main.py b/addons/website_blog/controllers/main.py index 00835d133ab..fc48266cc5e 100644 --- a/addons/website_blog/controllers/main.py +++ b/addons/website_blog/controllers/main.py @@ -23,6 +23,7 @@ from openerp.addons.web import http from openerp.addons.web.http import request from openerp.addons.website.models import website from openerp.tools.translate import _ +from openerp import SUPERUSER_ID import werkzeug @@ -218,16 +219,23 @@ class WebsiteBlog(http.Controller): } return request.website.render("website_blog.blog_post_complete", values) - @website.route(['/blogpost/<int:blog_post_id>/comment'], type='http', auth="public") - def blog_post_comment(self, blog_post_id, **post): + @website.route(['/blogpost/comment'], type='http', auth="public", methods=['POST']) + def blog_post_comment(self, blog_post_id=0, **post): cr, uid, context = request.cr, request.uid, request.context if post.get('comment'): - request.registry['blog.post'].message_post( - cr, uid, blog_post_id, - body=post.get('comment'), - type='comment', - subtype='mt_comment', - context=dict(context, mail_create_nosubcribe=True)) + user = request.registry['res.users'].browse(cr, SUPERUSER_ID, uid, context=context) + group_ids = user.groups_id + group_id = request.registry["ir.model.data"].get_object_reference(cr, uid, 'website_mail', 'group_comment')[1] + if group_id in [group.id for group in group_ids]: + blog_post = request.registry['blog.post'] + blog_post.check_access_rights(cr, uid, 'read') + blog_post.message_post( + cr, SUPERUSER_ID, int(blog_post_id), + body=post.get('comment'), + type='comment', + subtype='mt_comment', + author_id=user.partner_id.id, + context=dict(context, mail_create_nosubcribe=True)) return werkzeug.utils.redirect(request.httprequest.referrer + "#comments") @website.route('/blogpost/new', type='http', auth="public", multilang=True) diff --git a/addons/website_blog/views/website_blog_templates.xml b/addons/website_blog/views/website_blog_templates.xml index 4fe512381a4..a3afdcbfd83 100644 --- a/addons/website_blog/views/website_blog_templates.xml +++ b/addons/website_blog/views/website_blog_templates.xml @@ -218,10 +218,10 @@ <template id="opt_blog_post_complete_comment" name="Allow Comments" inherit_option_id="website_blog.blog_post_complete" inherit_id="website_blog.blog_post_complete" groups="website_mail.group_comment"> - <xpath expr="//ul[@id='comments-list']" position="after"> + <xpath expr="//ul[@id='comments-list']" position="before"> <section class="mb32 css_editable_mode_hidden"> - <form id="comment" t-attf-action="/blogpost/#{blog_post.id}/comment" - method="POST"> + <form id="comment" t-attf-action="/blogpost/comment" method="POST"> + <input name="blog_post_id" t-att-value="blog_post.id" type="hidden"/> <img class="img pull-left img-rounded" t-att-src="'/website/image?model=res.partner&field=image_small&id='+str(user_id.partner_id.id)" style="width: 50px; margin-right: 10px;"/> <div class="pull-left mb32" style="width: 75%%"> <textarea rows="3" name="comment" class="form-control" placeholder="Write a comment..."></textarea> diff --git a/addons/website_mail/static/src/css/website_mail.css b/addons/website_mail/static/src/css/website_mail.css new file mode 100644 index 00000000000..5678442416c --- /dev/null +++ b/addons/website_mail/static/src/css/website_mail.css @@ -0,0 +1,4 @@ +.js_follow[data-follow='on'] .js_follow_btn , +.js_follow[data-follow='off'] .js_unfollow_btn { + display: none; +}
\ No newline at end of file diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index 5f30482723a..7696d01a49d 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -199,10 +199,10 @@ class Ecommerce(http.Controller): @website.route([ '/shop/', '/shop/page/<int:page>/', - '/shop/category/<int:category>/', - '/shop/category/<int:category>/page/<int:page>/' + '/shop/category/<model("product.public.category"):category>/', + '/shop/category/<model("product.public.category"):category>/page/<int:page>/' ], type='http', auth="public", multilang=True) - def shop(self, category=0, page=0, filters='', search='', **post): + def shop(self, category=None, page=0, filters='', search='', **post): cr, uid, context = request.cr, request.uid, request.context product_obj = request.registry.get('product.template') domain = request.registry.get('website').ecommerce_get_product_domain() @@ -211,7 +211,7 @@ class Ecommerce(http.Controller): ('name', 'ilike', "%%%s%%" % search), ('description', 'ilike', "%%%s%%" % search)] if category: - domain.append(('product_variant_ids.public_categ_id', 'child_of', category)) + domain.append(('product_variant_ids.public_categ_id', 'child_of', category.id)) if filters: filters = simplejson.loads(filters) if filters: @@ -286,7 +286,7 @@ class Ecommerce(http.Controller): } return request.website.render("website_sale.product", values) - @website.route(['/shop/product/<int:product_template_id>/comment'], type='http', auth="public") + @website.route(['/shop/product/comment'], type='http', auth="public", methods=['POST']) def product_comment(self, product_template_id, **post): cr, uid, context = request.cr, request.uid, request.context if post.get('comment'): @@ -298,11 +298,11 @@ class Ecommerce(http.Controller): context=dict(context, mail_create_nosubcribe=True)) return werkzeug.utils.redirect(request.httprequest.referrer + "#comments") - @website.route(['/shop/add_product/', '/shop/category/<int:cat_id>/add_product/'], type='http', auth="user", multilang=True, methods=['POST']) - def add_product(self, name="New Product", cat_id=0, **post): + @website.route(['/shop/add_product/'], type='http', auth="user", multilang=True, methods=['POST']) + def add_product(self, name="New Product", category=0, **post): Product = request.registry.get('product.product') product_id = Product.create(request.cr, request.uid, { - 'name': name, 'public_categ_id': cat_id + 'name': name, 'public_categ_id': category }, context=request.context) product = Product.browse(request.cr, request.uid, product_id, context=request.context) diff --git a/addons/website_sale/data/website_sale_demo.xml b/addons/website_sale/data/website_sale_demo.xml index c16690f763d..d28a587603d 100644 --- a/addons/website_sale/data/website_sale_demo.xml +++ b/addons/website_sale/data/website_sale_demo.xml @@ -536,6 +536,7 @@ Weight: 1.1 ounces</field> </div> </section> </field> + <field name="suggested_product_ids" eval="[(6, 0, [ref('product.product_template_7')])]"/> </record> <record id="item1" model="product.pricelist.item"> diff --git a/addons/website_sale/views/website_sale.xml b/addons/website_sale/views/website_sale.xml index bc9695cda39..902bb9ee604 100644 --- a/addons/website_sale/views/website_sale.xml +++ b/addons/website_sale/views/website_sale.xml @@ -188,7 +188,8 @@ </table> <t t-if="not bins"> <div class="text-center text-muted"> - <h3>No product found</h3> + <h3 class="css_editable_display">No product found</h3> + <h3 class="css_non_editable_mode_hidden">There isn't available products right know, click <a t-href="/page/website.contactus">here</a> to contact us</h3> <t groups="base.group_website_publisher"> <p>Click on "Content" to define a new product or "Help" for more informations.</p> <img src="/website/static/src/img/content_here.png"/> diff --git a/addons/website_sale_delivery/controllers/main.py b/addons/website_sale_delivery/controllers/main.py index b31d0919af6..9c688cc1b97 100644 --- a/addons/website_sale_delivery/controllers/main.py +++ b/addons/website_sale_delivery/controllers/main.py @@ -2,6 +2,7 @@ from openerp.addons.website_sale.controllers.main import Ecommerce from openerp.addons.web.http import request from openerp.addons.website.models import website +from openerp import SUPERUSER_ID class Ecommerce(Ecommerce): @@ -15,8 +16,8 @@ class Ecommerce(Ecommerce): if order and carrier_id: # recompute delivery costs SaleOrder = request.registry['sale.order'] - SaleOrder.write(cr, uid, [order.id], {'carrier_id': carrier_id}, context=context) - SaleOrder.delivery_set(cr, uid, [order.id], context=context) + SaleOrder.write(cr, SUPERUSER_ID, [order.id], {'carrier_id': carrier_id}, context=context) + SaleOrder.delivery_set(cr, SUPERUSER_ID, [order.id], context=context) res = super(Ecommerce, self).payment(**post) return res |
