changeset 58a6b5d7edc1 in modules/account_statement:default
details:
https://hg.tryton.org/modules/account_statement?cmd=changeset;node=58a6b5d7edc1
description:
Fill move line's origin with statement line
issue10037
review316811002
diffstat:
CHANGELOG | 2 ++
__init__.py | 1 +
account.py | 8 ++++++++
statement.py | 1 +
4 files changed, 12 insertions(+), 0 deletions(-)
diffs (46 lines):
diff -r e775bf082671 -r 58a6b5d7edc1 CHANGELOG
--- a/CHANGELOG Sat Dec 19 17:08:44 2020 +0100
+++ b/CHANGELOG Wed Feb 03 21:22:31 2021 +0100
@@ -1,3 +1,5 @@
+* Fill move line's origin with statement line
+
Version 5.8.0 - 2020-11-02
* Bug fixes (see mercurial logs for details)
* Remove support for Python 3.5
diff -r e775bf082671 -r 58a6b5d7edc1 __init__.py
--- a/__init__.py Sat Dec 19 17:08:44 2020 +0100
+++ b/__init__.py Wed Feb 03 21:22:31 2021 +0100
@@ -16,6 +16,7 @@
statement.LineGroup,
account.Journal,
account.Move,
+ account.MoveLine,
statement.Origin,
statement.OriginInformation,
statement.ImportStatementStart,
diff -r e775bf082671 -r 58a6b5d7edc1 account.py
--- a/account.py Sat Dec 19 17:08:44 2020 +0100
+++ b/account.py Wed Feb 03 21:22:31 2021 +0100
@@ -71,3 +71,11 @@
move=move.rec_name,
statement=move.origin.rec_name))
super().post(moves)
+
+
+class MoveLine(metaclass=PoolMeta):
+ __name__ = 'account.move.line'
+
+ @classmethod
+ def _get_origin(cls):
+ return super()._get_origin() + ['account.statement.line']
diff -r e775bf082671 -r 58a6b5d7edc1 statement.py
--- a/statement.py Sat Dec 19 17:08:44 2020 +0100
+++ b/statement.py Wed Feb 03 21:22:31 2021 +0100
@@ -977,6 +977,7 @@
second_currency = None
return MoveLine(
+ origin=self,
description=self.description,
debit=amount < zero and -amount or zero,
credit=amount >= zero and amount or zero,