Skip to content

Commit

Permalink
[IMP] : black, isort, prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
yankinmax committed Nov 16, 2021
1 parent f2a967e commit c2d3bbf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion delivery_auto_refresh/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions delivery_auto_refresh/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
6 changes: 6 additions & 0 deletions setup/delivery_auto_refresh/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit c2d3bbf

Please sign in to comment.