From c2d3bbf8404f9a503412c30241448a9208a62375 Mon Sep 17 00:00:00 2001 From: Maksym Yankin Date: Tue, 16 Nov 2021 19:17:25 +0200 Subject: [PATCH] [IMP] : black, isort, prettier --- delivery_auto_refresh/models/sale_order.py | 2 +- delivery_auto_refresh/models/stock_picking.py | 8 ++++++-- .../odoo/addons/delivery_auto_refresh | 1 + setup/delivery_auto_refresh/setup.py | 6 ++++++ 4 files changed, 14 insertions(+), 3 deletions(-) create mode 120000 setup/delivery_auto_refresh/odoo/addons/delivery_auto_refresh create mode 100644 setup/delivery_auto_refresh/setup.py diff --git a/delivery_auto_refresh/models/sale_order.py b/delivery_auto_refresh/models/sale_order.py index ddbf23e724..9377e5397d 100644 --- a/delivery_auto_refresh/models/sale_order.py +++ b/delivery_auto_refresh/models/sale_order.py @@ -64,7 +64,7 @@ def write(self, vals): def _create_delivery_line(self, carrier, price_unit): """Allow users to keep discounts to delivery lines. Unit price will - be recomputed anyway""" + be recomputed anyway""" sol = super()._create_delivery_line(carrier, price_unit) discount = self.env.context.get("delivery_discount") if discount and sol: diff --git a/delivery_auto_refresh/models/stock_picking.py b/delivery_auto_refresh/models/stock_picking.py index 0651982639..d4d34d1bff 100644 --- a/delivery_auto_refresh/models/stock_picking.py +++ b/delivery_auto_refresh/models/stock_picking.py @@ -28,7 +28,8 @@ def _add_delivery_cost_to_so(self): continue move = move_line.move_id qty = move.product_uom._compute_quantity( - move_line.qty_done, move_line.product_id.uom_id, + move_line.qty_done, + move_line.product_id.uom_id, ) weight += (move_line.product_id.weight or 0.0) * qty volume += (move_line.product_id.volume or 0.0) * qty @@ -41,6 +42,9 @@ def _add_delivery_cost_to_so(self): sale_order.date_order, ) so_line.price_unit = self.carrier_id._get_price_from_picking( - total, weight, volume, quantity, + total, + weight, + volume, + quantity, ) return res diff --git a/setup/delivery_auto_refresh/odoo/addons/delivery_auto_refresh b/setup/delivery_auto_refresh/odoo/addons/delivery_auto_refresh new file mode 120000 index 0000000000..a5d845fd1b --- /dev/null +++ b/setup/delivery_auto_refresh/odoo/addons/delivery_auto_refresh @@ -0,0 +1 @@ +../../../../delivery_auto_refresh \ No newline at end of file diff --git a/setup/delivery_auto_refresh/setup.py b/setup/delivery_auto_refresh/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/delivery_auto_refresh/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)