changeset 353fe11ecf0d in modules/account:default
details: https://hg.tryton.org/modules/account?cmd=changeset;node=353fe11ecf0d
description:
        Order account by its code and name

        issue9180
        review297361002
diffstat:

 CHANGELOG  |  1 +
 account.py |  6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diffs (31 lines):

diff -r 052fe6ec6d32 -r 353fe11ecf0d CHANGELOG
--- a/CHANGELOG Sat Mar 28 16:54:08 2020 +0100
+++ b/CHANGELOG Mon Apr 06 12:56:19 2020 +0200
@@ -1,3 +1,4 @@
+* Order account by its code and name
 * Add optional debit type on account
 * Show the move resulting from the GroupLines wizard
 * Allow periods to end on any day of the month
diff -r 052fe6ec6d32 -r 353fe11ecf0d account.py
--- a/account.py        Sat Mar 28 16:54:08 2020 +0100
+++ b/account.py        Mon Apr 06 12:56:19 2020 +0200
@@ -417,6 +417,7 @@
 
     class Mixin:
         __slots__ = ()
+        _order_name = 'rec_name'
         name = fields.Char('Name', required=True, select=True)
         code = fields.Char('Code', select=True)
 
@@ -524,6 +525,11 @@
                 (cls._rec_name,) + tuple(clause[1:]),
                 ]
 
+        @staticmethod
+        def order_rec_name(tables):
+            table, _ = tables[None]
+            return [table.code, table.name]
+
     if not template:
         for fname in dir(Mixin):
             field = getattr(Mixin, fname)

Reply via email to