diff --git a/__init__.py b/__init__.py
index a3c966b..cb57d15 100644
--- a/__init__.py
+++ b/__init__.py
@@ -7,6 +7,7 @@ from trytond.pool import Pool
from .book import Book
from .types import Type
from .line import Line, LineContext
+from .splitline import SplitLine
from .wizard_openline import OpenCashBook, OpenCashBookStart
from .wizard_runreport import RunCbReport, RunCbReportStart
from .configuration import Configuration, UserConfiguration
@@ -23,6 +24,7 @@ def register():
Book,
LineContext,
Line,
+ SplitLine,
Reconciliation,
OpenCashBookStart,
RunCbReportStart,
diff --git a/line.py b/line.py
index 5b58c44..dbc79cb 100644
--- a/line.py
+++ b/line.py
@@ -31,6 +31,8 @@ sel_linetype = [
sel_bookingtype = [
('in', 'Revenue'),
('out', 'Expense'),
+ ('spin', 'Revenue Splitbooking'),
+ ('spout', 'Expense Splitbooking'),
('mvin', 'Transfer from'),
('mvout', 'Transfer to'),
]
@@ -102,7 +104,7 @@ class Line(Workflow, ModelSQL, ModelView):
ondelete='RESTRICT',
states={
'readonly': STATES['readonly'],
- 'invisible': ~Eval('bookingtype', '').in_(['in', 'out']),
+ 'invisible': ~Eval('bookingtype', '').in_(['in', 'out', 'spin', 'spout']),
}, depends=DEPENDS+['bookingtype'])
payee = fields.Function(fields.Reference(string='Payee', readonly=True,
selection=sel_payee), 'on_change_with_payee', searcher='search_payee')
@@ -113,11 +115,18 @@ class Line(Workflow, ModelSQL, ModelView):
'invisible': ~Bool(Eval('reference')),
}, model_name='cashbook.line', ondelete='CASCADE',
help='The current row was created by and is controlled by the reference row.')
- references = fields.One2Many(string='References', model_name='cashbook.line',
+ references = fields.One2Many(string='References',
+ model_name='cashbook.line',
help='The rows are created and managed by the current record.',
states={
'invisible': ~Bool(Eval('references')),
}, field='reference', readonly=True)
+ splitlines = fields.One2Many(string='Split booking lines',
+ model_name='cashbook.split',
+ help='The rows are created and managed by the current record.',
+ states={
+ 'invisible': ~Bool(Eval('splitlines')),
+ }, field='line', readonly=True)
reconciliation = fields.Many2One(string='Reconciliation', readonly=True,
model_name='cashbook.recon', ondelete='SET NULL',
@@ -398,7 +407,7 @@ class Line(Workflow, ModelSQL, ModelView):
""" get party or cashbook
"""
if self.bookingtype:
- if self.bookingtype in ['in', 'out']:
+ if self.bookingtype in ['in', 'out', 'spin', 'spout']:
if self.party:
return 'party.party,%d' % self.party.id
elif self.bookingtype in ['mvin', 'mvout']:
@@ -488,8 +497,8 @@ class Line(Workflow, ModelSQL, ModelView):
""" clear category if not valid type
"""
types = {
- 'in': ['in', 'mvin'],
- 'out': ['out', 'mvout'],
+ 'in': ['in', 'mvin', 'spin'],
+ 'out': ['out', 'mvout', 'spout'],
}
if self.bookingtype:
@@ -570,12 +579,12 @@ class Line(Workflow, ModelSQL, ModelView):
if type_:
if amount is not None:
- if type_ in ['in', 'mvin']:
+ if type_ in ['in', 'mvin', 'spin']:
return {
'debit': Decimal('0.0'),
'credit': amount,
}
- elif type_ in ['out', 'mvout']:
+ elif type_ in ['out', 'mvout', 'spout']:
return {
'debit': amount,
'credit': Decimal('0.0'),
diff --git a/locale/de.po b/locale/de.po
index 256b514..e2ca1a9 100644
--- a/locale/de.po
+++ b/locale/de.po
@@ -110,10 +110,18 @@ msgctxt "model:ir.message,text:msg_line_bookingtype_in"
msgid "Rev"
msgstr "Einn."
+msgctxt "model:ir.message,text:msg_line_bookingtype_spin"
+msgid "Rev/Sp"
+msgstr "Einn./Spl."
+
msgctxt "model:ir.message,text:msg_line_bookingtype_out"
msgid "Exp"
msgstr "Ausg."
+msgctxt "model:ir.message,text:msg_line_bookingtype_spout"
+msgid "Exp/Sp"
+msgstr "Ausg./Spl."
+
msgctxt "model:ir.message,text:msg_line_bookingtype_mvin"
msgid "from"
msgstr "von"
@@ -166,6 +174,10 @@ msgctxt "model:ir.rule.group,name:rg_book_read_nonowner"
msgid "Observers and Reviewers: Cashbook read"
msgstr "Beobachter und Bearbeiter: Kassenbuch lesen"
+msgctxt "model:ir.rule.group,name:rg_split_write_adm"
+msgid "Administrators: Splitbooking line read/write"
+msgstr "Administratoren: Splitbuchungszeile bearbeiten"
+
msgctxt "model:ir.rule.group,name:rg_book_write_adm"
msgid "Administrators: Cashbook read/write"
msgstr "Administratoren: Kassenbuch bearbeiten"
@@ -174,10 +186,18 @@ msgctxt "model:ir.rule.group,name:rg_line_write_adm"
msgid "Administrators: Cashbook line read/write"
msgstr "Administratoren: Kassenbuchzeile bearbeiten"
+msgctxt "model:ir.rule.group,name:rg_split_write"
+msgid "Owners and reviewers: Splitbooking line write"
+msgstr "Eigentümer und Bearbeiter: Splitbuchungszeile bearbeiten"
+
msgctxt "model:ir.rule.group,name:rg_line_write"
msgid "Owners and reviewers: Cashbook line write"
msgstr "Eigentümer und Bearbeiter: Kassenbuchzeile bearbeiten"
+msgctxt "model:ir.rule.group,name:rg_split_read"
+msgid "Observer: Splitbooking line read"
+msgstr "Beobachter: Splitbuchungszeile lesen"
+
msgctxt "model:ir.rule.group,name:rg_line_read"
msgid "Observer: Cashbook line read"
msgstr "Beobachter: Kassenbuchzeile lesen"
@@ -186,6 +206,10 @@ msgctxt "model:ir.rule.group,name:rg_line_read"
msgid "User in companies"
msgstr "Benutzer im Unternehmen"
+msgctxt "model:ir.rule.group,name:rg_split_companies"
+msgid "User in companies"
+msgstr "Benutzer im Unternehmen"
+
msgctxt "model:ir.rule.group,name:rg_type_companies"
msgid "User in companies"
msgstr "Benutzer im Unternehmen"
@@ -451,6 +475,86 @@ msgid "The numbering of the lines is done in the step Check. If the check mark i
msgstr "Die Nummerierung der Zeilen wird beim Schritt 'Prüfen' erledigt. Bei inaktivem Häkchen passiert dies erst bei 'Fertig'."
+##################
+# cashbook.split #
+##################
+msgctxt "model:cashbook.split,name:"
+msgid "Split booking line"
+msgstr "Splitbuchungszeile"
+
+msgctxt "field:cashbook.split,line:"
+msgid "Line"
+msgstr "Zeile"
+
+msgctxt "field:cashbook.split,description:"
+msgid "Description"
+msgstr "Beschreibung"
+
+msgctxt "field:cashbook.split,category:"
+msgid "Category"
+msgstr "Kategorie"
+
+msgctxt "field:cashbook.split,amount:"
+msgid "Amount"
+msgstr "Betrag"
+
+msgctxt "field:cashbook.split,currency:"
+msgid "Currency"
+msgstr "Währung"
+
+msgctxt "field:cashbook.split,currency_digits:"
+msgid "Currency Digits"
+msgstr "Nachkommastellen Währung"
+
+msgctxt "field:cashbook.split,bookingtype:"
+msgid "Type"
+msgstr "Typ"
+
+msgctxt "selection:cashbook.split,bookingtype:"
+msgid "Revenue"
+msgstr "Einnahme"
+
+msgctxt "selection:cashbook.split,bookingtype:"
+msgid "Revenue Splitbooking"
+msgstr "Einnahme Splitbuchung"
+
+msgctxt "selection:cashbook.split,bookingtype:"
+msgid "Expense"
+msgstr "Ausgabe"
+
+msgctxt "selection:cashbook.split,bookingtype:"
+msgid "Expense Splitbooking"
+msgstr "Ausgabe Splitbuchung"
+
+msgctxt "selection:cashbook.split,bookingtype:"
+msgid "Transfer from"
+msgstr "Umbuchung von"
+
+msgctxt "selection:cashbook.split,bookingtype:"
+msgid "Transfer to"
+msgstr "Umbuchung nach"
+
+msgctxt "field:cashbook.split,state:"
+msgid "State"
+msgstr "Status"
+
+msgctxt "selection:cashbook.split,state:"
+msgid "Edit"
+msgstr "Bearbeiten"
+
+msgctxt "selection:cashbook.split,state:"
+msgid "Checked"
+msgstr "Geprüft"
+
+msgctxt "selection:cashbook.split,state:"
+msgid "Done"
+msgstr "Fertig"
+
+msgctxt "field:cashbook.split,state_cashbook:"
+msgid "State of Cashbook"
+msgstr "Kassenbuchstatus"
+
+
#################
# cashbook.line #
#################
@@ -530,10 +634,18 @@ msgctxt "selection:cashbook.line,bookingtype:"
msgid "Revenue"
msgstr "Einnahme"
+msgctxt "selection:cashbook.line,bookingtype:"
+msgid "Revenue Splitbooking"
+msgstr "Einnahme Splitbuchung"
+
msgctxt "selection:cashbook.line,bookingtype:"
msgid "Expense"
msgstr "Ausgabe"
+msgctxt "selection:cashbook.line,bookingtype:"
+msgid "Expense Splitbooking"
+msgstr "Ausgabe Splitbuchung"
+
msgctxt "selection:cashbook.line,bookingtype:"
msgid "Transfer from"
msgstr "Umbuchung von"
diff --git a/message.xml b/message.xml
index 2ca8f44..9cea207 100644
--- a/message.xml
+++ b/message.xml
@@ -80,6 +80,12 @@ full copyright notices and license terms. -->