book: start-saldo + sperre bei lines>0, saldo, rec_name + tests
This commit is contained in:
parent
8fd6e0d339
commit
ae5303658e
9 changed files with 218 additions and 40 deletions
|
@ -131,7 +131,7 @@ class LineTestCase(ModuleTestCase):
|
|||
self.assertEqual(book.state, 'closed')
|
||||
|
||||
self.assertRaisesRegex(UserError,
|
||||
"The cash book 'Book 1' is 'Closed' and cannot be changed.",
|
||||
"The cash book 'Book | 2.00 usd | Closed' is 'Closed' and cannot be changed.",
|
||||
Line.write,
|
||||
*[
|
||||
[book.lines[0]],
|
||||
|
@ -478,7 +478,7 @@ class LineTestCase(ModuleTestCase):
|
|||
self.assertEqual(book.state, 'closed')
|
||||
|
||||
self.assertRaisesRegex(UserError,
|
||||
"The cashbook line '05/01/2022 Text 1' cannot be deleted because the Cashbook 'Book 1' is in state 'Closed'.",
|
||||
"The cashbook line '05/01/2022 Text 1' cannot be deleted because the Cashbook 'Book | 2.00 usd | Closed' is in state 'Closed'.",
|
||||
Lines.delete,
|
||||
[book.lines[0]])
|
||||
|
||||
|
@ -570,7 +570,7 @@ class LineTestCase(ModuleTestCase):
|
|||
'amount': Decimal('1.0'),
|
||||
}])],
|
||||
}])
|
||||
self.assertEqual(book.rec_name, 'Fridas book'),
|
||||
self.assertEqual(book.rec_name, 'Fridas book | 1.00 usd | Open'),
|
||||
self.assertEqual(book.owner.rec_name, 'Frida'),
|
||||
|
||||
with Transaction().set_context({
|
||||
|
@ -585,7 +585,7 @@ class LineTestCase(ModuleTestCase):
|
|||
with Transaction().set_user(usr_lst[0].id):
|
||||
lines = Line.search([])
|
||||
self.assertEqual(len(lines), 1)
|
||||
self.assertEqual(lines[0].cashbook.rec_name, 'Fridas book')
|
||||
self.assertEqual(lines[0].cashbook.rec_name, 'Fridas book | 1.00 usd | Open')
|
||||
self.assertEqual(lines[0].rec_name, '05/01/2022 Test 1')
|
||||
|
||||
Line.write(*[
|
||||
|
@ -647,7 +647,7 @@ class LineTestCase(ModuleTestCase):
|
|||
'amount': Decimal('1.0'),
|
||||
}])],
|
||||
}])
|
||||
self.assertEqual(book.rec_name, 'Fridas book'),
|
||||
self.assertEqual(book.rec_name, 'Fridas book | 1.00 usd | Open'),
|
||||
self.assertEqual(book.owner.rec_name, 'Frida'),
|
||||
|
||||
with Transaction().set_context({
|
||||
|
@ -731,7 +731,7 @@ class LineTestCase(ModuleTestCase):
|
|||
'amount': Decimal('1.0'),
|
||||
}])],
|
||||
}])
|
||||
self.assertEqual(book.rec_name, 'Fridas book'),
|
||||
self.assertEqual(book.rec_name, 'Fridas book | 1.00 usd | Open'),
|
||||
self.assertEqual(book.owner.rec_name, 'Frida'),
|
||||
|
||||
with Transaction().set_context({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue