From 3a783118baee7526de326f4077505249fb4dd023 Mon Sep 17 00:00:00 2001 From: Maksym Yankin Date: Tue, 16 Nov 2021 20:08:12 +0200 Subject: [PATCH] [MIG] delivery_auto_refresh: Migration to 14.0 --- delivery_auto_refresh/__manifest__.py | 2 +- delivery_auto_refresh/models/sale_order.py | 2 +- delivery_auto_refresh/models/stock_picking.py | 2 +- delivery_auto_refresh/tests/test_delivery_auto_refresh.py | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/delivery_auto_refresh/__manifest__.py b/delivery_auto_refresh/__manifest__.py index b4b62fdc74..0072e38e54 100644 --- a/delivery_auto_refresh/__manifest__.py +++ b/delivery_auto_refresh/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Auto-refresh delivery", "summary": "Auto-refresh delivery price in sales orders", - "version": "13.0.1.0.2", + "version": "14.0.1.0.0", "category": "Delivery", "website": "https://github.com/OCA/delivery-carrier", "author": "Tecnativa, Odoo Community Association (OCA)", diff --git a/delivery_auto_refresh/models/sale_order.py b/delivery_auto_refresh/models/sale_order.py index 9377e5397d..60b3bab160 100644 --- a/delivery_auto_refresh/models/sale_order.py +++ b/delivery_auto_refresh/models/sale_order.py @@ -3,7 +3,7 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import api, fields, models -from odoo.tools import safe_eval +from odoo.tools.safe_eval import safe_eval class SaleOrder(models.Model): diff --git a/delivery_auto_refresh/models/stock_picking.py b/delivery_auto_refresh/models/stock_picking.py index d4d34d1bff..e9ebd9d351 100644 --- a/delivery_auto_refresh/models/stock_picking.py +++ b/delivery_auto_refresh/models/stock_picking.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import models -from odoo.tools import safe_eval +from odoo.tools.safe_eval import safe_eval class StockPicking(models.Model): diff --git a/delivery_auto_refresh/tests/test_delivery_auto_refresh.py b/delivery_auto_refresh/tests/test_delivery_auto_refresh.py index a9a6a68fe1..544301eb8e 100644 --- a/delivery_auto_refresh/tests/test_delivery_auto_refresh.py +++ b/delivery_auto_refresh/tests/test_delivery_auto_refresh.py @@ -130,7 +130,7 @@ def test_auto_refresh_picking(self): picking = self.order.picking_ids picking.action_assign() picking.move_line_ids[0].qty_done = 2 - picking.action_done() + picking._action_done() line_delivery = self.order.order_line.filtered("is_delivery") self.assertEqual(line_delivery.price_unit, 50) @@ -150,14 +150,14 @@ def test_no_auto_refresh_picking(self): picking = self.order.picking_ids picking.action_assign() picking.move_line_ids[0].qty_done = 2 - picking.action_done() + picking._action_done() line_delivery = self.order.order_line.filtered("is_delivery") self.assertEqual(line_delivery.price_unit, 60) def test_compute_carrier_id(self): order_form_1 = Form(self.env["sale.order"]) order_form_1.partner_id = self.partner - self.assertEquals(order_form_1.carrier_id, self.carrier_1) + self.assertEqual(order_form_1.carrier_id, self.carrier_1) partner_without_carrier = self.env["res.partner"].create( { "name": "Test partner without carrier", @@ -167,4 +167,4 @@ def test_compute_carrier_id(self): no_carrier = self.env["delivery.carrier"] order_form_2 = Form(self.env["sale.order"]) order_form_2.partner_id = partner_without_carrier - self.assertEquals(order_form_2.carrier_id, no_carrier) + self.assertEqual(order_form_2.carrier_id, no_carrier)