-
+
@@ -287,4 +287,4 @@
-
\ No newline at end of file
+
diff --git a/addons/stock_account/stock_account.py b/addons/stock_account/stock_account.py
index 2e837a2c918..3033aa27ddd 100644
--- a/addons/stock_account/stock_account.py
+++ b/addons/stock_account/stock_account.py
@@ -82,13 +82,21 @@ class account_invoice(osv.osv):
cacc = accounts['expense'].id
if dacc and cacc:
price_unit = i_line._get_anglo_saxon_price_unit()
+ if inv.currency_id.id != company_currency:
+ currency_id = inv.currency_id.id
+ amount_currency = self.env['account.invoice.line']._get_price(inv, company_currency, i_line, price_unit)
+ else:
+ currency_id = False
+ amount_currency = False
return [
{
'type':'src',
'name': i_line.name[:64],
'price_unit': price_unit,
'quantity': i_line.quantity,
- 'price': self.env['account.invoice.line']._get_price(inv, company_currency, i_line, price_unit),
+ 'price': price_unit * i_line.quantity,
+ 'currency_id': currency_id,
+ 'amount_currency': amount_currency,
'account_id':dacc,
'product_id':i_line.product_id.id,
'uom_id':i_line.uom_id.id,
@@ -101,7 +109,9 @@ class account_invoice(osv.osv):
'name': i_line.name[:64],
'price_unit': price_unit,
'quantity': i_line.quantity,
- 'price': -1 * self.env['account.invoice.line']._get_price(inv, company_currency, i_line, price_unit),
+ 'price': -1 * price_unit * i_line.quantity,
+ 'currency_id': currency_id,
+ 'amount_currency': -1 * amount_currency,
'account_id':cacc,
'product_id':i_line.product_id.id,
'uom_id':i_line.uom_id.id,
diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js
index 3f17d44db0a..81b8bca7626 100644
--- a/addons/web_editor/static/src/js/widgets.js
+++ b/addons/web_editor/static/src/js/widgets.js
@@ -299,7 +299,9 @@ var ImageDialog = Widget.extend({
self.display_attachments();
});
this.fetch_existing().then(function () {
- self.set_image(_.find(self.records, function (record) { return record.url === o.url;}) || o);
+ if (o.url) {
+ self.set_image(_.find(self.records, function (record) { return record.url === o.url;}) || o);
+ }
});
return res;
},
diff --git a/addons/website/models/ir_http.py b/addons/website/models/ir_http.py
index 3b18d6e2138..dac8468fb3c 100644
--- a/addons/website/models/ir_http.py
+++ b/addons/website/models/ir_http.py
@@ -345,7 +345,8 @@ class PageConverter(werkzeug.routing.PathConverter):
query = query and query.startswith('website.') and query[8:] or query
if query:
domain += [('key', 'like', query)]
- domain += ['|', ('website_id', '=', request.website.id), ('website_id', '=', False)]
+ website_id = request.context.get('website_id') or request.registry['website'].search(cr, uid, [], limit=1)[0]
+ domain += ['|', ('website_id', '=', website_id), ('website_id', '=', False)]
views = View.search_read(cr, uid, domain, fields=['key', 'priority', 'write_date'], order='name', context=context)
for view in views:
diff --git a/addons/website/models/website.py b/addons/website/models/website.py
index e74a56b2f7b..efe9a0d90ff 100644
--- a/addons/website/models/website.py
+++ b/addons/website/models/website.py
@@ -522,6 +522,7 @@ class website(osv.osv):
of the same.
:rtype: list({name: str, url: str})
"""
+ request.context = dict(request.context, **context)
router = request.httprequest.app.get_db_router(request.db)
# Force enumeration to be performed as public user
url_set = set()
diff --git a/addons/website_blog/views/website_blog_views.xml b/addons/website_blog/views/website_blog_views.xml
index a1a68bcbe6f..94a86e0d06e 100644
--- a/addons/website_blog/views/website_blog_views.xml
+++ b/addons/website_blog/views/website_blog_views.xml
@@ -27,6 +27,7 @@
+
diff --git a/addons/website_sale/models/sale_order.py b/addons/website_sale/models/sale_order.py
index 4df83920c48..f793c833b38 100644
--- a/addons/website_sale/models/sale_order.py
+++ b/addons/website_sale/models/sale_order.py
@@ -295,7 +295,7 @@ class Website(models.Model):
else:
salesperson_id = request.website.salesperson_id.id
addr = partner.address_get(['delivery', 'invoice'])
- sale_order = self.env['sale.order'].sudo().create({
+ so_data = {
'partner_id': partner.id,
'pricelist_id': pricelist_id,
'payment_term_id': partner.property_payment_term_id.id,
@@ -303,7 +303,12 @@ class Website(models.Model):
'partner_invoice_id': addr['invoice'],
'partner_shipping_id': addr['delivery'],
'user_id': salesperson_id or self.salesperson_id.id,
- })
+ }
+ company = self.company_id or self.env['product.pricelist'].browse(pricelist_id).sudo().company_id
+ if company:
+ so_data['company_id'] = company.id
+
+ sale_order = self.env['sale.order'].sudo().create(so_data)
# set fiscal position
if request.website.partner_id.id != partner.id:
diff --git a/addons/website_sale/static/src/js/website_sale.js b/addons/website_sale/static/src/js/website_sale.js
index aaca350d82f..094185c91da 100644
--- a/addons/website_sale/static/src/js/website_sale.js
+++ b/addons/website_sale/static/src/js/website_sale.js
@@ -263,9 +263,12 @@ $('.oe_website_sale').each(function () {
}
$(oe_website_sale).on('change', 'input.js_product_change', function () {
+ var self = this;
var $parent = $(this).closest('.js_product');
- $parent.find(".oe_default_price:first .oe_currency_value").html( price_to_str(+$(this).data('lst_price')) );
- $parent.find(".oe_price:first .oe_currency_value").html(price_to_str(+$(this).data('price')) );
+ $.when(base.ready()).then(function() {
+ $parent.find(".oe_default_price:first .oe_currency_value").html( price_to_str(+$(self).data('lst_price')) );
+ $parent.find(".oe_price:first .oe_currency_value").html(price_to_str(+$(self).data('price')) );
+ });
update_product_image(this, +$(this).val());
});
@@ -287,8 +290,10 @@ $('.oe_website_sale').each(function () {
var product_id = false;
for (var k in variant_ids) {
if (_.isEmpty(_.difference(variant_ids[k][1], values))) {
- $price.html(price_to_str(variant_ids[k][2]));
- $default_price.html(price_to_str(variant_ids[k][3]));
+ $.when(base.ready()).then(function() {
+ $price.html(price_to_str(variant_ids[k][2]));
+ $default_price.html(price_to_str(variant_ids[k][3]));
+ });
if (variant_ids[k][3]-variant_ids[k][2]>0.2) {
$default_price.closest('.oe_website_sale').addClass("discount");
$optional_price.closest('.oe_optional').show().css('text-decoration', 'line-through');
@@ -342,9 +347,12 @@ $('.oe_website_sale').each(function () {
$('input.js_variant_change, select.js_variant_change', this).first().trigger('change');
});
- var state_options = $("select[name='state_id']:visible option:not(:first)");
+ $("select[name='state_id']").each(function(){
+ $(this).data('options', $(this).find('option:not(:first)'));
+ });
$(oe_website_sale).on('change', "select[name='country_id']", function () {
- var select = $("select[name='state_id']:visible");
+ var select = $("select[name='state_id']:enabled");
+ var state_options = select.data('options');
var selected_state = select.val();
state_options.detach();
var displayed_state = state_options.filter("[data-country_id="+($(this).val() || 0)+"]");
diff --git a/addons/website_sale_options/static/src/js/website_sale.js b/addons/website_sale_options/static/src/js/website_sale.js
index e614ee8664b..bb246713e5d 100644
--- a/addons/website_sale_options/static/src/js/website_sale.js
+++ b/addons/website_sale_options/static/src/js/website_sale.js
@@ -41,7 +41,7 @@ $('.oe_website_sale #add_to_cart, .oe_website_sale #products_grid .a-submit')
data: {lang: base.get_context().lang},
success: function (quantity) {
if (!$a.hasClass('js_goto_shop')) {
- window.location.href = window.location.href.replace(/shop([\/?].*)?$/, "shop/cart");
+ window.location.pathname = window.location.pathname.replace(/shop([\/?].*)?$/, "shop/cart");
}
var $q = $(".my_cart_quantity");
$q.parent().parent().removeClass("hidden", !quantity);
diff --git a/doc/cla/corporate/camptocamp.md b/doc/cla/corporate/camptocamp.md
index 04e9fff4084..5d75bb46fa9 100644
--- a/doc/cla/corporate/camptocamp.md
+++ b/doc/cla/corporate/camptocamp.md
@@ -29,3 +29,5 @@ Ferdinand Gassauer ferdinand.gassauer@camptocamp.com https://github.com/ferdiga
Jean-Baptiste Aubort jean-baptiste.aubort@camptocamp.com
Cyril Gaudin cyril.gaudin@camptocamp.com https://github.com/cyrilgdn
Denis Leemann denis.leemann@camptocamp.com https://github.com/leemannd
+Akim Juillerat akim.juillerat@camptocamp.com https://github.com/grindtildeath
+Damien Crier damien.crier@camptocamp.com https://github.com/damdam-s
diff --git a/doc/cla/corporate/microcom.md b/doc/cla/corporate/microcom.md
index 819259990dd..ae922d84e05 100644
--- a/doc/cla/corporate/microcom.md
+++ b/doc/cla/corporate/microcom.md
@@ -16,5 +16,6 @@ List of contributors:
- Stéphane Le Cornec stephane.lecornec@gmail.com https://github.com/coleste
- Eric Lemire elemire@users.noreply.github.com https://github.com/elemire
- Martin Malorni mmalorni@gmail.com https://github.com/mmalorni
-- Gregory Savoie gs.microcom@gmail.com https://github.com/gregsavoie
+- Samuel Chamberland sc.microcom@gmail.com https://github.com/sc-microcom
- Noreddine Ben Jillali nbj.microcom@gmail.com https://github.com/nbj-microcom
+- Rim Ben Dhaou rbd.microcom@gmail.com https://github.com/rbd-microcom
diff --git a/doc/cla/individual/ceaucari.md b/doc/cla/individual/ceaucari.md
new file mode 100644
index 00000000000..949d627b86c
--- /dev/null
+++ b/doc/cla/individual/ceaucari.md
@@ -0,0 +1,11 @@
+United States, 2016-03-28
+
+I hereby agree to the terms of the Odoo Individual Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+César Castillo ceaucari@gmail.com https://github.com/ceaucari
diff --git a/doc/cla/individual/damendieta.md b/doc/cla/individual/damendieta.md
new file mode 100644
index 00000000000..b95a7052c0b
--- /dev/null
+++ b/doc/cla/individual/damendieta.md
@@ -0,0 +1,11 @@
+Ecuador, 2016-10-02
+
+I hereby agree to the terms of the Odoo Individual Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+Daniel A. Mendieta P. damendieta@gmail.com https://github.com/damendieta
diff --git a/doc/cla/individual/jaronemo.md b/doc/cla/individual/jaronemo.md
new file mode 100644
index 00000000000..3baf3ef5ca5
--- /dev/null
+++ b/doc/cla/individual/jaronemo.md
@@ -0,0 +1,11 @@
+Taiwan, 2016-08-09
+
+I hereby agree to the terms of the Odoo Individual Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+JasonWu Tingyuan Wu jaronemo@msn.com https://github.com/jaronemo
diff --git a/doc/cla/individual/javierjcf.md b/doc/cla/individual/javierjcf.md
new file mode 100644
index 00000000000..9b1a479941b
--- /dev/null
+++ b/doc/cla/individual/javierjcf.md
@@ -0,0 +1,11 @@
+Spain, 2016-04-15
+
+I hereby agree to the terms of the Odoo Individual Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+Javier Colmenero Fernández javierjcf@gmail.com https://github.com/javierjcf
diff --git a/doc/cla/individual/jclopezar.md b/doc/cla/individual/jclopezar.md
new file mode 100644
index 00000000000..577d7061759
--- /dev/null
+++ b/doc/cla/individual/jclopezar.md
@@ -0,0 +1,11 @@
+Ecuador, 2016-12-13
+
+I hereby agree to the terms of the Odoo Individual Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+Juan Cristobal Lopez Arrieta juancristobal@gmail.com https://github.com/jclopezar
diff --git a/doc/cla/individual/noureddineme.md b/doc/cla/individual/noureddineme.md
new file mode 100644
index 00000000000..3e90fcf4e2c
--- /dev/null
+++ b/doc/cla/individual/noureddineme.md
@@ -0,0 +1,11 @@
+Algeria, 2016-08-11
+
+I hereby agree to the terms of the Odoo Individual Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+Noureddine LOUAHEDJ n.louahedj@gmail.com https://github.com/noureddineme
diff --git a/doc/cla/individual/rigo1985.md b/doc/cla/individual/rigo1985.md
new file mode 100644
index 00000000000..f58ef8491de
--- /dev/null
+++ b/doc/cla/individual/rigo1985.md
@@ -0,0 +1,11 @@
+Cuba, 2016-12-01
+
+I hereby agree to the terms of the Odoo Individual Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+Rigoberto Martínez rigo1985@gmail.com https://github.com/rigo1985
diff --git a/doc/cla/individual/uynil.md b/doc/cla/individual/uynil.md
new file mode 100644
index 00000000000..0e7ac38ef9e
--- /dev/null
+++ b/doc/cla/individual/uynil.md
@@ -0,0 +1,11 @@
+China, 20160118
+
+I hereby agree to the terms of the Odoo Individual Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+LIN Yu yu_lin@me.com https://github.com/uynil