diff --git a/CHANGELOG b/CHANGELOG
index 2f38076404..bcc290f06d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,4 @@
+* Rename split lines into reschedule lines
* Add optional credit type on account
* Always require a date to compute taxes
* Add support for Python 3.10
diff --git a/__init__.py b/__init__.py
index e6c2e0a9c4..3c105597bf 100644
--- a/__init__.py
+++ b/__init__.py
@@ -59,9 +59,9 @@ def register():
move.ReconcileShow,
move.CancelMovesDefault,
move.GroupLinesStart,
- move.SplitLinesStart,
- move.SplitLinesPreview,
- move.SplitLinesTerm,
+ move.RescheduleLinesStart,
+ move.RescheduleLinesPreview,
+ move.RescheduleLinesTerm,
tax.TaxGroup,
tax.TaxCodeTemplate,
tax.TaxCode,
@@ -102,7 +102,7 @@ def register():
move.Reconcile,
move.CancelMoves,
move.GroupLines,
- move.SplitLines,
+ move.RescheduleLines,
move_template.CreateMove,
tax.OpenChartTaxCode,
tax.OpenTaxCode,
diff --git a/doc/design/move.rst b/doc/design/move.rst
index 81522eedf8..10146f9bc3 100644
--- a/doc/design/move.rst
+++ b/doc/design/move.rst
@@ -97,13 +97,14 @@ line is created for the net amount of the grouped lines.
The maturity date used for the newly created account move line is the
earliest maturity date from the lines that were grouped together.
-.. _wizard-account.move.line.split:
+.. _wizard-account.move.line.reschedule:
-Split Lines
-^^^^^^^^^^^
+Reschedule Lines
+^^^^^^^^^^^^^^^^
-The *Split Lines* wizard allows to reschedule payable or receivable *Account
-Move Lines* by creating an account move line for each new maturity date.
+The *Reschedule Lines* wizard allows to reschedule payable or receivable
+*Account Move Lines* by creating an account move line for each new maturity
+date.
.. _wizard-account.move.reconcile_lines:
diff --git a/exceptions.py b/exceptions.py
index cd5ed598b3..a573d01495 100644
--- a/exceptions.py
+++ b/exceptions.py
@@ -93,5 +93,5 @@ class GroupLineError(UserError):
pass
-class SplitLineError(UserError):
+class RescheduleLineError(UserError):
pass
diff --git a/message.xml b/message.xml
index 9963a45e89..9c690e5921 100644
--- a/message.xml
+++ b/message.xml
@@ -202,20 +202,20 @@ You may need to cancel its move "%(move)s".
You cannot group lines from more than 2 different accounts.
-
- You cannot split lines with different origins.
+
+ You cannot reschedule lines with different origins.
-
- You cannot split lines with different currencies.
+
+ You cannot reschedule lines with different currencies.
-
- You cannot split lines with different accounts.
+
+ You cannot reschedule lines with different accounts.
-
- You cannot split lines with different parties.
+
+ You cannot reschedule lines with different parties.
-
- To split the lines you must change the terms to have a total amount of %(total_amount)s instead of %(amount)s.
+
+ To reschedule the lines you must change the terms to have a total amount of %(total_amount)s instead of %(amount)s.
The moves "%(moves)s" contain grouped lines, cancelling them will ungroup the lines.
diff --git a/move.py b/move.py
index 81a0694bf6..0f6fbdefb6 100644
--- a/move.py
+++ b/move.py
@@ -29,7 +29,7 @@ from trytond.wizard import (
from .exceptions import (
CancelDelegatedWarning, CancelWarning, DeleteDelegatedWarning,
GroupLineError, MoveDatesError, PostError, ReconciliationError,
- SplitLineError)
+ RescheduleLineError)
_MOVE_STATES = {
'readonly': Eval('state') == 'posted',
@@ -2182,28 +2182,28 @@ class GroupLinesStart(ModelView):
description = fields.Char("Description")
-class SplitLines(Wizard):
- "Split Lines"
- __name__ = 'account.move.line.split'
- start = StateView('account.move.line.split.start',
- 'account.move_line_split_start_view_form', [
+class RescheduleLines(Wizard):
+ "Reschedule Lines"
+ __name__ = 'account.move.line.reschedule'
+ start = StateView('account.move.line.reschedule.start',
+ 'account.move_line_reschedule_start_view_form', [
Button("Cancel", 'end', 'tryton-cancel'),
Button("Preview", 'preview', 'tryton-ok',
validate=False, default=True),
])
- preview = StateView('account.move.line.split.preview',
- 'account.move_line_split_preview_view_form', [
+ preview = StateView('account.move.line.reschedule.preview',
+ 'account.move_line_reschedule_preview_view_form', [
Button("Cancel", 'end', 'tryton-cancel'),
- Button("Split", 'split', 'tryton-ok', default=True),
+ Button("Reschedule", 'reschedule', 'tryton-ok', default=True),
])
- split = StateAction('account.act_move_form_splitting')
+ reschedule = StateAction('account.act_move_form_rescheduling')
def get_origin(self):
try:
origin, = {r.move.origin for r in self.records}
except ValueError:
- raise SplitLineError(
- gettext('account.msg_split_line_same_origins'))
+ raise RescheduleLineError(
+ gettext('account.msg_reschedule_line_same_origins'))
return origin
@classmethod
@@ -2211,8 +2211,8 @@ class SplitLines(Wizard):
try:
currency, = {l.amount_currency for l in lines}
except ValueError:
- raise SplitLineError(
- gettext('account.msg_split_line_same_currency'))
+ raise RescheduleLineError(
+ gettext('account.msg_reschedule_line_same_currency'))
return currency
@classmethod
@@ -2220,8 +2220,8 @@ class SplitLines(Wizard):
try:
account, = {l.account for l in lines}
except ValueError:
- raise SplitLineError(
- gettext('account.msg_split_line_same_account'))
+ raise RescheduleLineError(
+ gettext('account.msg_reschedule_line_same_account'))
return account
@classmethod
@@ -2229,8 +2229,8 @@ class SplitLines(Wizard):
try:
party, = {l.party for l in lines}
except ValueError:
- raise SplitLineError(
- gettext('account.msg_split_line_same_party'))
+ raise RescheduleLineError(
+ gettext('account.msg_reschedule_line_same_party'))
return party
@classmethod
@@ -2298,8 +2298,8 @@ class SplitLines(Wizard):
terms[-1]['amount'] += remaining
return values
- def do_split(self, action):
- move, balance_line = self.split_lines(
+ def do_reschedule(self, action):
+ move, balance_line = self.reschedule_lines(
self.records, self.preview.journal, self.preview.terms)
move.origin = self.get_origin()
move.description = self.preview.description
@@ -2320,7 +2320,7 @@ class SplitLines(Wizard):
}
@classmethod
- def split_lines(cls, lines, journal, terms):
+ def reschedule_lines(cls, lines, journal, terms):
pool = Pool()
Lang = pool.get('ir.lang')
Line = pool.get('account.move.line')
@@ -2330,15 +2330,15 @@ class SplitLines(Wizard):
if amount != total_amount:
lang = Lang.get()
currency = cls.get_currency(lines)
- raise SplitLineError(
- gettext('account.msg_split_line_wrong_amount',
+ raise RescheduleLineError(
+ gettext('account.msg_reschedule_line_wrong_amount',
total_amount=lang.currency(total_amount, currency),
amount=lang.currency(amount, currency)))
balance = cls.get_balance(lines)
line_values = cls._line_values(lines)
account = line_values['account']
- move, balance_line = cls.get_split_move(
+ move, balance_line = cls.get_reschedule_move(
amount, balance, journal, terms, **line_values)
move.save()
balance_line.move = move
@@ -2349,7 +2349,7 @@ class SplitLines(Wizard):
return move, balance_line
@classmethod
- def get_split_move(
+ def get_reschedule_move(
cls, amount, balance, journal, terms, account, date=None,
**line_values):
pool = Pool()
@@ -2408,9 +2408,9 @@ class SplitLines(Wizard):
return move, balance_line
-class SplitLinesStart(ModelView):
- "Split Lines"
- __name__ = 'account.move.line.split.start'
+class RescheduleLinesStart(ModelView):
+ "Reschedule Lines"
+ __name__ = 'account.move.line.reschedule.start'
start_date = fields.Date("Start Date", required=True)
frequency = fields.Selection([
('monthly', "Monthly"),
@@ -2474,13 +2474,13 @@ class SplitLinesStart(ModelView):
self.interval = self.frequency_intervals()[self.frequency]
-class SplitLinesPreview(ModelView):
- "Split Lines"
- __name__ = 'account.move.line.split.preview'
+class RescheduleLinesPreview(ModelView):
+ "Reschedule Lines"
+ __name__ = 'account.move.line.reschedule.preview'
journal = fields.Many2One('account.journal', "Journal", required=True)
description = fields.Char("Description")
terms = fields.One2Many(
- 'account.move.line.split.term', None, "Terms",
+ 'account.move.line.reschedule.term', None, "Terms",
domain=[
('currency', '=', Eval('currency', -1)),
],
@@ -2488,9 +2488,9 @@ class SplitLinesPreview(ModelView):
currency = fields.Many2One('currency.currency', "Currency", readonly=True)
-class SplitLinesTerm(ModelView):
- "Split Lines"
- __name__ = 'account.move.line.split.term'
+class RescheduleLinesTerm(ModelView):
+ "Reschedule Lines"
+ __name__ = 'account.move.line.reschedule.term'
date = fields.Date("Date", required=True)
amount = Monetary(
"Amount", currency='currency', digits='currency', required=True)
diff --git a/move.xml b/move.xml
index c9f181cd17..3eecae9791 100644
--- a/move.xml
+++ b/move.xml
@@ -452,43 +452,43 @@ this repository contains the full copyright notices and license terms. -->
-
- Split Lines
- account.move.line.split
+
+ Reschedule Lines
+ account.move.line.reschedule
account.move.line
-
+
form_action
account.move.line,-1
-
+
-
- account.move.line.split.start
+
+ account.move.line.reschedule.start
form
- move_line_split_start_form
+ move_line_reschedule_start_form
-
- account.move.line.split.preview
+
+ account.move.line.reschedule.preview
form
- move_line_split_preview_form
+ move_line_reschedule_preview_form
-
- account.move.line.split.term
+
+ account.move.line.reschedule.term
tree
- move_line_split_term_list
+ move_line_reschedule_term_list
-
- Split Account Move
+
+ Reschedule Account Move
account.move
-
+
-
+
diff --git a/tests/scenario_move_line_split.rst b/tests/scenario_move_line_reschedule.rst
similarity index 79%
rename from tests/scenario_move_line_split.rst
rename to tests/scenario_move_line_reschedule.rst
index e37f493fc5..d65589b553 100644
--- a/tests/scenario_move_line_split.rst
+++ b/tests/scenario_move_line_reschedule.rst
@@ -1,6 +1,6 @@
-====================
-Split Lines Scenario
-====================
+=========================
+Reschedule Lines Scenario
+=========================
Imports::
@@ -51,7 +51,7 @@ Create parties::
>>> party = Party(name="Party")
>>> party.save()
-Create Lines to split::
+Create Lines to reschedule::
>>> journal_revenue, = Journal.find([
... ('code', '=', 'REV'),
@@ -79,16 +79,16 @@ Create Lines to split::
Split line by amount::
- >>> split = Wizard('account.move.line.split', [line])
- >>> split.form.total_amount
+ >>> reschedule = Wizard('account.move.line.reschedule', [line])
+ >>> reschedule.form.total_amount
Decimal('100.00')
- >>> split.form.start_date = period.end_date
- >>> split.form.frequency = 'other'
- >>> split.form.interval = 2
- >>> split.form.amount = Decimal('30.00')
- >>> split.execute('preview')
+ >>> reschedule.form.start_date = period.end_date
+ >>> reschedule.form.frequency = 'other'
+ >>> reschedule.form.interval = 2
+ >>> reschedule.form.amount = Decimal('30.00')
+ >>> reschedule.execute('preview')
- >>> term1, term2, term3, term4 = split.form.terms
+ >>> term1, term2, term3, term4 = reschedule.form.terms
>>> term1.date == period.end_date
True
>>> term2.date == period.end_date + relativedelta(months=2)
@@ -102,16 +102,16 @@ Split line by amount::
Split line by number::
- >>> split = Wizard('account.move.line.split', [line])
- >>> split.form.total_amount
+ >>> reschedule = Wizard('account.move.line.reschedule', [line])
+ >>> reschedule.form.total_amount
Decimal('100.00')
- >>> split.form.start_date = period.end_date
- >>> split.form.frequency = 'monthly'
- >>> split.form.number = 3
- >>> split.execute('preview')
+ >>> reschedule.form.start_date = period.end_date
+ >>> reschedule.form.frequency = 'monthly'
+ >>> reschedule.form.number = 3
+ >>> reschedule.execute('preview')
- >>> split.form.description = "Split 3 months"
- >>> term1, term2, term3 = split.form.terms
+ >>> reschedule.form.description = "Split 3 months"
+ >>> term1, term2, term3 = reschedule.form.terms
>>> term1.date == period.end_date
True
>>> term2.date == period.end_date + relativedelta(months=1)
@@ -124,9 +124,9 @@ Split line by number::
>>> term2.amount = term3.amount = Decimal('30.00')
>>> term3.date += relativedelta(months=1)
- >>> split.execute('split')
- >>> split_move, = split.actions[0]
- >>> split_move.description
+ >>> reschedule.execute('reschedule')
+ >>> reschedule_move, = reschedule.actions[0]
+ >>> reschedule_move.description
'Split 3 months'
Check receivable::
diff --git a/tests/test_account.py b/tests/test_account.py
index 39d8d89cb3..22b4cbfba8 100644
--- a/tests/test_account.py
+++ b/tests/test_account.py
@@ -1725,7 +1725,7 @@ def suite():
checker=doctest_checker,
optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
suite.addTests(doctest.DocFileSuite(
- 'scenario_move_line_split.rst',
+ 'scenario_move_line_reschedule.rst',
tearDown=doctest_teardown, encoding='utf-8',
checker=doctest_checker,
optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
diff --git a/view/move_line_split_preview_form.xml b/view/move_line_reschedule_preview_form.xml
similarity index 100%
rename from view/move_line_split_preview_form.xml
rename to view/move_line_reschedule_preview_form.xml
diff --git a/view/move_line_split_start_form.xml b/view/move_line_reschedule_start_form.xml
similarity index 100%
rename from view/move_line_split_start_form.xml
rename to view/move_line_reschedule_start_form.xml
diff --git a/view/move_line_split_term_list.xml b/view/move_line_reschedule_term_list.xml
similarity index 100%
rename from view/move_line_split_term_list.xml
rename to view/move_line_reschedule_term_list.xml