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

#162058
This commit is contained in:
Raimon Esteve 2023-10-06 10:01:36 +02:00
parent a6af9fb3cf
commit 473d52c242
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 8d5cf199a8..ec32e02f57 100644
--- a/tryton/trytond/trytond/model/modelview.py
+++ b/tryton/trytond/trytond/model/modelview.py
@@ -825,7 +825,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

@ -53,3 +53,5 @@ issue12480.diff # [trytond] Support GIN index with btree_gin PostgreSQL extensio
merge_request779.diff # [account_payment] Warn when submitting, approving or proceeding payment with reconciled line
issue12576.diff # [account_stock_eu] Could not find the intrastat countries for moves
issue7677.diff # [trytond] Do not set rec_name for unsaved record