- This has been modifiedcreated from:
+
This has been modifiedcreated from:
,
@@ -74,11 +74,11 @@
Dear ,
- You have been assigned to the .
+ You have been assigned to the .
- View
+ View
diff --git a/addons/payment_authorize/models/authorize_request.py b/addons/payment_authorize/models/authorize_request.py
index 109cf455f6d..aab1b66e882 100644
--- a/addons/payment_authorize/models/authorize_request.py
+++ b/addons/payment_authorize/models/authorize_request.py
@@ -224,7 +224,7 @@ class AuthorizeAPI():
etree.SubElement(customer, "email").text = partner.email or ''
response = self._authorize_request(root)
res = dict()
- if not response.find('customerProfileId'):
+ if response.find('customerProfileId') is None: # Warning: do not use bool(etree) as the semantics is very misleading
_logger.warning(
'Unable to create customer payment profile, data missing from transaction. Transaction_id: %s - Partner_id: %s'
% (transaction_id, partner)
diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py
index 757cdad9cad..be81439da3e 100644
--- a/addons/sale/models/sale.py
+++ b/addons/sale/models/sale.py
@@ -829,7 +829,8 @@ class SaleOrderLine(models.Model):
for line in self:
fpos = line.order_id.fiscal_position_id or line.order_id.partner_id.property_account_position_id
# If company_id is set, always filter taxes by the company
- taxes = line.product_id.taxes_id.filtered(lambda r: not line.company_id or r.company_id == line.company_id)
+ line_company_id = line.company_id or line.order_id.company_id
+ taxes = line.product_id.taxes_id.filtered(lambda r: not line_company_id or r.company_id == line_company_id)
line.tax_id = fpos.map_tax(taxes, line.product_id, line.order_id.partner_shipping_id) if fpos else taxes
@api.model
diff --git a/addons/sale/tests/test_sale_order.py b/addons/sale/tests/test_sale_order.py
index a68c992438b..1f7f2568824 100644
--- a/addons/sale/tests/test_sale_order.py
+++ b/addons/sale/tests/test_sale_order.py
@@ -196,3 +196,56 @@ class TestSaleOrder(TestCommonSaleNoChart):
sol = so.order_line.filtered(lambda l: l.product_id == serv_cost)
self.assertTrue(sol, 'Sale: cost invoicing does not add lines when confirming vendor invoice')
self.assertEquals((sol.price_unit, sol.qty_delivered, sol.product_uom_qty, sol.qty_invoiced), (160, 2, 0, 0), 'Sale: line is wrong after confirming vendor invoice')
+
+ def test_so_create_multicompany(self):
+ # Preparing test Data
+ user_demo = self.env.ref('base.user_demo')
+ company_1 = self.env.ref('base.main_company')
+ company_2 = self.env['res.company'].create({
+ 'name': 'company 2',
+ 'parent_id': company_1.id,
+ })
+ user_demo.write({
+ 'groups_id': [(4, self.env.ref('sales_team.group_sale_manager').id, False)],
+ 'company_ids': [(6, False, [company_1.id])],
+ 'company_id': company_1.id,
+ })
+
+ so_partner = self.env.ref('base.res_partner_2')
+ so_partner.write({
+ 'property_account_position_id': False,
+ })
+
+ tax_company_1 = self.env['account.tax'].create({
+ 'name': 'T1',
+ 'amount': 90,
+ 'company_id': company_1.id,
+ })
+
+ tax_company_2 = self.env['account.tax'].create({
+ 'name': 'T2',
+ 'amount': 90,
+ 'company_id': company_2.id,
+ })
+
+ product_shared = self.env['product.template'].create({
+ 'name': 'shared product',
+ 'taxes_id': [(6, False, [tax_company_1.id, tax_company_2.id])],
+ })
+
+ # Use case
+ so_1 = self.env['sale.order'].sudo(user_demo.id).create({
+ 'partner_id': so_partner.id,
+ 'company_id': company_1.id,
+ })
+ so_1.invalidate_cache()
+
+ # This is what is done when importing the csv lines (on sale.order):
+ # id,order_line/product_id
+ # __export__.sale_order_37_1bb960ba,Product name
+ so_1.write({
+ 'order_line': [(0, False, {'product_id': product_shared.product_variant_id.id, 'order_id': so_1.id})],
+ })
+
+ self.assertEqual(set(so_1.order_line.tax_id.ids), set([tax_company_1.id]),
+ 'Only taxes from the right company are put by default')
diff --git a/addons/stock/security/stock_security.xml b/addons/stock/security/stock_security.xml
index 5a61d942114..17cabddd7eb 100644
--- a/addons/stock/security/stock_security.xml
+++ b/addons/stock/security/stock_security.xml
@@ -89,7 +89,7 @@
stock_move multi-company
- ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
+ ['|','|',('company_id','=',False),('company_id','child_of',[user.company_id.id]),('location_dest_id.company_id', '=', False)]
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py
index cc162d57ded..d9013324197 100644
--- a/addons/web/controllers/main.py
+++ b/addons/web/controllers/main.py
@@ -196,11 +196,11 @@ def concat_xml(file_list):
:param list(str) file_list: list of files to check
:returns: (concatenation_result, checksum)
- :rtype: (str, str)
+ :rtype: (bytes, str)
"""
checksum = hashlib.new('sha1')
if not file_list:
- return '', checksum.hexdigest()
+ return b'', checksum.hexdigest()
root = None
for fname in file_list:
diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js
index 9413f09041f..917d654aa7d 100644
--- a/addons/web/static/src/js/views/basic/basic_model.js
+++ b/addons/web/static/src/js/views/basic/basic_model.js
@@ -737,6 +737,7 @@ var BasicModel = AbstractModel.extend({
});
_.each(fields, function (field) {
var dataPoint;
+ record.data[field.name] = null;
if (field.type === 'many2one') {
if (field.value) {
var id = _.isArray(field.value) ? field.value[0] : field.value;
diff --git a/addons/website/static/src/js/content/website_root.js b/addons/website/static/src/js/content/website_root.js
index 336ea822902..77d6573c862 100644
--- a/addons/website/static/src/js/content/website_root.js
+++ b/addons/website/static/src/js/content/website_root.js
@@ -170,10 +170,13 @@ var WebsiteRoot = BodyManager.extend({
* @private
* @param {jQuery} [$stopTarget]
* only stop the animations linked to the given element(s)
+ * its descendants
*/
_stopAnimations: function ($stopTarget) {
var removedAnimations = _.map(this.animations, function (animation) {
- if (!$stopTarget || $stopTarget.filter(animation.el).length) {
+ if (!$stopTarget
+ || $stopTarget.filter(animation.el).length
+ || $stopTarget.find(animation.el).length) {
animation.destroy();
return animation;
}
diff --git a/addons/website_sale_wishlist/static/src/js/website_sale_wishlist.js b/addons/website_sale_wishlist/static/src/js/website_sale_wishlist.js
index a5dbda94698..44e184144af 100644
--- a/addons/website_sale_wishlist/static/src/js/website_sale_wishlist.js
+++ b/addons/website_sale_wishlist/static/src/js/website_sale_wishlist.js
@@ -69,7 +69,7 @@ var ProductWishlist = Widget.extend({
$('input.js_product_change:checked').first().trigger('change');
}
else {
- $('input.js_variant_change').trigger('change');
+ $('input.js_variant_change:checked').first().trigger('change');
}
});
diff --git a/doc/cla/individual/anhvu-sg.md b/doc/cla/individual/anhvu-sg.md
new file mode 100644
index 00000000000..125880cbcd7
--- /dev/null
+++ b/doc/cla/individual/anhvu-sg.md
@@ -0,0 +1,11 @@
+Vietnam, 2019-07-27
+
+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,
+
+Anh Vu https://github.com/anhvu-sg
diff --git a/doc/cla/individual/stfnndrsn.md b/doc/cla/individual/stfnndrsn.md
new file mode 100644
index 00000000000..021aec0aca8
--- /dev/null
+++ b/doc/cla/individual/stfnndrsn.md
@@ -0,0 +1,11 @@
+Denmark, 2019-07-24
+
+ 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,
+
+ Stefan Andersen https://github.com/stfnndrsn