Skip to content

Commit

Permalink
[MIG] sale_start_end_dates: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vancouver29 committed Jan 11, 2023
1 parent 4bc23aa commit 556ac39
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sale_start_end_dates/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{
"name": "Sale Start End Dates",
"version": "15.0.1.0.1",
"version": "16.0.1.0.0",
"category": "Sales",
"license": "AGPL-3",
"summary": "Adds start date and end date on sale order lines",
Expand Down
4 changes: 0 additions & 4 deletions sale_start_end_dates/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,8 @@ def start_end_dates_product_id_change(self):
if self.product_id.must_have_dates:
if self.order_id.default_start_date:
self.start_date = self.order_id.default_start_date
else:
self.start_date = False
if self.order_id.default_end_date:
self.end_date = self.order_id.default_end_date
else:
self.end_date = False
else:
self.start_date = False
self.end_date = False
8 changes: 8 additions & 0 deletions sale_start_end_dates/tests/test_sale_start_end_dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def test_start_end_dates_product_id_change(self):
self.so.order_line.start_end_dates_product_id_change()
self.so.order_line.start_date_change()
self.so.order_line.end_date_change()
self.product_id.must_have_dates = False
self.so.order_line.start_end_dates_product_id_change()

def test_start_end_dates_product_id(self):
self.product_id.must_have_dates = False
Expand Down Expand Up @@ -112,3 +114,9 @@ def test_inverse_number_of_days(self):
self.assertEqual(
self.so.order_line[0].start_date, self.so.order_line[0].end_date
)
self.so.order_line[0].number_of_days = -1
self.assertEqual(self.so.order_line[0].number_of_days, 1)

def test_prepare_invoice_line(self):
invoice_line_vals = self.so.order_line._prepare_invoice_line()
self.assertEqual(invoice_line_vals["product_id"], self.product_id.id)

0 comments on commit 556ac39

Please sign in to comment.