Reviewers: ,


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

Affected files:
  M tryton/gui/window/view_form/view/form_gtk/many2one.py


Index: tryton/gui/window/view_form/view/form_gtk/many2one.py
===================================================================

--- a/tryton/gui/window/view_form/view/form_gtk/many2one.py
+++ b/tryton/gui/window/view_form/view/form_gtk/many2one.py
@@ -106,7 +106,7 @@
     def id_from_value(value):
         return value

-    def sig_activate(self, widget, event=None, key_press=False):
+    def sig_activate(self, widget=None, event=None, key_press=False):
         if not common.MODELACCESS[self.get_model()]['read']:
             return
         if not self.focus_out or not self.field:
@@ -117,7 +117,7 @@

         self.focus_out = False
         if model and not self.has_target(value):
-            if not key_press and not event:
+            if not key_press and not event and widget:
                 widget.emit_stop_by_name('activate')
             if (not self._readonly
                     and (self.wid_text.get_text()
@@ -282,7 +282,8 @@
         return False

     def set_value(self, record, field):
-        pass  # No update of the model, the model is updated in real time !
+        # Simulate a focus-out
+        self.sig_activate()

     def set_text(self, value):
         if not value:



--
tryton-dev@googlegroups.com mailing list

Reply via email to