diff --git a/line.py b/line.py index 410d5f2..8e0f17f 100644 --- a/line.py +++ b/line.py @@ -351,7 +351,11 @@ class Line(Workflow, ModelSQL, ModelView): def search_rec_name(cls, name, clause): """ search in description +... """ - return [('description',) + tuple(clause[1:])] + l1 = cls.search_payee(name, clause) + [ + ('description',) + tuple(clause[1:]), + ('category.rec_name',) + tuple(clause[1:]), + ] + return l1 def get_rec_name(self, name): """ short + name @@ -505,7 +509,7 @@ class Line(Workflow, ModelSQL, ModelView): """ to speed up list-view """ if self.description: - return self.description[:25] + return self.description[:50] @fields.depends('party', 'booktransf', 'bookingtype') def on_change_with_payee(self, name=None): @@ -899,12 +903,14 @@ class LineContext(ModelView): 'readonly': Eval('num_cashbook', 0) < 2, }, depends=['num_cashbook']) date_from = fields.Date(string='Start Date', depends=['date_to'], + help='Limits the date range for the displayed entries.', domain=[ If(Eval('date_to') & Eval('date_from'), ('date_from', '<=', Eval('date_to')), ()), ]) date_to = fields.Date(string='End Date', depends=['date_from'], + help='Limits the date range for the displayed entries.', domain=[ If(Eval('date_to') & Eval('date_from'), ('date_from', '<=', Eval('date_to')), diff --git a/locale/de.po b/locale/de.po index 39e5aaf..0cb9bdb 100644 --- a/locale/de.po +++ b/locale/de.po @@ -970,10 +970,18 @@ msgctxt "field:cashbook.line.context,date_from:" msgid "Start Date" msgstr "Beginndatum" +msgctxt "help:cashbook.line.context,date_from:" +msgid "Limits the date range for the displayed entries." +msgstr "Begrenzt den Datumsbereich für die angezeigten Einträge." + msgctxt "field:cashbook.line.context,date_to:" msgid "End Date" msgstr "Endedatum" +msgctxt "help:cashbook.line.context,date_to:" +msgid "Limits the date range for the displayed entries." +msgstr "Begrenzt den Datumsbereich für die angezeigten Einträge." + ########################## # cashbook.configuration # diff --git a/locale/en.po b/locale/en.po index fa127f3..49684f9 100644 --- a/locale/en.po +++ b/locale/en.po @@ -146,6 +146,10 @@ msgctxt "model:ir.message,text:msg_line_invalid_category" msgid "The category of the booking line '%(recname)s' does not match the posting type '%(booktype)s'." msgstr "The category of the booking line '%(recname)s' does not match the posting type '%(booktype)s'." +msgctxt "model:ir.message,text:msg_line_must_positive" +msgid "The amount must be positive." +msgstr "The amount must be positive." + msgctxt "model:res.group,name:group_cashbook" msgid "Cashbook" msgstr "Cashbook" @@ -370,6 +374,10 @@ msgctxt "view:cashbook.book:" msgid "Owner and Authorizeds" msgstr "Owner and Authorizeds" +msgctxt "view:cashbook.book:" +msgid "General Information" +msgstr "General Information" + msgctxt "view:cashbook.book:" msgid "Balance" msgstr "Balance" @@ -898,10 +906,18 @@ msgctxt "field:cashbook.line.context,date_from:" msgid "Start Date" msgstr "Start Date" +msgctxt "help:cashbook.line.context,date_from:" +msgid "Limits the date range for the displayed entries." +msgstr "Limits the date range for the displayed entries." + msgctxt "field:cashbook.line.context,date_to:" msgid "End Date" msgstr "End Date" +msgctxt "help:cashbook.line.context,date_to:" +msgid "Limits the date range for the displayed entries." +msgstr "Limits the date range for the displayed entries." + msgctxt "model:cashbook.configuration,name:" msgid "Configuration" msgstr "Configuration" diff --git a/reconciliation.py b/reconciliation.py index 72040ee..5d19307 100644 --- a/reconciliation.py +++ b/reconciliation.py @@ -96,7 +96,7 @@ class Reconciliation(Workflow, ModelSQL, ModelView): @classmethod def __setup__(cls): super(Reconciliation, cls).__setup__() - cls._order.insert(0, ('date_from', 'ASC')) + cls._order.insert(0, ('date_from', 'DESC')) cls._transitions |= set(( ('edit', 'check'), ('check', 'done'), diff --git a/tests/test_reconciliation.py b/tests/test_reconciliation.py index 10eacdb..f3c8c11 100644 --- a/tests/test_reconciliation.py +++ b/tests/test_reconciliation.py @@ -49,14 +49,14 @@ class ReconTestCase(ModuleTestCase): 'date_to': date(2022, 6, 30), }])], }]) - self.assertEqual(book.reconciliations[0].rec_name, '05/01/2022 - 05/31/2022 | 0.00 usd - 0.00 usd [0]') - self.assertEqual(book.reconciliations[1].rec_name, '05/31/2022 - 06/30/2022 | 0.00 usd - 0.00 usd [0]') + self.assertEqual(book.reconciliations[0].rec_name, '05/31/2022 - 06/30/2022 | 0.00 usd - 0.00 usd [0]') + self.assertEqual(book.reconciliations[1].rec_name, '05/01/2022 - 05/31/2022 | 0.00 usd - 0.00 usd [0]') self.assertRaisesRegex(UserError, 'The date range overlaps with another reconciliation.', Reconciliation.write, *[ - [book.reconciliations[1]], + [book.reconciliations[0]], { 'date_from': date(2022, 4, 15), 'date_to': date(2022, 5, 2), @@ -97,14 +97,14 @@ class ReconTestCase(ModuleTestCase): 'date_to': date(2022, 6, 30), }])], }]) - self.assertEqual(book.reconciliations[0].rec_name, '05/01/2022 - 05/31/2022 | 0.00 usd - 0.00 usd [0]') - self.assertEqual(book.reconciliations[1].rec_name, '05/31/2022 - 06/30/2022 | 0.00 usd - 0.00 usd [0]') + self.assertEqual(book.reconciliations[0].rec_name, '05/31/2022 - 06/30/2022 | 0.00 usd - 0.00 usd [0]') + self.assertEqual(book.reconciliations[1].rec_name, '05/01/2022 - 05/31/2022 | 0.00 usd - 0.00 usd [0]') self.assertRaisesRegex(UserError, 'The date range overlaps with another reconciliation.', Reconciliation.write, *[ - [book.reconciliations[1]], + [book.reconciliations[0]], { 'date_from': date(2022, 5, 30), }, @@ -144,14 +144,14 @@ class ReconTestCase(ModuleTestCase): 'date_to': date(2022, 6, 30), }])], }]) - self.assertEqual(book.reconciliations[0].rec_name, '05/01/2022 - 05/31/2022 | 0.00 usd - 0.00 usd [0]') - self.assertEqual(book.reconciliations[1].rec_name, '05/31/2022 - 06/30/2022 | 0.00 usd - 0.00 usd [0]') + self.assertEqual(book.reconciliations[0].rec_name, '05/31/2022 - 06/30/2022 | 0.00 usd - 0.00 usd [0]') + self.assertEqual(book.reconciliations[1].rec_name, '05/01/2022 - 05/31/2022 | 0.00 usd - 0.00 usd [0]') self.assertRaisesRegex(UserError, 'The date range overlaps with another reconciliation.', Reconciliation.write, *[ - [book.reconciliations[1]], + [book.reconciliations[0]], { 'date_from': date(2022, 5, 5), 'date_to': date(2022, 5, 15), @@ -192,8 +192,8 @@ class ReconTestCase(ModuleTestCase): 'date_to': date(2022, 6, 30), }])], }]) - self.assertEqual(book.reconciliations[0].rec_name, '05/01/2022 - 05/31/2022 | 0.00 usd - 0.00 usd [0]') - self.assertEqual(book.reconciliations[1].rec_name, '05/31/2022 - 06/30/2022 | 0.00 usd - 0.00 usd [0]') + self.assertEqual(book.reconciliations[0].rec_name, '05/31/2022 - 06/30/2022 | 0.00 usd - 0.00 usd [0]') + self.assertEqual(book.reconciliations[1].rec_name, '05/01/2022 - 05/31/2022 | 0.00 usd - 0.00 usd [0]') self.assertRaisesRegex(UserError, 'The date range overlaps with another reconciliation.', @@ -536,9 +536,11 @@ class ReconTestCase(ModuleTestCase): self.assertEqual(len(book.reconciliations[0].lines), 1) self.assertEqual(book.reconciliations[0].lines[0].rec_name, '05/01/2022|Rev|1.00 usd|Text 1 [Cat1]') self.assertEqual(book.lines[0].rec_name, '05/01/2022|Rev|1.00 usd|Text 1 [Cat1]') + self.assertEqual(book.lines[0].state, 'check') self.assertEqual(book.lines[1].rec_name, '06/01/2022|Rev|1.00 usd|Text 2 [Cat1]') + self.assertEqual(book.lines[1].state, 'edit') - # move 2nd line into date-range of checked-reconciliation, wf-check + # move 1st line into date-range of checked-reconciliation, wf-check Lines.write(*[ [book.lines[1]], { @@ -570,7 +572,9 @@ class ReconTestCase(ModuleTestCase): 'date_from': date(2022, 5, 31), 'date_to': date(2022, 6, 30), }]) - Reconciliation.wfdone([book.reconciliations[0]]) + self.assertEqual(book.reconciliations[0].rec_name, '05/31/2022 - 06/30/2022 | 0.00 usd - 0.00 usd [0]') + self.assertEqual(book.reconciliations[1].rec_name, '05/01/2022 - 05/31/2022 | 0.00 usd - 1.00 usd [1]') + Reconciliation.wfdone([book.reconciliations[1]]) Reconciliation.wfcheck([recon2]) Lines.write(*[ diff --git a/view/book_list.xml b/view/book_list.xml index 73d2795..75a290c 100644 --- a/view/book_list.xml +++ b/view/book_list.xml @@ -9,9 +9,5 @@ full copyright notices and license terms. --> - - -