Reviewers: ,


Please review this at http://codereview.tryton.org/894002/

Affected files:
  M tryton/gui/window/win_form.py


Index: tryton/gui/window/win_form.py
===================================================================

--- a/tryton/gui/window/win_form.py
+++ b/tryton/gui/window/win_form.py
@@ -48,8 +48,14 @@
 
         self.but_ok = None
         self.but_new = None
-        self.but_cancel = self.win.add_button(gtk.STOCK_CANCEL,
-            gtk.RESPONSE_CANCEL)
+
+        if ((view_type == 'form' and self.screen.current_record.id >= 0)
+                or new):
+            self.but_cancel = self.win.add_button(gtk.STOCK_CANCEL,
+                gtk.RESPONSE_CANCEL)
+        else:
+            self.but_cancel = self.win.add_button(gtk.STOCK_DELETE,
+                gtk.RESPONSE_CANCEL)
 
         if new and self.many:
             self.but_new = self.win.add_button(gtk.STOCK_NEW,

Reply via email to