Add issue7677.diff [trytond] Do not set rec_name for unsaved record

#162058
This commit is contained in:
Raimon Esteve 2023-10-06 09:50:50 +02:00
parent e84ef8fccd
commit f89ab000cb
2 changed files with 16 additions and 0 deletions

14
issue7677.diff Normal file
View File

@ -0,0 +1,14 @@
diff --git a/tryton/trytond/trytond/model/modelview.py b/tryton/trytond/trytond/model/modelview.py
index dafa3c4608..dce8e790b1 100644
--- a/tryton/trytond/trytond/model/modelview.py
+++ b/tryton/trytond/trytond/model/modelview.py
@@ -786,7 +786,8 @@ class ModelView(Model):
continue
if field._type in ('many2one', 'one2one', 'reference'):
if value:
- if isinstance(value, ModelStorage):
+ if isinstance(value, ModelStorage)
+ and value.id and value.id >= 0):
changed['%s.' % fname] = {
'rec_name': value.rec_name,
}

2
series
View File

@ -109,3 +109,5 @@ issue12583.diff # [stock_lot] Missing search function in default_uom field in st
issue12109.diff # [sale] [purchase] [sale_product_customer] Replace _parent_ expression with direct field on sale and purchase line
issue11574.diff # [stock] #162150 missing warehouse in stock.shipment.in.return. Since Support warehouse pickup add warehouse
issue7677.diff # [trytond] Do not set rec_name for unsaved record