[MERGE] Sync with website-al
bzr revid: tde@openerp.com-20140123134253-z5vee6c8fmbgdyq1
This commit is contained in:
commit
bad2244494
|
@ -262,9 +262,11 @@ class res_users(osv.Model):
|
|||
# send email to users with their signup url
|
||||
template = False
|
||||
if context.get('create_user'):
|
||||
template = self.pool.get('ir.model.data').get_object(cr, uid, 'auth_signup', 'set_password_email')
|
||||
if not template.exists():
|
||||
template = False
|
||||
try:
|
||||
# get_object() raises ValueError if record does not exist
|
||||
template = self.pool.get('ir.model.data').get_object(cr, uid, 'auth_signup', 'set_password_email')
|
||||
except ValueError:
|
||||
pass
|
||||
if not bool(template):
|
||||
template = self.pool.get('ir.model.data').get_object(cr, uid, 'auth_signup', 'reset_password_email')
|
||||
assert template._name == 'email.template'
|
||||
|
@ -272,10 +274,7 @@ class res_users(osv.Model):
|
|||
for user in self.browse(cr, uid, ids, context):
|
||||
if not user.email:
|
||||
raise osv.except_osv(_("Cannot send email: user has no email address."), user.name)
|
||||
try:
|
||||
self.pool.get('email.template').send_mail(cr, uid, template.id, user.id, force_send=True, raise_exception=True, context=context)
|
||||
except Exception:
|
||||
raise
|
||||
self.pool.get('email.template').send_mail(cr, uid, template.id, user.id, force_send=True, raise_exception=True, context=context)
|
||||
|
||||
def create(self, cr, uid, values, context=None):
|
||||
if context is None:
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
<record id="free_delivery_carrier" model="delivery.carrier">
|
||||
<field name="name">Free delivery charges</field>
|
||||
<field name="normal_price">10</field>
|
||||
<field name="normal_price">0</field>
|
||||
<field name="free_if_more_than">True</field>
|
||||
<field name="amount">1000</field>
|
||||
<field name="partner_id" ref="res_partner_23"/>
|
||||
|
|
|
@ -165,7 +165,7 @@ class mail_thread(osv.AbstractModel):
|
|||
|
||||
def read_followers_data(self, cr, uid, follower_ids, context=None):
|
||||
result = []
|
||||
technical_group = self.pool.get('ir.model.data').get_object(cr, uid, 'base', 'group_no_one', context=context, check_existence_and_raise=True)
|
||||
technical_group = self.pool.get('ir.model.data').get_object(cr, uid, 'base', 'group_no_one', context=context)
|
||||
for follower in self.pool.get('res.partner').browse(cr, uid, follower_ids, context=context):
|
||||
is_editable = uid in map(lambda x: x.id, technical_group.users)
|
||||
is_uid = uid in map(lambda x: x.id, follower.user_ids)
|
||||
|
@ -500,8 +500,8 @@ class mail_thread(osv.AbstractModel):
|
|||
|
||||
posted = False
|
||||
for subtype in subtypes:
|
||||
subtype_rec = self.pool.get('ir.model.data').get_object(cr, uid, subtype.split('.')[0], subtype.split('.')[1], context=context, check_existence_and_raise=False)
|
||||
if not subtype_rec.exists():
|
||||
subtype_rec = self.pool.get('ir.model.data').get_object(cr, uid, subtype.split('.')[0], subtype.split('.')[1], context=context, check=False)
|
||||
if not (subtype_rec and subtype_rec.exists()):
|
||||
_logger.debug('subtype %s not found' % subtype)
|
||||
continue
|
||||
message = format_message(subtype_rec.description if subtype_rec.description else subtype_rec.name, tracked_values)
|
||||
|
|
|
@ -94,8 +94,8 @@ class publisher_warranty_contract(osv.osv):
|
|||
# old behavior based on res.log; now on mail.message, that is not necessarily installed
|
||||
IMD = self.pool['ir.model.data']
|
||||
user = self.pool['res.users'].browse(cr, SUPERUSER_ID, SUPERUSER_ID)
|
||||
poster = IMD.get_object(cr, SUPERUSER_ID, 'mail', 'group_all_employees', context=context, check_existence_and_raise=False)
|
||||
if not poster.exists():
|
||||
poster = IMD.get_object(cr, SUPERUSER_ID, 'mail', 'group_all_employees', context=context, check=False)
|
||||
if not (poster and poster.exists()):
|
||||
if not user.exists():
|
||||
return True
|
||||
poster = user
|
||||
|
|
|
@ -9,7 +9,7 @@ OpenERP Website CMS
|
|||
|
||||
""",
|
||||
'author': 'OpenERP SA',
|
||||
'depends': ['web', 'share', 'select2'],
|
||||
'depends': ['web', 'share', 'select2', 'mail'],
|
||||
'installable': True,
|
||||
'data': [
|
||||
'data/website_data.xml',
|
||||
|
|
|
@ -50,7 +50,7 @@ class Website(openerp.addons.web.controllers.main.Home):
|
|||
response = request.website.render(response.params['template'], values)
|
||||
return response
|
||||
|
||||
@http.route('/pagenew/<path:path>', type='http', auth="user")
|
||||
@http.route('/pagenew/<path:path>', type='http', auth="user", website=True)
|
||||
def pagenew(self, path, noredirect=NOPE):
|
||||
web = request.registry['website']
|
||||
try:
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
|
||||
<record id="menu_website" model="ir.ui.menu">
|
||||
<field name="name">Website</field>
|
||||
<field name="sequence" eval="510"/>
|
||||
<field name="sequence" eval="11"/>
|
||||
<field name="action" ref="action_website"/>
|
||||
</record>
|
||||
<record id="base.open_menu" model="ir.actions.todo">
|
||||
|
|
|
@ -150,8 +150,8 @@
|
|||
|
||||
website.error = function(data, url) {
|
||||
var $error = $(openerp.qweb.render('website.error_dialog', {
|
||||
'title': data.data ? data.data.arguments[0] : data.statusText,
|
||||
'message': data.data ? data.data.arguments[1] : "",
|
||||
'title': data.data ? data.data.arguments[0] : "",
|
||||
'message': data.data ? data.data.arguments[1] : data.statusText,
|
||||
'backend_url': url
|
||||
}));
|
||||
$error.appendTo("body");
|
||||
|
|
|
@ -342,7 +342,7 @@
|
|||
clearTimeout(overlapsCrash);
|
||||
};
|
||||
function throwError (message) {
|
||||
console.log(JSON.parse(window.localStorage.getItem("test-report")));
|
||||
console.log(window.localStorage.getItem("test-report"));
|
||||
test.reset();
|
||||
throw message;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,8 @@ class WebsiteUiSuite(unittest.TestSuite):
|
|||
self._ignore_filters = [
|
||||
# Ignore phantomjs warnings
|
||||
"*** WARNING:",
|
||||
|
||||
# Disabled because of the 'web_hello' addon
|
||||
"hello",
|
||||
# Fixes an issue with PhantomJS 1.9.2 on OS X 10.9 (Mavericks)
|
||||
# cf. https://github.com/ariya/phantomjs/issues/11418
|
||||
"CoreText performance note",
|
||||
|
|
|
@ -9,9 +9,6 @@ function waitFor (ready, callback, timeout, timeoutMessageCallback) {
|
|||
if(!condition) {
|
||||
var message = timeoutMessageCallback ? timeoutMessageCallback() : "Timeout after "+timeout+" ms";
|
||||
console.log('{ "event": "error", "message": "'+message+'" }');
|
||||
if (window.localStorage.getItem("test-report")) {
|
||||
console.log(JSON.parse(website.localStorage.getItem("test-report")));
|
||||
}
|
||||
console.log("Waiting for...\n"+ready);
|
||||
phantom.exit(1);
|
||||
} else {
|
||||
|
@ -58,9 +55,7 @@ function run (test) {
|
|||
phantom.exit(1);
|
||||
};
|
||||
page.onConsoleMessage = function(message) {
|
||||
/* Disabled because of the 'web_hello' addon */
|
||||
//console.log(message);
|
||||
//phantom.exit(1);
|
||||
console.log(message);
|
||||
};
|
||||
|
||||
page.onCallback = function(data) {
|
||||
|
|
|
@ -15,5 +15,5 @@ OpenERP Contact Form
|
|||
'views/website_crm.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'auto_install': True,
|
||||
'auto_install': False,
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
</t>
|
||||
</template>
|
||||
|
||||
<template id="detail">
|
||||
<template id="detail" name='Job Detail'>
|
||||
<t t-call="website.layout">
|
||||
<t t-set="additional_title">Job Detail</t>
|
||||
<div id="wrap" class="js_hr_recruitment">
|
||||
|
@ -115,7 +115,6 @@
|
|||
<t t-call="website.publish_management">
|
||||
<t t-set="object" t-value="job"/>
|
||||
<t t-set="publish_edit" t-value="True"/>
|
||||
<t t-set="publish_controller">/job/publish</t>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -44,5 +44,5 @@
|
|||
'static/src/xml/website_mail.xml'
|
||||
],
|
||||
'installable': True,
|
||||
'auto_install': True,
|
||||
'auto_install': False,
|
||||
}
|
||||
|
|
|
@ -14,5 +14,5 @@
|
|||
'data': [
|
||||
'views/website_payment_templates.xml',
|
||||
],
|
||||
'auto_install': True,
|
||||
'auto_install': False,
|
||||
}
|
||||
|
|
|
@ -336,6 +336,8 @@ class Ecommerce(http.Controller):
|
|||
index = random.randrange(0, len(suggested_ids))
|
||||
suggested_products.append(suggested_ids.pop(index))
|
||||
|
||||
context = dict(context or {}, pricelist=request.registry['website'].ecommerce_get_pricelist_id(cr, uid, None, context=context))
|
||||
|
||||
values = {
|
||||
'int': int,
|
||||
'suggested_products': prod_obj.browse(cr, uid, suggested_products, context),
|
||||
|
|
|
@ -158,10 +158,12 @@ class Website(orm.Model):
|
|||
|
||||
order_id = self._ecommerce_create_quotation(cr, uid, context=context)
|
||||
request.httprequest.session['ecommerce_order_id'] = order_id
|
||||
context = dict(context or {}, pricelist=self.ecommerce_get_pricelist_id(cr, uid, None, context=context))
|
||||
return SaleOrder.browse(cr, SUPERUSER_ID, order_id, context=context)
|
||||
|
||||
def ecommerce_get_current_order(self, cr, uid, context=None):
|
||||
SaleOrder = self.pool.get('sale.order')
|
||||
context = dict(context or {}, pricelist=self.ecommerce_get_pricelist_id(cr, uid, None, context=context))
|
||||
order_id = request.httprequest.session.get('ecommerce_order_id')
|
||||
if not order_id:
|
||||
request.httprequest.session['ecommerce_order_id'] = False
|
||||
|
|
|
@ -2,11 +2,11 @@ $(document).ready(function () {
|
|||
|
||||
// When choosing an acquirer, display its Pay Now button
|
||||
var $payment = $("#payment_method");
|
||||
$payment.find("input[name='acquirer']").click(function (ev) {
|
||||
var payment_id = $(ev.currentTarget).val();
|
||||
$("div.oe_sale_acquirer_button[data-id]", $payment).addClass("hidden");
|
||||
$("div.oe_sale_acquirer_button[data-id='"+payment_id+"']", $payment).removeClass("hidden");
|
||||
});
|
||||
$payment.find("input[name='acquirer']:checked").click();
|
||||
$payment.on("click", "input[name='acquirer']", function (ev) {
|
||||
var payment_id = $(ev.currentTarget).val();
|
||||
$("div.oe_sale_acquirer_button[data-id]", $payment).addClass("hidden");
|
||||
$("div.oe_sale_acquirer_button[data-id='"+payment_id+"']", $payment).removeClass("hidden");
|
||||
})
|
||||
.find("#payment_method input[name='acquirer']:checked").click();
|
||||
|
||||
});
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
import test_ui
|
||||
#TODO : fix test runing
|
||||
#import test_ui
|
|
@ -272,7 +272,7 @@
|
|||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="/shop">Products</a></li>
|
||||
<li><a href="/shop" t-keep-query="search,filters">Products</a></li>
|
||||
<li t-if="search.get('category')"><a t-href="/shop/" t-keep-query="category,search,filters"><span t-field="category.name"/></a></li>
|
||||
<li class="active"><span t-field="product.name"/></li>
|
||||
</ol>
|
||||
|
@ -945,18 +945,20 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="js_payment mb64" t-if="acquirers" id="payment_method">
|
||||
<div class="js_payment mb64 row" t-if="acquirers" id="payment_method">
|
||||
<div class="col-lg-5 col-sm-6">
|
||||
<h4>Payment Method:</h4>
|
||||
<t t-foreach="acquirers or []" t-as="acquirer">
|
||||
<label t-if="acquirer.button" class="oe_sale_acquirer_logo" style="display: block;">
|
||||
<ul class="list-unstyled">
|
||||
<li t-foreach="acquirers or []" t-as="acquirer">
|
||||
<label t-if="acquirer.button">
|
||||
<input t-att-value="acquirer.id" type="radio" name="acquirer" t-att-checked="acquirers[0] == acquirer"/>
|
||||
<img class="media-object" style="width: 60px; display: inline-block;"
|
||||
t-att-title="acquirer.name"
|
||||
t-att-src="'/payment_acquirer_%s/static/src/img/%s_icon.png' % (acquirer.name, acquirer.name)"/>
|
||||
<span t-field="acquirer.name"/>
|
||||
</label>
|
||||
</t>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-lg-3 col-sm-3">
|
||||
<t t-foreach="acquirers or []" t-as="acquirer">
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
|
||||
<xpath expr="//div[@id='payment_method']" position="before">
|
||||
<div t-if="deliveries" class="row" id="delivery_carrier">
|
||||
<h4>Choose your Delivery Method</h4>
|
||||
<div class="col-lg-5 col-sm-6">
|
||||
<h4>Choose your Delivery Method</h4>
|
||||
<ul class="list-unstyled">
|
||||
<li t-foreach="deliveries" t-as="delivery">
|
||||
<label>
|
||||
|
|
Loading…
Reference in New Issue