diff --git a/addons/delivery/tests/test_delivery_cost.py b/addons/delivery/tests/test_delivery_cost.py index d60980419b8..615704fba83 100644 --- a/addons/delivery/tests/test_delivery_cost.py +++ b/addons/delivery/tests/test_delivery_cost.py @@ -44,9 +44,11 @@ class TestDeliveryCost(common.TransactionCase): self.free_delivery = self.env.ref('delivery.free_delivery_carrier') # as the tests hereunder assume all the prices in USD, we must ensure # that the company actually uses USD + # We do an invalidate_cache so the cache is aware of it too. self.env.cr.execute( "UPDATE res_company SET currency_id = %s WHERE id = %s", [self.env.ref('base.USD').id, self.env.company.id]) + self.env.company.invalidate_cache() self.pricelist.currency_id = self.env.ref('base.USD').id def test_00_delivery_cost(self): @@ -102,8 +104,9 @@ class TestDeliveryCost(common.TransactionCase): ('product_id', '=', self.normal_delivery.product_id.id)]) self.assertEqual(len(line), 1, "Delivery cost is not Added") + zin = str(delivery_wizard.display_price) + " " + str(delivery_wizard.delivery_price) + ' ' + line.company_id.country_id.code + line.company_id.name self.assertEqual(float_compare(line.price_subtotal, 10.0, precision_digits=2), 0, - "Delivery cost is not correspond.") + "Delivery cost does not correspond to 10.0. %s %s" % (line.price_subtotal, zin)) # I confirm the sales order diff --git a/addons/l10n_it_stock_ddt/__init__.py b/addons/l10n_it_stock_ddt/__init__.py index b75ff7a4d27..580f3112ecd 100644 --- a/addons/l10n_it_stock_ddt/__init__.py +++ b/addons/l10n_it_stock_ddt/__init__.py @@ -14,4 +14,4 @@ def _create_picking_seq(cr, registry): 'prefix': wh.code + '/' + ptype.sequence_code + '/DDT', 'padding': 5, 'company_id': wh.company_id.id, 'implementation': 'no_gap', - }).id \ No newline at end of file + }).id diff --git a/addons/l10n_it_stock_ddt/models/__init__.py b/addons/l10n_it_stock_ddt/models/__init__.py index 08842da1093..f346087e6fb 100644 --- a/addons/l10n_it_stock_ddt/models/__init__.py +++ b/addons/l10n_it_stock_ddt/models/__init__.py @@ -2,4 +2,4 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import stock_picking -from . import account_invoice \ No newline at end of file +from . import account_invoice diff --git a/addons/l10n_it_stock_ddt/models/stock_picking.py b/addons/l10n_it_stock_ddt/models/stock_picking.py index 439d5c9f245..0dede776162 100644 --- a/addons/l10n_it_stock_ddt/models/stock_picking.py +++ b/addons/l10n_it_stock_ddt/models/stock_picking.py @@ -68,4 +68,4 @@ class StockPickingType(models.Model): 'name': ir_seq_name, 'prefix': ir_seq_prefix, }) - return super(StockPickingType, self).write(vals) \ No newline at end of file + return super(StockPickingType, self).write(vals)