changeset f2f4f885c238 in modules/account:default
details: https://hg.tryton.org/modules/account?cmd=changeset&node=f2f4f885c238
description:
        Mute reconciled payable/receivable lines

        issue10951
        review364371002
diffstat:

 CHANGELOG |   1 +
 move.py   |  17 +++++++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diffs (35 lines):

diff -r 56e9b82a66f1 -r f2f4f885c238 CHANGELOG
--- a/CHANGELOG Mon Apr 11 19:19:54 2022 +0200
+++ b/CHANGELOG Mon Apr 11 20:13:16 2022 +0200
@@ -1,3 +1,4 @@
+* Mute reconciled payable/receivable lines
 * Add delegated amount on move lines
 * Enforce same type for children account as their parent
 * Show debit / credit columns in ledgers when they contain lines
diff -r 56e9b82a66f1 -r f2f4f885c238 move.py
--- a/move.py   Mon Apr 11 19:19:54 2022 +0200
+++ b/move.py   Mon Apr 11 20:13:16 2022 +0200
@@ -1207,6 +1207,23 @@
                         line=line.rec_name))
 
     @classmethod
+    def view_attributes(cls):
+        attributes = super().view_attributes()
+        view_ids = cls._view_reconciliation_muted()
+        if Transaction().context.get('view_id') in view_ids:
+            attributes.append(
+                ('/tree', 'visual',
+                    If(Bool(Eval('reconciliation')), 'muted', '')))
+        return attributes
+
+    @classmethod
+    def _view_reconciliation_muted(cls):
+        pool = Pool()
+        ModelData = pool.get('ir.model.data')
+        return {ModelData.get_id(
+                'account', 'move_line_view_list_payable_receivable')}
+
+    @classmethod
     def delete(cls, lines):
         Move = Pool().get('account.move')
         cls.check_modify(lines)

Reply via email to