[MERGE] Sync with website-al, because sale was broken

bzr revid: tde@openerp.com-20131204130704-fa3pu4gnpku0frsj
bzr revid: tde@openerp.com-20131204144838-vu66z2lsybqtp4hm
This commit is contained in:
Thibault Delavallée
2013-12-04 15:48:38 +01:00
36 changed files with 478 additions and 308 deletions
@@ -19,7 +19,7 @@ class AdyenController(http.Controller):
@website.route([
'/payment/adyen/return/',
], type='http', auth='public')
], type='http', auth='public', methods=['POST'])
def adyen_return(self, **post):
""" Paypal IPN. """
_logger.info('Beginning Adyen form_feedback with post data %s', pprint.pformat(post)) # debug
+5 -2
View File
@@ -529,12 +529,15 @@ class product_product(osv.osv):
pricelist_ids = self.pool.get('product.pricelist').name_search(
cr, uid, pricelist, operator='=', context=context, limit=1)
pricelist = pricelist_ids[0][0] if pricelist_ids else pricelist
qtys = map(lambda x: (x, quantity, partner), ids)
price = self.pool.get('product.pricelist').price_get_multi(cr,uid, [pricelist],
qtys, context=context)
for id in ids:
try:
price = self.pool.get('product.pricelist').price_get(cr,uid,[pricelist], id, quantity, partner=partner, context=context)[pricelist]
res[id] = price[id][pricelist]
except:
price = 0.0
res[id] = price
for id in ids:
res.setdefault(id, 0.0)
return res
+1
View File
@@ -2,6 +2,7 @@
import logging
import traceback
import werkzeug
import werkzeug.routing
import openerp
+9 -3
View File
@@ -77,6 +77,9 @@ def urlplus(url, params):
for k, v in params.iteritems()
))
def quote_plus(value):
return urllib.quote_plus(value.encode('utf-8') if isinstance(value, unicode) else str(value))
class website(osv.osv):
def _get_menu_website(self, cr, uid, ids, context=None):
# IF a menu is changed, update all websites
@@ -181,10 +184,12 @@ class website(osv.osv):
return self.pool['website'].browse(cr, uid, 1, context=context)
def preprocess_request(self, cr, uid, ids, request, context=None):
# TODO FP: is_website_publisher and editable in context should be removed
# for performance reasons (1 query per image to load) but also to be cleaner
# I propose to replace this by a group 'base.group_website_publisher' on the
# view that requires it.
Access = request.registry['ir.model.access']
is_website_publisher = (
Access.check_groups(cr, uid, 'base.group_website_publisher')
and Access.check(cr, uid, 'ir.ui.view', 'write', False, context))
is_website_publisher = Access.check(cr, uid, 'ir.ui.view', 'write', False, context)
lang = request.context['lang']
is_master_lang = lang == request.website.default_lang_code
@@ -224,6 +229,7 @@ class website(osv.osv):
slug=slug,
res_company=request.website.company_id,
user_id=user.browse(cr, uid, uid),
quote_plus=quote_plus,
)
context.update(
@@ -17,3 +17,5 @@ access_website_qweb_field_html,access_website_qweb_field_html,model_website_qweb
access_website_qweb_field_image,access_website_qweb_field_image,model_website_qweb_field_image,,0,0,0,0
access_website_qweb_field_monetary,access_website_qweb_field_monetary,model_website_qweb_field_monetary,,0,0,0,0
access_website_ir_ui_view,access_website_ir_ui_view,model_ir_ui_view,base.group_website_designer,1,1,1,1
access_seo_public,access_seo_public,model_website_seo_metadata,base.group_public,1,0,0,0
access_seo_designer,access_seo_designer,model_website_seo_metadata,base.group_website_designer,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
17 access_website_qweb_field_image access_website_qweb_field_image model_website_qweb_field_image 0 0 0 0
18 access_website_qweb_field_monetary access_website_qweb_field_monetary model_website_qweb_field_monetary 0 0 0 0
19 access_website_ir_ui_view access_website_ir_ui_view model_ir_ui_view base.group_website_designer 1 1 1 1
20 access_seo_public access_seo_public model_website_seo_metadata base.group_public 1 0 0 0
21 access_seo_designer access_seo_designer model_website_seo_metadata base.group_website_designer 1 1 1 1
+9 -2
View File
@@ -150,10 +150,10 @@ div.oe_menu_buttons {
right: -8px;
}
ul.oe_menu_editor .icon-home {
ul.oe_menu_editor .fa-home {
display: none;
}
ul.oe_menu_editor > li:first-child > div > span > .icon-home {
ul.oe_menu_editor > li:first-child > div > span > .fa-home {
display: block;
}
ul.oe_menu_editor .oe_menu_placeholder {
@@ -220,6 +220,13 @@ ul.oe_menu_editor .disclose {
background-color: #ffd9dd !important;
}
.hover-edition-button {
position: absolute;
top: 0;
left: 0;
z-index: 42;
}
/* ---- SNIPPET EDITOR ---- */
#oe_snippets {
position: fixed;
+8 -2
View File
@@ -120,9 +120,9 @@ div.oe_menu_buttons
right: -8px
ul.oe_menu_editor
.icon-home
.fa-home
display: none
> li:first-child > div > span > .icon-home
> li:first-child > div > span > .fa-home
display: block
.oe_menu_placeholder
outline: 1px dashed #4183C4
@@ -181,6 +181,12 @@ ul.oe_menu_editor
outline: 1px solid red !important
background-color: #ffd9dd !important
.hover-edition-button
position: absolute
top: 0
left: 0
z-index: 42
/* ---- SNIPPET EDITOR ---- */
#oe_snippets
+13 -9
View File
@@ -406,29 +406,33 @@ ul.nav-stacked > li > a {
}
/* Parallax Theme */
.parallax_quote, [data-snippet-id="slider"] {
background: center center no-repeat fixed;
background-size: contain;
}
.parallax_quote .carousel-indicators li, [data-snippet-id="slider"] .carousel-indicators li {
div.carousel[data-snippet-id="slider"] .carousel-indicators li {
border: 1px solid grey;
}
.parallax_quote .carousel-indicators .active, [data-snippet-id="slider"] .carousel-indicators .active {
div.carousel[data-snippet-id="slider"] .carousel-indicators .active {
background-color: grey;
}
.parallax {
position: relative;
background-size: 100%;
display: table;
width: 100%;
min-height: 100px;
}
.parallax.oe_small {
height: 200px;
min-height: 200px;
}
.parallax.oe_medium {
height: 300px;
min-height: 300px;
}
.parallax.oe_big {
height: 450px;
min-height: 450px;
}
.parallax > div {
display: table-cell;
vertical-align: middle;
padding: 32px 0;
}
/* Background */
+11 -6
View File
@@ -304,9 +304,7 @@ ul.nav-stacked > li > a
/* Parallax Theme */
.parallax_quote, [data-snippet-id="slider"]
background: center center no-repeat fixed
background-size: contain
div.carousel[data-snippet-id="slider"]
.carousel-indicators
li
border: 1px solid grey
@@ -316,12 +314,19 @@ ul.nav-stacked > li > a
.parallax
position: relative
background-size: 100%
display: table
width: 100%
min-height: 100px
&.oe_small
height: 200px
min-height: 200px
&.oe_medium
height: 300px
min-height: 300px
&.oe_big
height: 450px
min-height: 450px
> div
display: table-cell
vertical-align: middle
padding: 32px 0
/* Background */
+118 -62
View File
@@ -17,6 +17,11 @@
website.form(this.pathname, 'POST');
});
$(document).on('submit', '.cke_editable form', function (ev) {
// Disable form submition in editable mode
ev.preventDefault();
});
$(document).on('hide.bs.dropdown', '.dropdown', function (ev) {
// Prevent dropdown closing when a contenteditable children is focused
if (ev.originalEvent
@@ -68,57 +73,6 @@
link_dialog(editor);
}, null, null, 500);
var previousSelection;
$(editor.element.$).on('mouseenter', 'img', function () {
if (previousSelection) { return; }
var selected = new CKEDITOR.dom.element(this);
if (!selected.is('img')
|| selected.data('cke-realelement')
|| selected.isReadOnly()
|| selected.data('oe-model') === 'ir.ui.view') {
return;
}
// display button
var $el = $((previousSelection = selected).$);
var $btn = $('<button type="button" class="btn btn-primary image-edit-button" contenteditable="false">Edit</button>')
.insertAfter($el)
.click(function (e) {
e.preventDefault();
e.stopPropagation();
image_dialog(editor, selected);
});
var position = $el.position();
// http://bugs.jquery.com/ticket/5445#comment:6
// if the image has margin: x auto for centering, FF & IE
// will report top/left as the "correct" value and
// marginTop/marginLeft at "0px", webkit browsers will
// report top/left as 0-ish and set marginTop and
// marginLeft
var image_top = position.top + parseInt($el.css('marginTop'), 10);
var image_left = position.left + parseInt($el.css('marginLeft'), 10);
$btn.css({
position: 'absolute',
top: $el.height() / 2 + image_top - $btn.outerHeight() / 2,
left: $el.width() / 2 + image_left - $btn.outerWidth() / 2,
});
}).on('mouseleave', 'img', function (e) {
if (!previousSelection) { return; }
var $previous = $(previousSelection.$);
var $button = $previous.next('button');
$button.css('visibility', 'hidden');
var el = document.elementFromPoint(e.clientX, e.clientY);
$button.css('visibility', '');
if (el === this) { return; }
$button.remove();
previousSelection = null;
});
editor.on('destroy', function () {
if (!previousSelection) { return; }
$('.image-edit-button').remove();
});
//noinspection JSValidateTypes
editor.addCommand('link', {
exec: function (editor) {
@@ -416,8 +370,8 @@
if (item.header) {
menu.append('<li class="dropdown-header">' + item.name + '</li>');
} else {
menu.append(_.str.sprintf('<li role="presentation"><a href="#" data-view-id="%s" role="menuitem"><strong class="icon-check%s"></strong> %s</a></li>',
item.id, item.active ? '' : '-empty', item.name));
menu.append(_.str.sprintf('<li role="presentation"><a href="#" data-view-id="%s" role="menuitem"><strong class="fa fa%s-square-o"></strong> %s</a></li>',
item.id, item.active ? '' : '-check', item.name));
}
});
// Adding Static Menus
@@ -458,6 +412,7 @@
this.rte = new website.RTE(this);
this.rte.on('change', this, this.proxy('rte_changed'));
this.rte.on('rte:ready', this, function () {
self.setup_hover_buttons();
self.trigger('rte:ready');
});
@@ -555,7 +510,20 @@
});
},
cancel: function () {
website.reload();
new $.Deferred(function (d) {
var $dialog = $(openerp.qweb.render('website.editor.discard')).appendTo(document.body);
$dialog.on('click', '.btn-danger', function () {
d.resolve();
}).on('hidden.bs.modal', function () {
d.reject();
});
d.always(function () {
$dialog.remove();
});
$dialog.modal('show');
}).then(function () {
website.reload();
})
},
new_page: function (ev) {
ev.preventDefault();
@@ -568,6 +536,97 @@
}
});
},
/**
* Creates a "hover" button for image and link edition
*
* @param {String} label the button's label
* @param {Function} editfn edition function, called when clicking the button
* @param {String} [classes] additional classes to set on the button
* @returns {jQuery}
*/
make_hover_button: function (label, editfn, classes) {
return $(openerp.qweb.render('website.editor.hoverbutton', {
label: label,
classes: classes,
})).hide().appendTo(document.body).click(function (e) {
e.preventDefault();
e.stopPropagation();
editfn.call(this, e);
});
},
/**
* For UI clarity, during RTE edition when the user hovers links and
* images a small button should appear to make the capability clear,
* as not all users think of double-clicking the image or link.
*/
setup_hover_buttons: function () {
var editor = this.rte.editor;
var $link_button = this.make_hover_button(_t("Edit Link"), function () {
var sel = new CKEDITOR.dom.element(previous);
editor.getSelection().selectElement(sel);
link_dialog(editor);
$link_button.hide();
previous = null;
}, 'btn-xs');
var $image_button = this.make_hover_button(_t("Edit Image"), function () {
image_dialog(editor, new CKEDITOR.dom.element(previous));
$image_button.hide();
previous = null;
});
// previous is the state of the button-trigger: it's the
// currently-ish hovered element which can trigger a button showing.
// -ish, because when moving to the button itself ``previous`` is
// still set to the element having triggered showing the button.
var previous;
$(editor.element.$).on('mouseover', 'a, img', function (e) {
// Back from edit button -> ignore
if (previous && previous === this) { return; }
var selected = new CKEDITOR.dom.element(this);
if (selected.data('oe-model') === 'ir.ui.view'
|| selected.data('cke-realelement')
|| selected.isReadOnly()) {
return;
}
previous = this;
var $selected = $(this);
var position = $selected.offset();
if ($selected.is('img')) {
var image_top = position.top + parseInt($selected.css('marginTop'), 10);
var image_left = position.left + parseInt($selected.css('marginLeft'), 10);
$link_button.hide();
// center button on image
$image_button.show().offset({
top: $selected.outerHeight() / 2
+ image_top
- $image_button.outerHeight() / 2,
left: $selected.outerWidth() / 2
+ image_left
- $image_button.outerWidth() / 2,
});
} else {
$image_button.hide();
// put button below link, horizontally centered
$link_button.show().offset({
top: $selected.outerHeight()
+ position.top,
left: $selected.outerWidth() / 2
+ position.left
- $link_button.outerWidth() / 2
})
}
}).on('mouseleave', 'a, img', function (e) {
var current = document.elementFromPoint(e.clientX, e.clientY);
if (current === $link_button[0] || current === $image_button[0]) {
return;
}
$image_button.add($link_button).hide();
previous = null;
});
}
});
var blocks_selector = _.keys(CKEDITOR.dtd.$block).join(',');
@@ -1415,14 +1474,11 @@
var output = [];
for(var i=0; i<nodes.length; ++i) {
var node = nodes[i];
if (node.nodeName === 'BR' && node.getAttribute('type') === '_moz') {
// <br type="_moz"> appears when focusing RTE in FF, ignore
continue;
}
if (node.className.indexOf('image-edit-button') !== -1) {
// [Edit] button added and removed on image hover, don't count
// as making parent node dirty
continue;
if (node.nodeType === document.ELEMENT_NODE) {
if (node.nodeName === 'BR' && node.getAttribute('type') === '_moz') {
// <br type="_moz"> appears when focusing RTE in FF, ignore
continue;
}
}
output.push(node);
@@ -106,6 +106,7 @@
$(window).scroll();
};
img.src = this.$target.css("background-image").replace(/url\(['"]*|['"]*\)/g, "");
$(window).scroll();
}
});
@@ -301,7 +301,11 @@
$toInsert = $snippet.find('.oe_snippet_body').clone();
$toInsert.removeClass('oe_snippet_body');
$toInsert.attr('data-snippet-id', snipped_id);
if (!$toInsert.data('snippet-id')) {
$toInsert.attr('data-snippet-id', snipped_id);
} else {
snipped_id = $toInsert.data('snippet-id');
}
} else if( action === 'mutate' ){
if (!$snippet.data('selector')) {
@@ -936,7 +940,8 @@
* function called just before save vue
*/
clean_for_save: function () {
this.$target.find(".row:empty").remove();
this.$target.removeAttr('contentEditable')
.find('*').removeAttr('contentEditable');
},
});
@@ -1104,7 +1109,7 @@
},
on_clone: function () {
var $clone = this.$target.clone(false);
var _class = $clone.attr("class").replace(/\s*(col-md-|col-lg-offset-|col-md-offset-)([0-9-]+)/g, '');
var _class = $clone.attr("class").replace(/\s*(col-lg-offset-|col-md-offset-)([0-9-]+)/g, '');
_class += ' col-md-1';
$clone.attr("class", _class);
this.$target.after($clone);
@@ -1143,13 +1148,7 @@
website.snippet.editorRegistry.slider = website.snippet.editorRegistry.resize.extend({
drop_and_build_snippet: function() {
var id = 0;
$(".carousel").each(function () {
var _id = +$(this).attr("id").replace(/^[^a-z]+/i, '');
if (id <= _id) {
id = _id + 1;
}
});
var id = $(".carousel").length;
this.id = "myCarousel" + id;
this.$target.attr("id", this.id);
this.$target.find(".carousel-control").attr("href", "#myCarousel" + id);
@@ -1174,8 +1173,6 @@
if(!this.$target.find(".item.active").length) {
this.$target.find(".item:first").addClass("active");
}
this.$target.removeAttr('contentEditable')
.find('*').removeAttr('contentEditable');
},
onFocus: function () {
this._super();
@@ -1186,13 +1183,14 @@
this.$target.carousel('cycle');
},
start : function () {
var self = this;
this._super();
this.id = this.$target.attr("id");
this.$inner = this.$target.find('.carousel-inner');
this.$indicators = this.$target.find('.carousel-indicators');
this.$editor.find(".js_add").on('click', _.bind(this.on_add_slide, this));
this.$editor.find(".js_remove").on('click', _.bind(this.on_remove_slide, this));
this.$editor.find(".js_add").on('click', function () {self.on_add_slide(); return false;});
this.$editor.find(".js_remove").on('click', function () {self.on_remove_slide(); return false;});
this.rebind_event();
},
@@ -1318,6 +1316,8 @@
this.$target.on('snippet-style-change snippet-style-preview', function () {
self.$target.data("snippet-view").set_values();
});
this.$target.attr('contentEditable', 'false');
this.$target.find('> div > .oe_structure').attr('contentEditable', 'true');
},
scroll: function () {
var self = this;
@@ -103,7 +103,7 @@
},
{
stepId: 'activate-text-block-title',
element: '#wrap [data-snippet-id=three-columns] .text-center[data-snippet-id=colmd]',
element: '#wrap [data-snippet-id=three-columns]:first .text-center[data-snippet-id=colmd]',
placement: 'top',
title: "Edit an Area",
content: "Select any area of the page to modify it. Click on this subtitle.",
@@ -115,11 +115,11 @@
},
{
stepId: 'remove-text-block-title',
element: '.oe_snippet_remove:last',
element: '.ui-draggable.oe_active .oe_snippet_remove',
placement: 'top',
reflex: true,
title: "Delete the Title",
content: "From this toolbar you can move, duplicate or delete the selected zone. Click on the cross to delete the title.",
content: "From this toolbar you can move, duplicate or delete the selected zone. Click on the trash can to delete the title.",
},
{
stepId: 'save-changes',
+35 -7
View File
@@ -38,8 +38,23 @@
self.moveToNextStep();
});
};
} else {
step.onShow = step.triggers;
} else if (step.triggers) {
step.onShow = (function () {
var executed = false;
return function () {
if (!executed) {
step.triggers();
executed = true;
}
};
}());
} else if (step.reflex) {
step.onShow = function () {
$(step.element).one('click', function () {
self.moveToNextStep();
});
};
delete step.reflex;
}
return step;
}));
@@ -84,17 +99,18 @@
}
},
moveToNextStep: function () {
this.moveToStep(this.currentStepIndex() + 1);
var nextStepIndex = this.currentStepIndex() + 1;
this.moveToStep(nextStepIndex);
},
stop: function () {
this.tour.end();
},
redirect: function (url) {
url = url || new website.UrlParser(window.location.href);
if (this.startPath && url.pathname !== this.startPath) {
var newUrl = this.startPath + (url.search ? (url.search + "&") : "?") + this.id + "=true";
window.location.replace(newUrl);
}
var path = (this.startPath && url.pathname !== this.startPath) ? this.startPath : url.pathname;
var search = url.addToSearch(this.id + "=true");
var newUrl = path + search;
window.location.replace(newUrl);
},
ended: function () {
return this.tourStorage.getItem(this.id+'_end') === "yes";
@@ -146,6 +162,18 @@
this.origin = a.origin;
this.search = a.search;
this.hash = a.hash;
this.addToSearch= function (query) {
var querystring = _.filter(this.search.split('?'), function (str) {
return str;
});
if (querystring.length > 0) {
var queries = querystring[0].split("&");
queries.push(query);
return "?" + _.uniq(queries).join("&");
} else {
return "?"+query;
}
};
},
});
@@ -6,7 +6,7 @@
<button type="button" data-action="save"
class="btn btn-primary">Save</button>
<button type="button" data-action="cancel"
class="btn">Cancel</button>
class="btn">Discard</button>
</form>
<ul class="nav navbar-nav pull-right">
</ul>
@@ -170,4 +170,35 @@
</table>
</t>
<t t-name="website.editor.discard">
<div class="modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 class="modal-title">Discard edition</h3>
</div>
<div class="modal-body">
<p>
If you discard the current edition, <em>all</em>
unsaved changes will be lost.
</p>
<p>You can cancel to return to the edition mode.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger">Discard</button>
<button type="button" class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
</div>
</div>
</div>
</div>
</t>
<t t-name="website.editor.hoverbutton">
<button type="button" contenteditable="false"
t-attf-class="btn btn-primary hover-edition-button #{classes or ''}">
<t t-esc="label"/>
</button>
</t>
</templates>
@@ -2,16 +2,16 @@
<t t-name="website.menu.dialog.submenu">
<li t-att-data-menu-id="submenu.id">
<div class="input-group">
<span class="input-group-addon icon-reorder"/>
<span class="input-group-addon fa fa-bars"/>
<span class="form-control" style="padding-top: 0; padding-bottom: 0;">
<span class="js_menu_label">
<t t-esc="submenu.name"/>
</span>
<i class="pull-right icon-home" style="margin-top: 3px"/>
<i class="pull-right fa fa-home" style="margin-top: 3px"/>
</span>
<span class="input-group-btn">
<button type="button" class="btn btn-primary js_edit_menu icon-edit"/>
<button type="button" class="btn btn-danger js_delete_menu icon-trash"/>
<button type="button" class="btn btn-primary js_edit_menu fa fa-edit"/>
<button type="button" class="btn btn-danger js_delete_menu fa fa-trash-o"/>
</span>
</div>
<t t-set="children" t-value="submenu.children"/>
@@ -32,11 +32,11 @@
</ul>
<div class="mt16">
<div class="pull-right text-muted">
<span class="icon-indent-right"/> right indent for multi-level menus
<span class="fa fa-indent"/> right indent for multi-level menus
</div>
<div>
<a href="#" class="js_add_menu">
<i class="icon-plus-sign"/> Add Menu Entry
<i class="fa fa-plus-circle"/> Add Menu Entry
</a>
</div>
</div>
+52 -44
View File
@@ -711,10 +711,11 @@
<li data-value="1.7"><a>Very Fast</a></li>
</ul>
</li>
<div class="oe_snippet_body parallax oe_small oe_structure"
style="background-image: url('/website/static/src/img/parallax/parallax_bg.jpg')"
<section class="oe_snippet_body parallax oe_medium"
style="background-image: url('/website/static/src/img/banner/mountains.jpg')"
data-scroll-background-ratio="0.3">
</div>
<div><div class="oe_structure"/></div>
</section>
</div>
<div data-snippet-id="parallax_quote" data-selector-children=".oe_structure, [data-oe-type=html]">
@@ -722,51 +723,57 @@
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_quotes_slider.png"/>
<span class="oe_snippet_thumbnail_title">Parallax Slider</span>
</div>
<section class="oe_snippet_body parallax_quote oe_structure" style="background-image: url('/website/static/src/img/parallax/quote.png')">
<div id="myQuoteCarousel" class="carousel slide oe_medium mb32" data-snippet-id="slider">
<!-- Indicators -->
<ol class="carousel-indicators mb0">
<li data-target="#myQuoteCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myQuoteCarousel" data-slide-to="1"></li>
</ol>
<div class="carousel-inner">
<section class="oe_snippet_body parallax oe_medium" data-snippet-id="parallax"
style="background-image: url('/website/static/src/img/parallax/quote.png')"
data-scroll-background-ratio="0.3">
<div>
<div class="oe_structure">
<div id="myQuoteCarousel" class="carousel slide oe_small mb0" data-snippet-id="slider">
<!-- Indicators -->
<ol class="carousel-indicators mb0">
<li data-target="#myQuoteCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myQuoteCarousel" data-slide-to="1"></li>
</ol>
<div class="carousel-inner">
<div class="item text_only active">
<div class="container">
<div class="content">
<div class="item text_only active">
<div class="container">
<div class="content">
<div class="row">
<blockquote class="col-md-5 col-md-offset-4 mt64">
<p>
Write here a quote from one of your customer. Quotes are are
great way to give confidence in your products or services.
</p>
<small>Author of this quote</small>
</blockquote>
<div class="row">
<blockquote class="col-md-5 col-md-offset-4 mt64">
<p>
Write here a quote from one of your customer. Quotes are are
great way to give confidence in your products or services.
</p>
<small>Author of this quote</small>
</blockquote>
</div>
</div>
</div>
</div>
<div class="item text_only">
<div class="container">
<div class="content">
<div class="row">
<blockquote class="col-md-5 col-md-offset-4 mt64">
<p>
OpenERP provides essential platform for our project management.
Things are better organized and more visible with it.
</p>
<small>John Doe, CEO</small>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="item text_only">
<div class="container">
<div class="content">
<div class="row">
<blockquote class="col-md-5 col-md-offset-4 mt64">
<p>
OpenERP provides essential platform for our project management.
Things are better organized and more visible with it.
</p>
<small>John Doe, CEO</small>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
@@ -794,18 +801,19 @@
</li>
</div>
<div data-snippet-style-id='size' data-selector='div[data-snippet-id="parallax"], div[data-snippet-id="carousel"], div[data-snippet-id="slider"]'>
<div data-snippet-style-id='size' data-selector='section[data-snippet-id="parallax"], div[data-snippet-id="carousel"], div[data-snippet-id="slider"]'>
<li class="dropdown-submenu" data-required="true">
<a tabindex="-1" href="#">Size</a>
<ul class="dropdown-menu">
<li data-class='oe_small'><a>Small</a></li>
<li data-class='oe_medium'><a>Medium</a></li>
<li data-class='oe_big'><a>Big</a></li>
<li data-class=''><a>Auto</a></li>
</ul>
</li>
</div>
<div data-snippet-style-id='background' data-selector='section, div[data-snippet-id="parallax"], div[data-snippet-id="carousel"]'>
<div data-snippet-style-id='background' data-selector='section, section[data-snippet-id="parallax"], div[data-snippet-id="carousel"]'>
<li class="dropdown-submenu">
<a tabindex="-1" href="#">Background</a>
<ul class="dropdown-menu">
@@ -837,7 +845,6 @@
<li class="dropdown-submenu">
<a tabindex="-1" href="#">Various</a>
<ul class="dropdown-menu">
<li data-class="oe_img_bg" data-src="/website/static/src/img/parallax/quote.png"><a>Aqua</a></li>
<li data-class="oe_img_bg" data-src="/website/static/src/img/banner/aqua.jpg"><a>Aqua</a></li>
<li data-class="oe_img_bg" data-src="/website/static/src/img/banner/baby_blue.jpg"><a>Baby Blue</a></li>
<li data-class="oe_img_bg" data-src="/website/static/src/img/banner/black.jpg"><a>Black</a></li>
@@ -848,6 +855,7 @@
<li data-class="oe_img_bg" data-src="/website/static/src/img/banner/velour.jpg"><a>Velour</a></li>
<li data-class="oe_img_bg" data-src="/website/static/src/img/banner/wood.jpg"><a>Wood</a></li>
<li data-class="oe_img_bg" data-src="/website/static/src/img/banner/yellow_green.jpg"><a>Yellow Green</a></li>
<li data-class="oe_img_bg" data-src="/website/static/src/img/parallax/quote.png"><a>Quote</a></li>
</ul>
</li>
<li><a style="background: none; padding: 5px; border-top: 1px solid #ddd;"></a></li>
+14 -14
View File
@@ -138,7 +138,7 @@
<ul class="dropdown-menu js_usermenu" role="menu">
<li><a href="/web" role="menuitem">Administration</a></li>
<li class="divider"/>
<li><a t-attf-href="/web/session/logout?redirect=#{ url_for('') }" role="menuitem">Logout</a></li>
<li><a t-attf-href="/web/session/logout?redirect=#{ quote_plus(url_for('', keep_query='*')) }" role="menuitem">Logout</a></li>
</ul>
</li>
</ul>
@@ -162,16 +162,16 @@
<li><a href="/page/website.contactus">Contact us</a></li>
</ul>
<ul class="list-unstyled">
<li><i class="icon-phone"></i> <span t-field="res_company.phone"></span></li>
<li><i class="icon-envelope"></i> <span t-field="res_company.email"></span></li>
<li><i class="fa fa-phone"></i> <span t-field="res_company.phone"></span></li>
<li><i class="fa fa-envelope"></i> <span t-field="res_company.email"></span></li>
</ul>
<h2>
<a t-att-href="website.social_facebook" t-if="website.social_facebook"><i class="icon-facebook-sign"/></a>
<a t-att-href="website.social_twitter" t-if="website.social_twitter"><i class="icon-twitter-sign"/></a>
<a t-att-href="website.social_linkedin" t-if="website.social_linkedin"><i class="icon-linkedin-sign"/></a>
<a t-att-href="website.social_youtube" t-if="website.social_youtube"><i class="icon-youtube-sign"/></a>
<a t-att-href="website.social_googleplus" t-if="website.social_googleplus"><i class="icon-google-plus-sign"/></a>
<a t-att-href="website.social_github" t-if="website.social_github"><i class="icon-github-sign"/></a>
<a t-att-href="website.social_facebook" t-if="website.social_facebook"><i class="fa fa-facebook-square"/></a>
<a t-att-href="website.social_twitter" t-if="website.social_twitter"><i class="fa fa-twitter"/></a>
<a t-att-href="website.social_linkedin" t-if="website.social_linkedin"><i class="fa fa-linkedin"/></a>
<a t-att-href="website.social_youtube" t-if="website.social_youtube"><i class="fa fa-youtube-play"/></a>
<a t-att-href="website.social_googleplus" t-if="website.social_googleplus"><i class="fa fa-google-plus-square"/></a>
<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">
@@ -193,15 +193,15 @@
<t t-set="languages" t-value="website.get_languages()"/>
<ul class="nav nav-pills js_language_selector" t-if="(len(languages) &gt; 1 or editable)">
<li t-foreach="languages" t-as="lg">
<a t-att-href="url_for('', lang=lg[0])"
<a t-att-href="url_for('', lang=lg[0], keep_query='*')"
t-att-data-default-lang="editable and 'true' if lg[0] == website.default_lang_code else None">
<t t-esc="lg[1].split('/').pop()"/>
</a>
</li>
<li t-if="editable">
<t t-set="url_return" t-value="url_for(request.httprequest.path, '[lang]')"/>
<t t-set="url_return" t-value="url_for(request.httprequest.path, '[lang]', keep_query='*')"/>
<a t-attf-href="/web#action=base.action_view_base_language_install&amp;website_id=#{website.id}&amp;url_return=#{url_return}">
<i class="icon-plus-sign"/>
<i class="fa fa-plus-circle"/>
Add a language...
</a>
</li>
@@ -227,7 +227,7 @@
<template id="show_sign_in" inherit_option_id="website.layout" inherit_id="website.layout" name="Show Sign In">
<xpath expr="//ul[@id='top_menu']" position="inside">
<li t-if="user_id.id == website.public_user.id">
<a t-attf-href="/web#redirect=#{ url_for('') }">
<a t-attf-href="/web#redirect=#{ quote_plus(url_for('', keep_query='*')) }">
<span class="badge">Sign in</span>
</a>
</li>
@@ -528,7 +528,7 @@ Sitemap: <t t-esc="url_root"/>sitemap.xml
<div t-field="res_company.partner_id">Name</div>
<br />
<div>&amp;#x2706; <span t-field="res_company.phone"></span></div>
<div class="icon-envelope" t-field="res_company.email"></div>
<div class="fa fa-envelope" t-field="res_company.email"></div>
</address>
<a t-att-href="res_company.google_map_link()" target="_BLANK">
<img class="thumbnail img-responsive" t-att-src="res_company.google_map_img()" />
+3 -3
View File
@@ -110,7 +110,7 @@ class WebsiteBlog(http.Controller):
domain = []
if category:
path_filter += "cat/%s/" % category.id
path_filter += "%s/" % category.id
domain += [("id", "in", [blog.id for blog in category.blog_post_ids])]
if tag:
path_filter += 'tag/%s/' % tag.id
@@ -178,7 +178,7 @@ class WebsiteBlog(http.Controller):
- 'nav_list': a dict [year][month] for archives navigation
"""
pager_url = "/blog/%s" % blog_post.id
pager_url = "/blogpost/%s" % blog_post.id
pager = request.website.pager(
url=pager_url,
@@ -233,7 +233,7 @@ class WebsiteBlog(http.Controller):
new_blog_post_id = request.registry['blog.post'].create(
request.cr, request.uid, {
'category_id': category_id,
'name': _("Blog title"),
'name': _("Blog Post Title"),
'content': '',
'website_published': False,
}, context=create_context)
+1 -1
View File
@@ -79,7 +79,7 @@ class BlogPost(osv.Model):
'oe_expand_container_tag': 'div',
'oe_expand_container_class': 'oe_mail_expand text-center',
'oe_expand_container_content': '',
'oe_expand_a_href': '/blog/%d/' % page.id,
'oe_expand_a_href': '/blogpost/%d' % page.id,
'oe_expand_a_class': 'oe_mail_expand btn btn-info',
'oe_expand_separator_node': 'br',
},
@@ -87,7 +87,7 @@
element: 'button[data-action=snippet]',
placement: 'bottom',
title: "Layout Your Blog Post",
content: "Use well designed building blocks to structure the content of your blog.",
content: "Use well designed building blocks to structure the content of your blog. Click 'Insert Blocks' to add new content.",
triggers: function () {
$('button[data-action=snippet]').one('click', function () {
self.moveToNextStep();
@@ -55,25 +55,25 @@
<a t-href="/blogpost/#{ slug(blog) }?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&amp;' or ''}#{ date and 'date=%s' % date or ''}" t-field="blog.name"></a>
<span t-if="not blog.website_published" class="text-warning">
&amp;nbsp;
<span class="icon-warning-sign" title="Not published"/>
<span class="fa fa-warning" title="Not published"/>
</span>
</h4>
<div class="text-muted">
<span class="icon-calendar"> <span t-field="blog.create_date"/> &amp;nbsp;</span>
<span class="icon-folder-open"> In
<span class="fa fa-calendar"> <span t-field="blog.create_date"/> &amp;nbsp;</span>
<span class="fa fa-folder-open"> In
<a t-href="/blog/#{ slug(blog.category_id) }">
<span t-field="blog.category_id"/>
</a> &amp;nbsp;
</span>
</div>
<div class="text-muted icon-tags">
<div class="text-muted fa fa-tags">
<span t-field="blog.website_meta_keywords"/>
<span t-if="editable and not blog.website_meta_keywords" class="label label-danger">
No keywords defined!
</span>
</div>
<div class="text-muted" t-if="len(blog.message_ids) &gt; 0">
<span class="icon-comment">
<span class="fa fa-comment-o">
<a t-href="/blogpost/#{ slug(blog) }/?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&amp;' or ''}#{ date and 'date=%s' % date or ''}#comment">
<t t-if="len(blog.message_ids) &lt;= 1" ><t t-esc="len(blog.message_ids)"/> comment</t>
<t t-if="len(blog.message_ids) > 1"><t t-esc="len(blog.message_ids)"/> comments</t>
@@ -112,8 +112,8 @@
<a t-href="/blogpost/#{ slug(blog_post) }/?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&amp;' or ''}#{ date and 'date=%s' % date or ''}" t-field="blog_post.name"></a>
</h2>
<p class="post-meta text-muted text-center" name='blog_post_data'>
<span class="icon-calendar"> <span t-field="blog_post.create_date"/> &amp;nbsp;</span>
<span t-if="len(blog_post.message_ids) &gt; 0" class="icon-comment">
<span class="fa fa-calendar oe_date"> <span t-field="blog_post.create_date"/> &amp;nbsp;</span>
<span t-if="len(blog_post.message_ids) &gt; 0" class="fa fa-comment-o">
<a t-href="/blogpost/#{ slug(blog_post) }/?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&amp;' or ''}#{ date and 'date=%s' % date or ''}#comment">
<t t-if="len(blog_post.message_ids) &lt;= 1" ><t t-esc="len(blog_post.message_ids)"/> comment</t>
<t t-if="len(blog_post.message_ids) > 1"><t t-esc="len(blog_post.message_ids)"/> comments</t>
@@ -132,8 +132,8 @@
<!-- Options: Blog Post Summary: hide author -->
<template id="opt_blog_post_short_author" name="Author"
inherit_option_id="website_blog.blog_post_short">
<xpath expr="//span[@class='icon-calendar']" position="after">
<span class="icon-user"> By <span t-field="blog_post.create_uid"/> &amp;nbsp;</span>
<xpath expr="//span[@class*='oe_date']" position="after">
<span class="fa fa-user"> By <span t-field="blog_post.create_uid"/> &amp;nbsp;</span>
</xpath>
</template>
@@ -142,7 +142,7 @@
inherit_option_id="website_blog.blog_post_short" inherit_id="website_blog.blog_post_short">
<xpath expr="//p[@name='blog_post_data']" position="after">
<p class="post-meta text-muted text-center" t-if="len(blog_post.tag_ids)">
<span class="icon-tags"/>
<span class="fa fa-tags"/>
<t t-foreach="blog_post.tag_ids" t-as="tag">
<a t-href="/blog/#{ slug(category) }/tag/#{ slug(tag) }" t-esc="tag.name"/> &amp;nbsp;
</t>
@@ -181,8 +181,8 @@
<h1 class="text-center" t-field="blog_post.name"/>
<p class="post-meta text-muted text-center" name="blog_post_data">
<span class="icon-calendar"> <span t-field="blog_post.create_date"/> &amp;nbsp;</span>
<span t-if="len(blog_post.message_ids) &gt; 0" class="icon-comment"> With
<span class="fa fa-calendar"> <span t-field="blog_post.create_date"/> &amp;nbsp;</span>
<span t-if="len(blog_post.message_ids) &gt; 0" class="fa fa-comment-o"> With
<a t-attf-href="#comments">
<t t-if="len(blog_post.message_ids) &lt;= 1" ><t t-esc="len(blog_post.message_ids)"/> comment</t>
<t t-if="len(blog_post.message_ids) > 1"><t t-esc="len(blog_post.message_ids)"/> comments</t>
@@ -219,7 +219,7 @@
groups="website_mail.group_comment">
<xpath expr="//ul[@id='comments-list']" position="after">
<section class="mb32">
<form id="comment" t-attf-action="/blogpost/#{blog_post.id}/#{ path_filter }/comment"
<form id="comment" t-attf-action="/blogpost/#{blog_post.id}/comment"
method="POST">
<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%%">
@@ -235,16 +235,16 @@
<!-- Options: Blog Post: hide author -->
<template id="opt_blog_post_complete_author" name="Authors"
inherit_option_id="website_blog.blog_post_complete">
<xpath expr="//span[@class='icon-calendar']" position="after">
<span class="icon-user"> By <span t-field="blog_post.create_uid"/> &amp;nbsp;</span>
<xpath expr="//span[@class*='oe_date']" position="after">
<span class="fa fa-user"> By <span t-field="blog_post.create_uid"/> &amp;nbsp;</span>
</xpath>
</template>
<!-- Options: Blog Post: show category -->
<template id="opt_blog_post_complete_category" name="Blog Category"
inherit_option_id="website_blog.blog_post_complete">
<xpath expr="//span[@class='icon-calendar']" position="after">
<span class="icon-folder-open"> In <span t-field="blog_post.category_id"/> &amp;nbsp;</span>
<xpath expr="//span[@class*='oe_date']" position="after">
<span class="fa fa-folder-open"> In <span t-field="blog_post.category_id"/> &amp;nbsp;</span>
</xpath>
</template>
@@ -253,7 +253,7 @@
inherit_option_id="website_blog.blog_post_complete" inherit_id="website_blog.blog_post_complete">
<xpath expr="//p[@name='blog_post_data']" position="after">
<p class="post-meta text-muted text-center" t-if="len(blog_post.tag_ids)">
<span class="icon-tags"/>
<span class="fa fa-tags"/>
<t t-foreach="blog_post.tag_ids" t-as="tag">
<a t-href="/blog/#{ slug(category) }/tag/#{ slug(tag) }" t-esc="tag.name"/> &amp;nbsp;
</t>
@@ -358,12 +358,12 @@
Participate on our social stream.
</p>
<h2 class="mt4">
<a t-att-href="website.social_facebook" t-if="website.social_facebook"><i class="icon-facebook-sign"/></a>
<a t-att-href="website.social_twitter" t-if="website.social_twitter"><i class="icon-twitter-sign"/></a>
<a t-att-href="website.social_linkedin" t-if="website.social_linkedin"><i class="icon-linkedin-sign"/></a>
<a t-att-href="website.social_youtube" t-if="website.social_youtube"><i class="icon-youtube-sign"/></a>
<a t-att-href="website.social_googleplus" t-if="website.social_googleplus"><i class="icon-google-plus-sign"/></a>
<a t-att-href="website.social_github" t-if="website.social_github"><i class="icon-github-sign"/></a>
<a t-att-href="website.social_facebook" t-if="website.social_facebook"><i class="fa fa-facebook-square"/></a>
<a t-att-href="website.social_twitter" t-if="website.social_twitter"><i class="fa fa-twitter"/></a>
<a t-att-href="website.social_linkedin" t-if="website.social_linkedin"><i class="fa fa-linkedin"/></a>
<a t-att-href="website.social_youtube" t-if="website.social_youtube"><i class="fa fa-youtube-play"/></a>
<a t-att-href="website.social_googleplus" t-if="website.social_googleplus"><i class="fa fa-google-plus-square"/></a>
<a t-att-href="website.social_github" t-if="website.social_github"><i class="fa fa-github"/></a>
</h2>
</section>
</xpath>
+2 -2
View File
@@ -73,8 +73,8 @@
If you have an emergency, do not hesitate to contact us by phone:
</p>
<ul class="list-unstyled">
<li><i class="icon-phone"></i> : <span t-field="res_company.phone"/></li>
<li><i class="icon-envelope"></i> : <span t-field="res_company.email"/></li>
<li><i class="fa fa-phone"></i> : <span t-field="res_company.phone"/></li>
<li><i class="fa fa-envelope"></i> : <span t-field="res_company.email"/></li>
</ul>
</div>
<div class="col-md-4">
@@ -134,10 +134,10 @@
<strong t-field="partner.name"/>
<p t-field="partner.commercial_partner_id"/>
<div t-if="partner.phone">
<span class="icon-phone"/> <span t-field="partner.phone"/>
<span class="fa fa-phone"/> <span t-field="partner.phone"/>
</div>
<div t-if="partner.email">
<span class="icon-envelope"/>
<span class="fa fa-envelope"/>
<a t-att-href="'mailto:'+partner.email">
<span t-field="partner.email"/>
</a>
@@ -17,10 +17,10 @@
<strong t-field="partner.assigned_partner_id.name"/>
<p t-field="partner.assigned_partner_id"/>
<div t-if="partner.assigned_partner_id.phone">
<span class="icon-phone"/> <span t-field="partner.assigned_partner_id.phone"/>
<span class="fa fa-phone"/> <span t-field="partner.assigned_partner_id.phone"/>
</div>
<div t-if="partner.assigned_partner_id.email">
<span class="icon-envelope"/>
<span class="fa fa-envelope"/>
<a t-att-href="'mailto:'+partner.assigned_partner_id.email">
<span t-field="partner.assigned_partner_id.email"/>
</a>
+11 -11
View File
@@ -81,13 +81,13 @@
</t>
</div>
<div>
<i class="icon-time"></i> <span t-field="event.date_begin"> </span> <i>to</i> <span t-field="event.date_end"> </span>
<i class="fa fa-clock-o"></i> <span t-field="event.date_begin"> </span> <i>to</i> <span t-field="event.date_end"> </span>
</div>
<div t-if="event.country_id">
<i class="icon-map-marker"></i> <span t-field="event.city"/>, <span t-field="event.country_id"/>
<i class="fa fa-map-marker"></i> <span t-field="event.city"/>, <span t-field="event.country_id"/>
</div>
<div class="text-muted">
<i class="icon-tag"></i> <span t-field="event.type"/>
<i class="fa fa-tag"></i> <span t-field="event.type"/>
</div>
</div>
</li>
@@ -228,11 +228,11 @@
<div class="container">
<h1 class="text-center" t-field="event.name"></h1>
<h4 class="text-center text-muted">
<i class="icon-time"></i> <span t-field="event.date_begin"/> to
<i class="fa fa-clock-o"></i> <span t-field="event.date_begin"/> to
<span t-field="event.date_end"/>
</h4>
<h4 t-if="event.city and event.country_id" class="text-center text-muted">
<i class="icon-map-marker"/>
<i class="fa fa-map-marker"/>
<span t-field="event.city"/>,
<span t-field="event.country_id"/>
</h4>
@@ -326,10 +326,10 @@
<!-- <strong t-field="event.address_id"/>
<p t-field="event.address_id"/>
<div t-if="event.address_id.phone">
<span class="icon-phone"/> <span t-field="event.address_id.phone"/>
<span class="fa fa-phone"/> <span t-field="event.address_id.phone"/>
</div>
<div t-if="event.address_id.email">
<span class="icon-envelope"/>
<span class="fa fa-envelope"/>
<a t-att-href="'mailto:'+event.address_id.email">
<span t-field="event.address_id.email"/>
</a>
@@ -343,8 +343,8 @@
<h4>When</h4>
</div>
<div class="panel-body">
<i class="icon-time"></i> <span t-field="event.date_begin"> </span><br/>
<i class="icon-time"></i> <span t-field="event.date_end"> </span>
<i class="fa fa-clock-o"></i> <span t-field="event.date_begin"> </span><br/>
<i class="fa fa-clock-o"></i> <span t-field="event.date_end"> </span>
</div>
</div>
@@ -355,10 +355,10 @@
<div class="panel-body" t-field="event.organizer_id"> <!-- TODO: use widget contact -->
<!-- <p><strong t-field="event.organizer_id.display_name"/></p>
<div t-if="event.phone">
<span class="icon-phone"/> <span t-field="event.phone"/>
<span class="fa fa-phone"/> <span t-field="event.phone"/>
</div>
<div t-if="event.email">
<i class="icon-envelope"/> <span t-field="event.email"/>
<i class="fa fa-envelope"/> <span t-field="event.email"/>
</div> -->
</div>
</div>
+3 -2
View File
@@ -36,7 +36,7 @@ class event_tag(osv.osv):
#
# Tracks: conferences
#
#
class event_track_stage(osv.osv):
_name = "event.track.stage"
@@ -74,6 +74,7 @@ class event_track(osv.osv):
'event_id': fields.many2one('event.event', 'Event', required=True),
'color': fields.integer('Color Index'),
'priority': fields.selection([('3','Low'),('2','Medium (*)'),('1','High (**)'),('0','Highest (***)')], 'Priority', required=True),
'website_published': fields.boolean('Available in the website'),
}
def set_priority(self, cr, uid, ids, priority, context={}):
return self.write(cr, uid, ids, {'priority' : priority})
@@ -141,7 +142,7 @@ class event_event(osv.osv):
#
# Sponsors
#
#
class event_sponsors_type(osv.osv):
_name = "event.sponsor.type"
@@ -6,7 +6,7 @@
<field name="name">event tracks: Public</field>
<field name="model_id" ref="website_event_track.model_event_track"/>
<field name="domain_force">[('website_published', '=', True)]</field>
<field name="groups" eval="[(4, ref('base.group_public')), (4, ref('base.group_portal'))]"/>
<field name="groups" eval="[(4, ref('base.group_public')), (4, ref('base.group_portal')), (4, ref('base.group_user'))]"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="False"/>
<field name="perm_create" eval="False"/>
@@ -1,11 +1,16 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_event_location_manager,event.track.location manager,model_event_track_location,event.group_event_user,1,1,1,1
access_event_track_manager,event.track manager,model_event_track,event.group_event_user,1,1,1,1
access_event_location_manager,event.track.location manager,model_event_track_location,event.group_event_manager,1,1,1,1
access_event_track_manager,event.track manager,model_event_track,event.group_event_manager,1,1,1,1
access_event_tag_public,event.tag public,model_event_tag,,1,0,0,0
access_event_tag_manager,event.tag manager,model_event_tag,event.group_event_user,1,1,1,1
access_event_tag_manager,event.tag manager,model_event_tag,event.group_event_manager,1,1,1,1
access_event_track_stage_public,event.track.stage public,model_event_track_stage,,1,0,0,0
access_event_track_stage_manager,event.track.stage manager,model_event_track_stage,event.group_event_user,1,1,1,1
access_event_track_stage_manager,event.track.stage manager,model_event_track_stage,event.group_event_manager,1,1,1,1
access_event_track_tag_public,event.track.tag public,model_event_track_tag,,1,0,0,0
access_event_track_tag_manager,event.track.tag manager,model_event_track_tag,event.group_event_user,1,1,1,1
access_event_track_tag_manager,event.track.tag manager,model_event_track_tag,event.group_event_manager,1,1,1,1
access_event_track_location_public,event.track.location public,model_event_track_location,,1,0,0,0
access_event_track_location_manager,event.track.location manager,model_event_track_location,event.group_event_user,1,1,1,1
access_event_track_location_manager,event.track.location manager,model_event_track_location,event.group_event_manager,1,1,1,1
access_event_track__public,event.track.public,model_event_track,,1,0,0,0
access_event_track_sponsor_type_manager,event.track.sponsor.type.public,model_event_sponsor_type,event.group_event_manager,1,1,1,1
access_event_track_sponsor_type_public,event.track.sponsor.type.public,model_event_sponsor_type,,1,0,0,0
access_event_track_sponsor_manager,event.track.sponsor.type.public,model_event_sponsor,event.group_event_manager,1,1,1,1
access_event_track_sponsor_public,event.track.sponsor.public,model_event_sponsor,,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_event_location_manager event.track.location manager model_event_track_location event.group_event_user event.group_event_manager 1 1 1 1
3 access_event_track_manager event.track manager model_event_track event.group_event_user event.group_event_manager 1 1 1 1
4 access_event_tag_public event.tag public model_event_tag 1 0 0 0
5 access_event_tag_manager event.tag manager model_event_tag event.group_event_user event.group_event_manager 1 1 1 1
6 access_event_track_stage_public event.track.stage public model_event_track_stage 1 0 0 0
7 access_event_track_stage_manager event.track.stage manager model_event_track_stage event.group_event_user event.group_event_manager 1 1 1 1
8 access_event_track_tag_public event.track.tag public model_event_track_tag 1 0 0 0
9 access_event_track_tag_manager event.track.tag manager model_event_track_tag event.group_event_user event.group_event_manager 1 1 1 1
10 access_event_track_location_public event.track.location public model_event_track_location 1 0 0 0
11 access_event_track_location_manager event.track.location manager model_event_track_location event.group_event_user event.group_event_manager 1 1 1 1
12 access_event_track__public event.track.public model_event_track 1 0 0 0
13 access_event_track_sponsor_type_manager event.track.sponsor.type.public model_event_sponsor_type event.group_event_manager 1 1 1 1
14 access_event_track_sponsor_type_public event.track.sponsor.type.public model_event_sponsor_type 1 0 0 0
15 access_event_track_sponsor_manager event.track.sponsor.type.public model_event_sponsor event.group_event_manager 1 1 1 1
16 access_event_track_sponsor_public event.track.sponsor.public model_event_sponsor 1 0 0 0
@@ -39,7 +39,7 @@ class website_hr_recruitment(http.Controller):
'jobs': jobs,
'departments': departments,
'offices': offices,
'active': department and department.id or None,
'active': department and department.id or None,
'office': office and office.id or None
})
@@ -89,11 +89,6 @@ class website_hr_recruitment(http.Controller):
'job': job_object
})
@website.route('/job/publish', type='json', auth="admin", multilang=True)
def publish(self, id, object):
res = controllers.publish(id, object)
return res
@website.route('/job/add_job_offer/', type='http', auth="user", multilang=True, methods=['POST'])
def add_job_offer(self, **kwargs):
Job = request.registry.get('hr.job')
@@ -68,14 +68,14 @@
</h3>
<div t-if="job.address_id">
<i class="icon-map-marker"/>
<i class="fa fa-map-marker"/>
<span t-field="job.address_id.city"/>
<span t-if="job.address_id.state_id" t-field="job.address_id.state_id"/>
, <span t-field="job.address_id.country_id.name"/>
<span t-if="not job.website_published" class="label label-danger">not published</span>
</div>
<div class="text-muted">
<i class="icon-time"/> <span t-field="job.write_date"/>
<i class="fa fa-clock-o"/> <span t-field="job.write_date"/>
</div>
</div>
</li>
@@ -83,18 +83,6 @@
</div>
</div>
</div>
<div class="oe_structure">
<section data-snippet-id="cta" class="oe_dark mb32">
<div class="container">
<div class="row">
<div class="col-md-12 text-center mt16 mb16">
<a href="/job/apply" class="btn btn-primary btn-lg">Apply</a>
</div>
</div>
</div>
</section>
</div>
</div>
</t>
</template>
@@ -125,10 +113,10 @@
<div class="oe_structure" style="clear:both;">
<h1 class="text-center" t-field="job.name"/>
<h5 class="text-center">
<i class="icon-map-marker"/> <span t-field="job.address_id.city"/> <span t-if="job.address_id.state_id" t-field="job.address_id.state_id.name"/>, <span t-field="job.address_id.country_id.name"/>
<i class="fa fa-map-marker"/> <span t-field="job.address_id.city"/> <span t-if="job.address_id.state_id" t-field="job.address_id.state_id.name"/>, <span t-field="job.address_id.country_id.name"/>
</h5>
<h5 class="text-center text-muted">
<i class="icon-time"/> <span t-field="job.write_date"/>
<i class="fa fa-clock-o"/> <span t-field="job.write_date"/>
</h5>
</div>
<div t-field="job.website_description"/>
@@ -257,7 +245,7 @@
<t t-foreach="offices" t-as="thisoffice">
<li t-att-class="thisoffice.id == office and 'active' or ''">
<a t-href="/jobs/office/#{ slug(thisoffice) }/" >
<span t-field="thisoffice.city"/><t t-if="thisoffice.country_id">,
<span t-field="thisoffice.city"/><t t-if="thisoffice.country_id">,
<span t-field="thisoffice.country_id.name"/>
</t>
</a>
@@ -36,7 +36,7 @@
</span>
</div>
<small>
<i class="icon-time"></i> <span t-field="object_id.date_start"/><br/>
<i class="fa fa-clock-o"></i> <span t-field="object_id.date_start"/><br/>
<t t-if="object_id.date_end">Ending Date: <span t-field="object_id.date_end"/></t>
</small>
</div>
+49 -27
View File
@@ -288,26 +288,33 @@ class Ecommerce(http.Controller):
request.context = dict(request.context, pricelist=self.get_pricelist())
quantity = 0
# set order_line_id and product_id
if order_line_id:
order_line = order_line_obj.browse(request.cr, SUPERUSER_ID, order_line_id, context=request.context)
if order_line.order_id.id == order.id:
product_id = order_line.product_id.id
else:
order_line_id = None
else:
order_line_ids = order_line_obj.search(request.cr, SUPERUSER_ID,
[('order_id', '=', order.id),('product_id', '=', product_id)], context=request.context)
if order_line_ids:
order_line_id = order_line_ids[0]
if not order_line_id and not product_id:
return 0
# values initialisation
quantity = 0
values = {}
domain = [('order_id', '=', order.id)]
if order_line_id:
domain += [('id', '=', order_line_id)]
else:
domain += [('product_id', '=', product_id)]
order_line_ids = order_line_obj.search(request.cr, SUPERUSER_ID, domain, context=request.context)
if order_line_ids:
order_line = order_line_obj.read(request.cr, SUPERUSER_ID, order_line_ids, [], context=request.context)[0]
order_line_val = order_line_obj.read(request.cr, SUPERUSER_ID, [order_line_id], [], context=request.context)[0]
if not product_id:
product_id = order_line['product_id'][0]
product_id = order_line_val['product_id'][0]
if set_number >= 0:
quantity = set_number
else:
quantity = order_line['product_uom_qty'] + number
quantity = order_line_val['product_uom_qty'] + number
if quantity < 0:
quantity = 0
else:
@@ -316,17 +323,17 @@ class Ecommerce(http.Controller):
quantity = 1
# change and record value
vals = order_line_obj._recalculate_product_values(request.cr, request.uid, order_line_ids, product_id, context=request.context)
vals = order_line_obj._recalculate_product_values(request.cr, request.uid, [order_line_id], product_id, context=request.context)
values.update(vals)
values['product_uom_qty'] = quantity
values['product_id'] = product_id
values['order_id'] = order.id
if order_line_ids:
order_line_obj.write(request.cr, SUPERUSER_ID, order_line_ids, values, context=request.context)
if order_line_id:
order_line_obj.write(request.cr, SUPERUSER_ID, [order_line_id], values, context=request.context)
if not quantity:
order_line_obj.unlink(request.cr, SUPERUSER_ID, order_line_ids, context=request.context)
order_line_obj.unlink(request.cr, SUPERUSER_ID, [order_line_id], context=request.context)
else:
order_line_id = order_line_obj.create(request.cr, SUPERUSER_ID, values, context=request.context)
order_obj.write(request.cr, SUPERUSER_ID, [order.id], {'order_line': [(4, order_line_id)]}, context=request.context)
@@ -338,7 +345,7 @@ class Ecommerce(http.Controller):
prod_obj = request.registry.get('product.product')
# must have a draft sale order with lines at this point, otherwise reset
order = context.get('website_sale_order')
order = request.registry['website'].get_current_order(request.cr, request.uid, context=request.context)
if order and order.state != 'draft':
request.registry['website'].sale_reset_order(cr, uid, context=context)
return request.redirect('/shop/')
@@ -367,9 +374,14 @@ class Ecommerce(http.Controller):
}
return request.website.render("website_sale.mycart", values)
@website.route(['/shop/add_cart/'], type='http', auth="public", multilang=True)
def add_cart(self, product_id=None, order_line_id=None, remove=None, **kw):
self.add_product_to_cart(product_id=product_id and int(product_id), order_line_id=order_line_id and int(order_line_id), number=(remove and -1 or 1))
@website.route(['/shop/add_cart/', '/shop/add_cart/<model("product.product"):product>/'], type='http', auth="public", multilang=True, methods=['POST'])
def add_cart(self, product=None, product_id=None, remove=None, **kw):
self.add_product_to_cart(product_id=int(product_id or product.id))
return request.redirect("/shop/mycart/")
@website.route(['/shop/change_cart/<model("sale.order.line"):order_line>/'], type='http', auth="public", multilang=True)
def add_cart_order_line(self, order_line=None, remove=None, **kw):
self.add_product_to_cart(order_line_id=int(order_line.id), number=(remove and -1 or 1))
return request.redirect("/shop/mycart/")
@website.route(['/shop/add_cart_json/'], type='json', auth="public")
@@ -390,7 +402,7 @@ class Ecommerce(http.Controller):
cr, uid, context, registry = request.cr, request.uid, request.context, request.registry
# must have a draft sale order with lines at this point, otherwise reset
order = context.get('website_sale_order')
order = request.registry['website'].get_current_order(request.cr, request.uid, context=request.context)
if not order or order.state != 'draft' or not order.order_line:
request.registry['website'].sale_reset_order(cr, uid, context=context)
return request.redirect('/shop/')
@@ -421,14 +433,20 @@ class Ecommerce(http.Controller):
checkout = values['checkout']
error = values['error']
if not request.uid == request.registry['website'].get_public_user(cr, uid, context):
partner = None
public_id = request.registry['website'].get_public_user(cr, uid, context)
if not request.uid == public_id:
partner = orm_user.browse(cr, uid, uid, context).partner_id
elif order.partner_id and order.partner_id.id != public_id:
partner = orm_partner.browse(cr, SUPERUSER_ID, order.partner_id.id, context)
if partner:
partner_info = info.from_partner(partner)
checkout.update(partner_info)
shipping_ids = orm_partner.search(cr, uid, [("parent_id", "=", partner.id), ('type', "=", 'delivery')], context=context)
shipping_ids = orm_partner.search(cr, SUPERUSER_ID, [("parent_id", "=", partner.id), ('type', "=", 'delivery')], context=context)
if shipping_ids:
values['shipping'] = "true"
shipping_partner = orm_partner.browse(cr, uid, shipping_ids[0], context)
shipping_partner = orm_partner.browse(cr, SUPERUSER_ID, shipping_ids[0], context)
checkout['shipping_name'] = getattr(shipping_partner, 'name')
checkout['shipping_phone'] = getattr(shipping_partner, 'phone')
checkout['shipping_street'] = getattr(shipping_partner, 'street')
@@ -446,6 +464,7 @@ class Ecommerce(http.Controller):
@website.route(['/shop/confirm_order/'], type='http', auth="public", multilang=True)
def confirm_order(self, **post):
cr, uid, context, registry = request.cr, request.uid, request.context, request.registry
order_line_obj = request.registry.get('sale.order')
# must have a draft sale order with lines at this point, otherwise redirect to shop
order = request.registry['website'].get_current_order(request.cr, request.uid, context=request.context)
@@ -534,7 +553,8 @@ class Ecommerce(http.Controller):
'partner_shipping_id': shipping_id or partner_id
}
order_info.update(registry.get('sale.order').onchange_partner_id(cr, SUPERUSER_ID, [], order.partner_id.id, context=context)['value'])
order.write(order_info)
order_line_obj.write(cr, SUPERUSER_ID, [order.id], order_info, context=context)
return request.redirect("/shop/payment/")
@@ -553,7 +573,7 @@ class Ecommerce(http.Controller):
payment_obj = request.registry.get('payment.acquirer')
# if no sale order at this stage: back to checkout beginning
order = context.get('website_sale_order')
order = request.registry['website'].get_current_order(request.cr, request.uid, context=request.context)
if not order or not order.state == 'draft' or not order.order_line:
request.registry['website'].sale_reset_order(cr, uid, context=context)
return request.redirect("/shop/")
@@ -677,11 +697,13 @@ class Ecommerce(http.Controller):
if transaction_id is None:
tx = context.get('website_sale_transaction')
if not tx:
return request.redirect('/shop/')
else:
tx = request.registry['payment.transaction'].browse(cr, uid, transaction_id, context=context)
if sale_order_id is None:
order = context.get('website_sale_order')
order = request.registry['website'].get_current_order(request.cr, request.uid, context=request.context)
else:
order = request.registry['sale.order'].browse(cr, uid, sale_order_id, context=context)
+1 -2
View File
@@ -41,8 +41,7 @@ class sale_order_line(osv.Model):
if context is None:
context = {}
user_obj = self.pool.get('res.users')
product_id = product_id and int(product_id) or \
ids and self.browse(cr, uid, ids[0], context=context).product_id.id
product_id = product_id or ids and self.browse(cr, uid, ids[0], context=context).product_id.id
return self.product_id_change(
cr, SUPERUSER_ID, ids,
@@ -38,12 +38,13 @@ $(document).ready(function () {
$('.oe_website_sale a.js_add_cart_json').on('click', function (ev) {
ev.preventDefault();
var $link = $(ev.currentTarget);
var product = $link.attr("href").match(/product_id=([0-9]+)/);
var product_id = product ? +product[1] : 0;
if (!product) {
var line = $link.attr("href").match(/order_line_id=([0-9]+)/);
order_line_id = line ? +line[1] : 0;
}
var href = $link.attr("href");
var add_cart = href.match(/add_cart\/([0-9]+)/);
var product_id = add_cart && +add_cart[1] || false;
var change_cart = href.match(/change_cart\/([0-9]+)/);
var order_line_id = change_cart && +change_cart[1] || false;
openerp.jsonRpc("/shop/add_cart_json/", 'call', {
'product_id': product_id,
'order_line_id': order_line_id,
+19 -18
View File
@@ -8,7 +8,7 @@
<xpath expr="//header//ul[@id='top_menu']/li" position="before">
<li t-att-class="(not website_sale_order or not website_sale_order.get_total_quantity()) and 'hidden' or ''">
<a href="/shop/mycart/">
<i class="icon-shopping-cart"></i>
<i class="fa fa-shopping-cart"></i>
My cart <sup t-attf-class="my_cart_quantity label label-primary"
t-esc="website_sale_order and website_sale_order.get_total_quantity() or ''"/>
</a>
@@ -42,8 +42,8 @@
</template>
<template id="products_cart" name="Shopping cart">
<div class="ribbon-wrapper" contentEditable="false">
<div class="ribbon"><span contentEditable="true">Promo</span></div>
<div class="ribbon-wrapper">
<div class="ribbon">Promo</div>
</div>
<div class="oe_product_description">
<a t-href="/shop/product/#{ slug(product) }/" t-keep-query="category,search,filter_domain">
@@ -202,8 +202,8 @@
<template id="add_to_basket" inherit_option_id="website_sale.products_cart" name="Add to Cart">
<xpath expr="//div[@class='product_price']" position="inside">
<a t-href="/shop/add_cart/?product_id=#{ product.id }" class="js_add_cart_json">
<span class="icon-shopping-cart"/>
<a t-href="/shop/add_cart/#{ product.product_variant_ids[0].id }/" class="js_add_cart_json">
<span class="fa fa-shopping-cart"/>
</a>
</xpath>
</template>
@@ -268,7 +268,7 @@
</div><div class="col-sm-5 col-md-5 col-lg-4 col-lg-offset-1">
<h1 t-field="product.name">Product Name</h1>
<form action="/shop/add_cart/" class="js_add_cart_json">
<form action="/shop/add_cart/" class="js_add_cart_json" method="POST">
<input type="hidden" t-if="len(product.product_variant_ids) == 1" name="product_id" t-att-value="product.product_variant_ids[0].id"/>
<t t-if="len(product.product_variant_ids) &gt; 1">
<label label-default="label-default" class="radio" t-foreach="product.product_variant_ids" t-as="variant_id">
@@ -403,6 +403,7 @@
<div>
<a t-href="/shop/product/#{ slug(line.product_id.product_tmpl_id) }/">
<strong t-field="line.product_id.name"/>
<t t-if="line.product_id.variants">(<t t-esc="line.product_id.variants"/>)</t>
</a>
</div>
<div class="text-muted" t-field="line.product_id.description_sale"/>
@@ -422,15 +423,15 @@
<td>
<div class="input-group">
<span class="input-group-addon">
<a t-href="./add_cart/?remove=True&amp;order_line_id=#{ line.id }" class="mb8 js_add_cart_json">
<span class="icon-minus"/>
<a t-href="./change_cart/#{ line.id }/?remove=True" class="mb8 js_add_cart_json">
<i class="fa fa-minus-square"></i>
</a>
</span>
<input type="text" class="js_quantity form-control"
t-att-data-id="line.id" t-att-value="int(line.product_uom_qty)"/>
<span class="input-group-addon">
<a t-href="./add_cart/?order_line_id=#{ line.id }" class="mb8 float_left js_add_cart_json">
<span class="icon-plus"/>
<a t-href="./change_cart/#{ line.id }/" class="mb8 float_left js_add_cart_json">
<i class="fa fa-plus-square"></i>
</a>
</span>
</div>
@@ -463,8 +464,8 @@
</thead>
</table>
<div class="clearfix"/>
<a href="/shop" class="btn btn-default mb32"><span class="icon-long-arrow-left"/> Continue Shopping</a>
<a t-if="website_sale_order and website_sale_order.order_line" href="/shop/checkout/" class="btn btn-primary pull-right mb32">Process Checkout <span class="icon-long-arrow-right"/></a>
<a href="/shop" class="btn btn-default mb32"><span class="fa fa-long-arrow-left"/> Continue Shopping</a>
<a t-if="website_sale_order and website_sale_order.order_line" href="/shop/checkout/" class="btn btn-primary pull-right mb32">Process Checkout <span class="fa fa-long-arrow-right"/></a>
<div class="oe_structure"/>
</div>
<div class="col-lg-3 col-lg-offset-1 col-sm-3 text-muted" id="right_column">
@@ -590,7 +591,7 @@
}'/>
</td>
<td class="text-center">
<a t-href="./add_cart/?product_id=#{ product.id }"><strong>Add to Cart</strong></a>
<a t-href="./add_cart/#{ product.id }/"><strong>Add to Cart</strong></a>
</td>
</tr>
</tbody>
@@ -749,10 +750,10 @@
</select>
</div>
</div>
<button type="submit" class="btn btn-default btn-primary pull-right mb32">Confirm <span class="icon-long-arrow-right"/></button>
<button type="submit" class="btn btn-default btn-primary pull-right mb32">Confirm <span class="fa fa-long-arrow-right"/></button>
</div>
<div class="col-lg-offset-1 col-lg-3 text-muted">
<h3 class="page-header mt16">Your Order <small><a href="/shop/mycart"><span class="icon-arrow-right"/> change</a></small></h3>
<h3 class="page-header mt16">Your Order <small><a href="/shop/mycart"><span class="fa fa-arrow-right"/> change</a></small></h3>
<div class="row">
<div class="col-sm-6 text-right">Subtotal:</div>
<div class="col-sm-6"><span t-esc="website_sale_order.amount_untaxed" t-field-options='{
@@ -866,13 +867,13 @@
<h4>Bill To:</h4>
<div t-field="website_sale_order.partner_invoice_id"/>
<div>
<a href="/shop/checkout"><span class="icon-arrow-right"/> Change Address</a>
<a href="/shop/checkout"><span class="fa fa-arrow-right"/> Change Address</a>
</div>
<h4 class="mt32">Ship To:</h4>
<div t-field="website_sale_order.partner_shipping_id"/>
<div>
<a href="/shop/checkout"><span class="icon-arrow-right"/> Change Address</a>
<a href="/shop/checkout"><span class="fa fa-arrow-right"/> Change Address</a>
</div>
</div>
@@ -938,7 +939,7 @@
<div t-field="order.partner_shipping_id"/>
<h4 class="mt32">Amount:</h4>
<!-- <div t-field="order.amount_total" t-field-options='{
<!--<div t-field="order.amount_total" t-field-options='{
"widget": "monetary",
"display_currency": "website.pricelist_id.currency_id"
}'/> -->