diff --git a/locale/de.po b/locale/de.po
index eddec41..7bb3e9b 100644
--- a/locale/de.po
+++ b/locale/de.po
@@ -94,6 +94,14 @@ msgctxt "view:cashbook.planner:"
msgid "Result of the recurrence rule"
msgstr "Ergebnis der Wiederholregel"
+msgctxt "view:cashbook.planner:"
+msgid "Description"
+msgstr "Beschreibung"
+
+msgctxt "view:cashbook.planner:"
+msgid "Booking"
+msgstr "Buchung"
+
msgctxt "field:cashbook.planner,company:"
msgid "Company"
msgstr "Unternehmen"
@@ -214,6 +222,42 @@ msgctxt "field:cashbook.planner,nextrun:"
msgid "Next Execution Date"
msgstr "Nächster Ausführungstermin"
+msgctxt "field:cashbook.planner,nextrun_link:"
+msgid "Next Execution Date"
+msgstr "Nächster Ausführungstermin"
+
+msgctxt "field:cashbook.planner,bookingtype:"
+msgid "Type"
+msgstr "Typ"
+
+msgctxt "help:cashbook.planner,bookingtype:"
+msgid "Type of Booking"
+msgstr "Buchungstyp"
+
+msgctxt "selection:cashbook.planner,bookingtype:"
+msgid "Revenue"
+msgstr "Einnahme"
+
+msgctxt "selection:cashbook.planner,bookingtype:"
+msgid "Revenue Splitbooking"
+msgstr "Einnahme Splitbuchung"
+
+msgctxt "selection:cashbook.planner,bookingtype:"
+msgid "Expense"
+msgstr "Ausgabe"
+
+msgctxt "selection:cashbook.planner,bookingtype:"
+msgid "Expense Splitbooking"
+msgstr "Ausgabe Splitbuchung"
+
+msgctxt "selection:cashbook.planner,bookingtype:"
+msgid "Transfer from"
+msgstr "Umbuchung von"
+
+msgctxt "selection:cashbook.planner,bookingtype:"
+msgid "Transfer to"
+msgstr "Umbuchung nach"
+
############################
# cashbook.planner.nextrun #
diff --git a/locale/en.po b/locale/en.po
index 58f7e96..6ff0974 100644
--- a/locale/en.po
+++ b/locale/en.po
@@ -70,6 +70,14 @@ msgctxt "view:cashbook.planner:"
msgid "Result of the recurrence rule"
msgstr "Result of the recurrence rule"
+msgctxt "view:cashbook.planner:"
+msgid "Description"
+msgstr "Description"
+
+msgctxt "view:cashbook.planner:"
+msgid "Booking"
+msgstr "Booking"
+
msgctxt "field:cashbook.planner,company:"
msgid "Company"
msgstr "Company"
@@ -190,6 +198,42 @@ msgctxt "field:cashbook.planner,nextrun:"
msgid "Next Execution Date"
msgstr "Next Execution Date"
+msgctxt "field:cashbook.planner,nextrun_link:"
+msgid "Next Execution Date"
+msgstr "Next Execution Date"
+
+msgctxt "field:cashbook.planner,bookingtype:"
+msgid "Type"
+msgstr "Type"
+
+msgctxt "help:cashbook.planner,bookingtype:"
+msgid "Type of Booking"
+msgstr "Type of Booking"
+
+msgctxt "selection:cashbook.planner,bookingtype:"
+msgid "Revenue"
+msgstr "Revenue"
+
+msgctxt "selection:cashbook.planner,bookingtype:"
+msgid "Revenue Splitbooking"
+msgstr "Revenue Splitbooking"
+
+msgctxt "selection:cashbook.planner,bookingtype:"
+msgid "Expense"
+msgstr "Expense"
+
+msgctxt "selection:cashbook.planner,bookingtype:"
+msgid "Expense Splitbooking"
+msgstr "Expense Splitbooking"
+
+msgctxt "selection:cashbook.planner,bookingtype:"
+msgid "Transfer from"
+msgstr "Transfer from"
+
+msgctxt "selection:cashbook.planner,bookingtype:"
+msgid "Transfer to"
+msgstr "Transfer to"
+
msgctxt "model:cashbook.planner.nextrun,name:"
msgid "Next Execution Date"
msgstr "Next Execution Date"
diff --git a/nextrun.py b/nextrun.py
index 22e5cda..d3d3264 100644
--- a/nextrun.py
+++ b/nextrun.py
@@ -13,8 +13,8 @@ class NextRun(ModelSQL, ModelView):
planner = fields.Many2One(
string='Planner', required=True, ondelete='CASCADE',
- model_name='cashbook.planner')
- date = fields.Date(string='Date', required=True)
+ model_name='cashbook.planner', readonly=True)
+ date = fields.Date(string='Date', required=True, readonly=True)
def get_rec_name(self, name):
""" get date for record name
diff --git a/planner.py b/planner.py
index 01e48d7..b7a34b2 100644
--- a/planner.py
+++ b/planner.py
@@ -11,6 +11,8 @@ from trytond.transaction import Transaction
from trytond.pool import Pool
from trytond.report import Report
from trytond.pyson import Eval, Bool, If, And
+from trytond.modules.cashbook.line import sel_bookingtype
+
DEF_NONE = None
SEL_FREQU = [
@@ -87,6 +89,14 @@ class ScheduledBooking(DeactivableMixin, ModelSQL, ModelView):
nextrun = fields.One2Many(
string='Next Execution Date', size=1, field='planner',
model_name='cashbook.planner.nextrun')
+ nextrun_link = fields.Function(fields.Many2One(
+ string='Next Execution Date', readonly=True,
+ model_name='cashbook.planner.nextrun'),
+ 'on_change_with_nextrun_link')
+
+ bookingtype = fields.Selection(
+ string='Type', selection=sel_bookingtype, required=True,
+ help='Type of Booking')
@classmethod
def __setup__(cls):
@@ -167,6 +177,20 @@ class ScheduledBooking(DeactivableMixin, ModelSQL, ModelView):
break
return result
+ @fields.depends('nextrun')
+ def on_change_with_nextrun_link(self, name=None):
+ """ get nextrun-record if exist
+
+ Args:
+ name (str, optional): field name. Defaults to None.
+
+ Returns:
+ int: id of nextrun-record or None
+ """
+ if self.nextrun:
+ return self.nextrun[0].id
+ return None
+
@fields.depends(
'start_date', 'end_date', 'frequ', 'weekday', 'monthday',
'interval', 'setpos')
diff --git a/tests/planner.py b/tests/planner.py
index f77063a..842c398 100644
--- a/tests/planner.py
+++ b/tests/planner.py
@@ -39,7 +39,8 @@ class PlannerTestCase(object):
job, = Planner.create([{
'cashbook': book.id,
'name': name,
- 'start_date': date(2022, 5, 1)}])
+ 'start_date': date(2022, 5, 1),
+ 'bookingtype': 'out'}])
# check applied defaults
self.assertEqual(job.rec_name, 'Job 1')
self.assertEqual(job.start_date, date(2022, 5, 1))
diff --git a/view/planner_form.xml b/view/planner_form.xml
index beab02b..ca4f209 100644
--- a/view/planner_form.xml
+++ b/view/planner_form.xml
@@ -9,39 +9,43 @@ full copyright notices and license terms. -->
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
-
-
-
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/planner_list.xml b/view/planner_list.xml
index 6ce7be7..3da7230 100644
--- a/view/planner_list.xml
+++ b/view/planner_list.xml
@@ -6,5 +6,6 @@ full copyright notices and license terms. -->
-
+
+