Skip to content

Commit

Permalink
[FIX] pylint error
Browse files Browse the repository at this point in the history
  • Loading branch information
ajay-odoogap authored and Ajay Javiya committed Dec 17, 2024
1 parent 640c0b5 commit 39796dd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions sale_sourced_by_line/model/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ class SaleOrder(models.Model):
class SaleOrderLine(models.Model):
_inherit = "sale.order.line"

@api.depends('route_id', 'order_id.warehouse_id', 'product_packaging_id', 'product_id')
@api.depends(
"route_id", "order_id.warehouse_id", "product_packaging_id", "product_id"
)
def _compute_warehouse_id(self):
""" compute the warehouse for the lines only
if it has not already been set. """
lines = self.filtered(lambda rec:not rec.warehouse_id)
super(SaleOrderLine, lines)._compute_warehouse_id()
"""compute the warehouse for the lines only
if it has not already been set."""
lines = self.filtered(lambda rec: not rec.warehouse_id)
return super(SaleOrderLine, lines)._compute_warehouse_id()

def _prepare_procurement_group_vals(self):
vals = super()._prepare_procurement_group_vals()
Expand Down
4 changes: 2 additions & 2 deletions sale_sourced_by_line/tests/test_sale_sourced_by_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_sales_order_multi_source(self):
self.assertEqual(
len(so.picking_ids),
2,
"2 delivery orders expected. Got %s instead" % len(so.picking_ids),
f"2 delivery orders expected. Got {len(so.picking_ids)} instead",
)
for line in so.order_line:
self.assertEqual(
Expand Down Expand Up @@ -96,7 +96,7 @@ def test_sales_order_no_source(self):
self.assertEqual(
len(so.picking_ids),
1,
"1 delivery order expected. Got %s instead" % len(so.picking_ids),
f"1 delivery order expected. Got {len(so.picking_ids)} instead",
)

def test_sale_order_source(self):
Expand Down

0 comments on commit 39796dd

Please sign in to comment.