changeset a99138fe00fd in modules/purchase_request_quotation:5.8
details: 
https://hg.tryton.org/modules/purchase_request_quotation?cmd=changeset&node=a99138fe00fd
description:
        Sort requests using the same key as group by

        issue10341
        review357951002
        (grafted from e2a0eacd020ef13ff577f4afb9c3a2ec78fccf5c)
diffstat:

 purchase.py |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r d5df1880f770 -r a99138fe00fd purchase.py
--- a/purchase.py       Fri Apr 02 22:01:45 2021 +0200
+++ b/purchase.py       Sun Apr 25 11:25:31 2021 +0200
@@ -11,6 +11,7 @@
 from trytond.modules.product import price_digits
 from trytond.pool import Pool, PoolMeta
 from trytond.pyson import Eval, Bool, If
+from trytond.tools import sortable_values
 from trytond.transaction import Transaction
 from trytond.wizard import Wizard, StateView, StateTransition, Button
 
@@ -504,7 +505,8 @@
             quotation.supplier = supplier
             quotation.supplier_address = supplier.address_get()
             reqs = [r for r in reqs if self.filter_request(r, supplier)]
-            sorted_reqs = sorted(reqs, key=lambda r: r.company)
+            sorted_reqs = sorted(
+                reqs, key=sortable_values(self._group_request_key))
             for key, grouped_requests in groupby(sorted_reqs,
                     key=self._group_request_key):
                 for f, v in key:

Reply via email to