Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][FIX] sale_timesheet_invoice_description: Fix tests according to qty_delivered compute change since #1458

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,13 @@ def test_three_timesheets_same_date_split(self):

# Add a new timesheets with the same date to the same invoiced sale.order.line
self.timesheet.write({"name": "Description 1"})
self.timesheet2 = self.timesheet.copy().write(
self.timesheet2 = self.timesheet.copy(
{
"name": "Description 2",
"date": datetime.strptime("2017-08-05", "%Y-%m-%d"),
}
)
self.timesheet3 = self.timesheet.copy().write(
self.timesheet3 = self.timesheet.copy(
{
"name": "Description 3",
"date": datetime.strptime("2017-08-06", "%Y-%m-%d"),
Expand All @@ -199,6 +199,7 @@ def test_three_timesheets_same_date_split(self):
)._create_invoices(start_date="2017-01-01", end_date="2018-01-01")

self.assertEqual(len(invoice.invoice_line_ids), 4)
self.assertEqual(sum(self.sale_order.mapped("order_line.qty_delivered")), 3.93)

# First line is a section with product's name
aml_ids = invoice.invoice_line_ids.sorted(key=lambda aml: aml.sequence)
Expand All @@ -214,7 +215,7 @@ def test_three_timesheets_same_date_split(self):

# Last aml quantity is calculated as the rest to equal the original aml quantity
self.assertEqual(aml_ids[-1].name, "Description 3")
self.assertEqual(aml_ids[-1].quantity, 1.3)
self.assertEqual(aml_ids[-1].quantity, 1.29)

# Invoice lines total must equal the expected order line's delivered and
# invoiced quantities
Expand Down