Add issue12235 - [trytond] Fallback to empty string when column path is NULL

This commit is contained in:
Raimon Esteve 2023-06-12 14:09:27 +02:00
parent 54045267c4
commit 761ea52369
2 changed files with 14 additions and 0 deletions

12
issue12235.diff Normal file
View File

@ -0,0 +1,12 @@
diff --git a/tryton/trytond/trytond/model/fields/many2one.py b/tryton/trytond/trytond/model/fields/many2one.py
index 13e1a957ad..3adb1a9654 100644
--- a/tryton/trytond/trytond/model/fields/many2one.py
+++ b/tryton/trytond/trytond/model/fields/many2one.py
@@ -129,6 +129,7 @@ class Many2One(Field):
red_sql = reduce_ids(table.id, (i for i in ids if i is not None))
Target = self.get_target()
path_column = getattr(Target, self.path).sql_column(table)
+ path_column = Coalesce(path_column, '')
cursor.execute(*table.select(path_column, where=red_sql))
if operator.endswith('child_of'):
where = Or()

2
series
View File

@ -63,3 +63,5 @@ account_move_reschedule_line.diff # [account] Fix bug when reschedule the move_l
country.diff # [counrty] backport counrty module from v6.8. Is needed for the use of account_stock_eu module.
issue12310.diff # [stock_product_location] Check product.product locations and product.template locations too.
issue12235.diff # [trytond] Fallback to empty string when column path is NULL