@@ -109,11 +114,6 @@
-
-
-
-
-
diff --git a/addons/purchase_requisition/models/purchase_requisition.py b/addons/purchase_requisition/models/purchase_requisition.py
index 03196f5d9f8..85e9b6238ca 100644
--- a/addons/purchase_requisition/models/purchase_requisition.py
+++ b/addons/purchase_requisition/models/purchase_requisition.py
@@ -119,7 +119,7 @@ class PurchaseRequisition(models.Model):
def action_in_progress(self):
self.ensure_one()
if not all(obj.line_ids for obj in self):
- raise UserError(_('You cannot confirm agreement because there is no product line.'))
+ raise UserError(_("You cannot confirm agreement '%s' because there is no product line.") % self.name)
if self.type_id.quantity_copy == 'none' and self.vendor_id:
for requisition_line in self.line_ids:
if requisition_line.price_unit <= 0.0:
diff --git a/addons/purchase_stock/models/stock.py b/addons/purchase_stock/models/stock.py
index b3d336ceddc..5d4271f603f 100644
--- a/addons/purchase_stock/models/stock.py
+++ b/addons/purchase_stock/models/stock.py
@@ -78,6 +78,10 @@ class StockMove(models.Model):
vals['purchase_line_id'] = self.purchase_line_id.id
return vals
+ def _clean_merged(self):
+ super(StockMove, self)._clean_merged()
+ self.write({'created_purchase_line_id': False})
+
def _action_done(self):
res = super(StockMove, self)._action_done()
self.mapped('purchase_line_id').sudo()._update_received_qty()
diff --git a/addons/sale_stock/tests/test_sale_stock.py b/addons/sale_stock/tests/test_sale_stock.py
index 0d35dc00190..f16565d27d9 100644
--- a/addons/sale_stock/tests/test_sale_stock.py
+++ b/addons/sale_stock/tests/test_sale_stock.py
@@ -173,14 +173,14 @@ class TestSaleStock(TestSale):
# Check invoice
self.assertEqual(self.so.invoice_status, 'to invoice', 'Sale Stock: so invoice_status should be "to invoice" instead of "%s" after picking return' % self.so.invoice_status)
- self.assertAlmostEqual(self.so.order_line[0].qty_delivered, 3.0, 'Sale Stock: delivered quantity should be 3.0 instead of "%s" after picking return' % self.so.order_line[0].qty_delivered)
+ self.assertAlmostEqual(self.so.order_line[0].qty_delivered, 3.0, msg='Sale Stock: delivered quantity should be 3.0 instead of "%s" after picking return' % self.so.order_line[0].qty_delivered)
# let's do an invoice with refunds
adv_wiz = self.env['sale.advance.payment.inv'].with_context(active_ids=[self.so.id]).create({
'advance_payment_method': 'all',
})
adv_wiz.with_context(open_invoices=True).create_invoices()
self.inv_2 = self.so.invoice_ids.filtered(lambda r: r.state == 'draft')
- self.assertAlmostEqual(self.inv_2.invoice_line_ids[0].quantity, 2.0, 'Sale Stock: refund quantity on the invoice should be 2.0 instead of "%s".' % self.inv_2.invoice_line_ids[0].quantity)
+ self.assertAlmostEqual(self.inv_2.invoice_line_ids[0].quantity, 2.0, msg='Sale Stock: refund quantity on the invoice should be 2.0 instead of "%s".' % self.inv_2.invoice_line_ids[0].quantity)
self.assertEqual(self.so.invoice_status, 'no', 'Sale Stock: so invoice_status should be "no" instead of "%s" after invoicing the return' % self.so.invoice_status)
def test_03_sale_stock_delivery_partial(self):
diff --git a/addons/stock/models/procurement.py b/addons/stock/models/procurement.py
index fd08b362949..64929fa0084 100644
--- a/addons/stock/models/procurement.py
+++ b/addons/stock/models/procurement.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from collections import defaultdict
+from collections import OrderedDict
from datetime import datetime
from dateutil.relativedelta import relativedelta
from odoo.tools.misc import split_every
@@ -318,9 +318,18 @@ class ProcurementGroup(models.Model):
orderpoints_noprefetch = orderpoints_noprefetch[1000:]
# Calculate groups that can be executed together
- location_data = defaultdict(lambda: dict(products=self.env['product.product'], orderpoints=self.env['stock.warehouse.orderpoint'], groups=list()))
+ location_data = OrderedDict()
+
+ def makedefault():
+ return {
+ 'products': self.env['product.product'],
+ 'orderpoints': self.env['stock.warehouse.orderpoint'],
+ 'groups': []
+ }
+
for orderpoint in orderpoints:
key = self._procurement_from_orderpoint_get_grouping_key([orderpoint.id])
+ location_data[key] = makedefault()
location_data[key]['products'] += orderpoint.product_id
location_data[key]['orderpoints'] += orderpoint
location_data[key]['groups'] = self._procurement_from_orderpoint_get_groups([orderpoint.id])
diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py
index dbc6b131d49..43d9785d1a1 100644
--- a/addons/stock/models/stock_move.py
+++ b/addons/stock/models/stock_move.py
@@ -565,6 +565,10 @@ class StockMove(models.Model):
move.package_level_id.id
]
+ def _clean_merged(self):
+ """Cleanup hook used when merging moves"""
+ self.write({'propagate': False})
+
def _merge_moves(self, merge_into=False):
""" This method will, for each move in `self`, go up in their linked picking and try to
find in their existing moves a candidate into which we can merge the move.
@@ -602,7 +606,7 @@ class StockMove(models.Model):
if moves_to_unlink:
# We are using propagate to False in order to not cancel destination moves merged in moves[0]
- moves_to_unlink.write({'propagate': False})
+ moves_to_unlink._clean_merged()
moves_to_unlink._action_cancel()
moves_to_unlink.sudo().unlink()
return (self | self.env['stock.move'].concat(*moves_to_merge)) - moves_to_unlink
diff --git a/addons/web/static/src/js/views/kanban/kanban_column_progressbar.js b/addons/web/static/src/js/views/kanban/kanban_column_progressbar.js
index b597ccf1c60..7e1f16c9fb0 100644
--- a/addons/web/static/src/js/views/kanban/kanban_column_progressbar.js
+++ b/addons/web/static/src/js/views/kanban/kanban_column_progressbar.js
@@ -142,6 +142,7 @@ var KanbanColumnProgressBar = Widget.extend({
// Display and animate the progress bars
var barNumber = 0;
+ var barMinWidth = 6; // In %
_.each(self.colors, function (val, key) {
var $bar = self.$bars[val];
var count = self.subgroupCounts && self.subgroupCounts[key] || 0;
@@ -168,16 +169,15 @@ var KanbanColumnProgressBar = Widget.extend({
$bar.addClass('o_bar_has_records');
// Make sure every bar that has records has some space
// and that everything adds up to 100%
- var minWidth = 6*barNumber;
- var maxWidth = 100 - minWidth;
+ var maxWidth = 100 - barMinWidth * barNumber;
self.$('.progress-bar.o_bar_has_records').css('max-width', maxWidth + '%');
- self.$('.progress-bar.o_bar_has_records').css('min-width', minWidth + '%');
$bar.css('width', (count * 100 / self.groupCount) + '%');
barNumber++;
} else {
$bar.css('width', '');
}
});
+ this.$('.progress-bar.o_bar_has_records').css('min-width', barMinWidth + '%');
// Display and animate the counter number
var start = this.prevTotalCounterValue;
diff --git a/addons/web/static/src/js/views/pivot/pivot_model.js b/addons/web/static/src/js/views/pivot/pivot_model.js
index b45f7a9ffdf..54f469bbc19 100644
--- a/addons/web/static/src/js/views/pivot/pivot_model.js
+++ b/addons/web/static/src/js/views/pivot/pivot_model.js
@@ -541,7 +541,7 @@ var PivotModel = AbstractModel.extend({
_loadData: function () {
var self = this;
var groupBys = [];
- var rowGroupBys = this.data.groupedBy.length ? this.data.groupedBy : this.initialRowGroupBys;
+ var rowGroupBys = !_.isEmpty(this.data.groupedBy) ? this.data.groupedBy : this.initialRowGroupBys;
var colGroupBys = this.data.colGroupBys;
var measures = _.map(this.data.measures, function(measure) {
if (self.fields[measure].type === 'many2one') {
@@ -624,7 +624,7 @@ var PivotModel = AbstractModel.extend({
});
var index = 0;
- var rowGroupBys = this.data.groupedBy.length ? this.data.groupedBy : this.initialRowGroupBys;
+ var rowGroupBys = !_.isEmpty(this.data.groupedBy) ? this.data.groupedBy : this.initialRowGroupBys;
var colGroupBys = this.data.colGroupBys;
var datapt, row, col, attrs, cell_value;
var main_row_header, main_col_header;
diff --git a/addons/website_sale_digital/controllers/main.py b/addons/website_sale_digital/controllers/main.py
index c53f27d7336..39d0492260a 100644
--- a/addons/website_sale_digital/controllers/main.py
+++ b/addons/website_sale_digital/controllers/main.py
@@ -44,7 +44,7 @@ class WebsiteSaleDigital(CustomerPortal):
product_id = product.id
template = product.product_tmpl_id
att = Attachment.search_read(
- domain=['|', '&', ('res_model', '=', product._name), ('res_id', '=', product_id), '&', ('res_model', '=', template._name), '&', ('res_id', '=', template.id), ('product_downloadable', '=', True)],
+ domain=['|', '&', ('res_model', '=', product._name), ('res_id', '=', product_id), '&', ('res_model', '=', template._name), ('res_id', '=', template.id), ('product_downloadable', '=', True)],
fields=['name', 'write_date'],
order='write_date desc',
)
diff --git a/doc/cla/corporate/international-business-hub.md b/doc/cla/corporate/international-business-hub.md
new file mode 100644
index 00000000000..b2989af2cc2
--- /dev/null
+++ b/doc/cla/corporate/international-business-hub.md
@@ -0,0 +1,17 @@
+Switzerland, 2018-07-31
+
+International Business Hub agrees to the terms of the Odoo Corporate Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+Sandro Pignataro pignatarosandro@gmail.com https://github.com/Pigna74
+
+List of contributors:
+
+Guido Notari guido.notari@gmail.com https://github.com/gnotari
+Matteo Bilotta byloth@gmail.com https://github.com/Byloth
+
diff --git a/odoo/service/db.py b/odoo/service/db.py
index 8f3c24d7d8a..95723f36690 100644
--- a/odoo/service/db.py
+++ b/odoo/service/db.py
@@ -71,7 +71,10 @@ def _initialize_db(id, db_name, demo, lang, user_password, login='admin', countr
if country_code:
countries = env['res.country'].search([('code', 'ilike', country_code)])
if countries:
- env['res.company'].browse(1).country_id = countries[0]
+ comp_local = {'country_id': countries[0].id}
+ if countries[0].currency_id:
+ comp_local['currency_id'] = countries[0].currency_id.id
+ env['res.company'].browse(1).write(comp_local)
# update admin's password and lang and login
values = {'password': user_password, 'lang': lang}