[MERGE] Sync with website-al

bzr revid: tde@openerp.com-20140114171738-zz4apq7nk5dcov0i
This commit is contained in:
Thibault Delavallée 2014-01-14 18:17:38 +01:00
commit 5be1dfda6e
13 changed files with 88 additions and 33 deletions

View File

@ -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"/>

View File

@ -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;

View File

@ -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 ---- {{{ */

View File

@ -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;

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -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)

View File

@ -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&amp;field=image_small&amp;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>

View File

@ -0,0 +1,4 @@
.js_follow[data-follow='on'] .js_follow_btn ,
.js_follow[data-follow='off'] .js_unfollow_btn {
display: none;
}

View File

@ -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)

View File

@ -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">

View File

@ -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"/>

View File

@ -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