Return false when modified is not saved and not created
The return of modified_save method is used to decide to execute an action or not. When a new record is cancelled, the client select the previous record so we must not run the action on this one. issue9881 review337111002
This commit is contained in:
1 parent
27de98ddec
commit
8225a4d511
1 file changed
+3
-1
@@ -553,7 +553,9 @@ class Form(SignalEvent, TabContent):
|
||||
if value == 'ok':
|
||||
return self.sig_save(None)
|
||||
if value == 'ko':
|
||||
return self.sig_reload(test_modified=False)
|
||||
record_id = self.screen.current_record.id
|
||||
if self.sig_reload(test_modified=False):
|
||||
return record_id == self.screen.current_record.id
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
Reference in new issue
Block a user