Cédric Krier pushed to branch branch/default at Tryton / Tryton


Commits:
ba6ec926 by Cédric Krier at 2023-01-05T17:26:36+01:00
Remove aliases from grouped columns of move line when used in "group 
by"

Closes #11993
- - - - -


1 changed file:

- modules/account_move_line_grouping/account.py


Changes:

=====================================
modules/account_move_line_grouping/account.py
=====================================
@@ -1,6 +1,6 @@
 # This file is part of Tryton.  The COPYRIGHT file at the top level of
 # this repository contains the full copyright notices and license terms.
-from sql import Literal, Null, Select, Window
+from sql import As, Literal, Null, Select, Window
 from sql.aggregate import BoolAnd, BoolOr, Min, Sum
 from sql.functions import CurrentTimestamp, FirstValue
 
@@ -149,6 +149,8 @@
         aggregated_columns = cls._aggregated_columns(line)
 
         columns = std_columns + grouped_columns + aggregated_columns
+        grouped_columns = [
+            c.expression if isinstance(c, As) else c for c in grouped_columns]
         return line.select(*columns, group_by=grouped_columns)
 
     @classmethod



View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/commit/ba6ec926bffa8bd3380d817b62431be398e02f68

-- 
View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/commit/ba6ec926bffa8bd3380d817b62431be398e02f68
You're receiving this email because of your account on foss.heptapod.net.


Reply via email to