Skip to content

Commit

Permalink
[FIX] The delivery note is not generated once you confirm the rental …
Browse files Browse the repository at this point in the history
…estimate
  • Loading branch information
edescalona committed Jan 10, 2025
1 parent 35f9c01 commit edfc7f3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions rental_pricelist/models/sale_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ class SaleOrderLine(models.Model):
related="display_product_id.rental",
)

@api.model_create_multi
def create(self, vals_list):
lines = super().create(vals_list)
for line in lines:
if (
line.product_uom_qty > 0
and line.order_id.type_id.id
== self.env.ref("rental_base.rental_sale_type").id
and line.rental_qty == 0
):
line.rental_qty = line.product_uom_qty

Check warning on line 36 in rental_pricelist/models/sale_order_line.py

View check run for this annotation

Codecov / codecov/patch

rental_pricelist/models/sale_order_line.py#L36

Added line #L36 was not covered by tests
return lines

@api.model
def _get_product_domain(self):
domain = [
Expand Down

0 comments on commit edfc7f3

Please sign in to comment.