[tryton-debian-vcs] tryton-client branch upstream-3.6 updated. upstream/3.6.5-1-g68b87eb
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Wed Feb 10 19:53:00 UTC 2016
The following commit has been merged in the upstream-3.6 branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-client.git;a=commitdiff;h=upstream/3.6.5-1-g68b87eb
commit 68b87ebad85a1f0bf630ddf624dc77b7a8255cb6
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Wed Feb 10 19:06:46 2016 +0100
Adding upstream version 3.6.6.
Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>
diff --git a/CHANGELOG b/CHANGELOG
index 0acda64..6b80793 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.6.6 - 2016-02-06
+* Bug fixes (see mercurial logs for details)
+
Version 3.6.5 - 2016-01-11
* Bug fixes (see mercurial logs for details)
diff --git a/PKG-INFO b/PKG-INFO
index 55c480a..b69ecd5 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: tryton
-Version: 3.6.5
+Version: 3.6.6
Summary: Tryton client
Home-page: http://www.tryton.org/
Author: Tryton
diff --git a/tryton.egg-info/PKG-INFO b/tryton.egg-info/PKG-INFO
index 55c480a..b69ecd5 100644
--- a/tryton.egg-info/PKG-INFO
+++ b/tryton.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: tryton
-Version: 3.6.5
+Version: 3.6.6
Summary: Tryton client
Home-page: http://www.tryton.org/
Author: Tryton
diff --git a/tryton/__init__.py b/tryton/__init__.py
index 54b4e63..232f8ab 100644
--- a/tryton/__init__.py
+++ b/tryton/__init__.py
@@ -1,3 +1,3 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
-__version__ = "3.6.5"
+__version__ = "3.6.6"
diff --git a/tryton/gui/window/view_form/model/field.py b/tryton/gui/window/view_form/model/field.py
index 1c70c04..bd15eb6 100644
--- a/tryton/gui/window/view_form/model/field.py
+++ b/tryton/gui/window/view_form/model/field.py
@@ -67,10 +67,13 @@ class Field(object):
context.update(record.expr_eval(self.attrs.get('context', {})))
return context
+ def _is_empty(self, record):
+ return not self.get_eval(record)
+
def check_required(self, record):
state_attrs = self.get_state_attrs(record)
if bool(int(state_attrs.get('required') or 0)):
- if (not self.get_eval(record)
+ if (self._is_empty(record)
and not bool(int(state_attrs.get('readonly') or 0))):
return False
return True
@@ -252,6 +255,9 @@ class TimeField(Field):
_default = None
+ def _is_empty(self, record):
+ return self.get(record) is None
+
def set_client(self, record, value, force_change=False):
if isinstance(value, datetime.datetime):
value = value.time()
@@ -266,6 +272,9 @@ class TimeDeltaField(Field):
_default = None
+ def _is_empty(self, record):
+ return self.get(record) is None
+
def converter(self, record):
# TODO allow local context converter
return rpc.CONTEXT.get(self.attrs.get('converter'))
@@ -285,13 +294,8 @@ class FloatField(Field):
_default = None
default_digits = (16, 2)
- def check_required(self, record):
- state_attrs = self.get_state_attrs(record)
- if bool(int(state_attrs.get('required') or 0)):
- if (self.get(record) is None
- and not bool(int(state_attrs.get('readonly') or 0))):
- return False
- return True
+ def _is_empty(self, record):
+ return self.get(record) is None
def get(self, record):
return record.value.get(self.name, self._default)
@@ -605,7 +609,6 @@ class O2MField(Field):
new_record.set_default(vals)
group.add(new_record)
else:
- new_record.id *= -1 # Don't consider record as unsaved
new_record.set(vals)
group.append(new_record)
diff --git a/tryton/gui/window/view_form/view/form_gtk/calendar.py b/tryton/gui/window/view_form/view/form_gtk/calendar.py
index dac644b..63907d6 100644
--- a/tryton/gui/window/view_form/view/form_gtk/calendar.py
+++ b/tryton/gui/window/view_form/view/form_gtk/calendar.py
@@ -3,6 +3,8 @@
import gtk
import gettext
+import gobject
+
from .widget import Widget
from tryton.common.datetime_ import (Date as DateEntry, Time as TimeEntry,
DateTime as DateTimeEntry, add_operators)
@@ -79,6 +81,7 @@ class Time(Date):
def __init__(self, view, attrs):
super(Time, self).__init__(view, attrs, _entry=TimeEntry)
self.entry.set_focus_chain([self.entry.get_child()])
+ self.entry.connect('time-changed', self.changed)
def _color_widget(self):
return self.entry.child
@@ -100,6 +103,15 @@ class Time(Date):
format_ = '%X'
self.entry.props.format = format_
+ def changed(self, combobox):
+ def focus_out():
+ if combobox.props.window:
+ self._focus_out()
+ # Only when changed from pop list
+ if not combobox.get_child().has_focus():
+ # Must be deferred because it triggers a display of the form
+ gobject.idle_add(focus_out)
+
class DateTime(Date):
def __init__(self, view, attrs):
diff --git a/tryton/gui/window/view_form/view/list_gtk/widget.py b/tryton/gui/window/view_form/view/list_gtk/widget.py
index e1aedaa..1405abc 100644
--- a/tryton/gui/window/view_form/view/list_gtk/widget.py
+++ b/tryton/gui/window/view_form/view/list_gtk/widget.py
@@ -407,7 +407,7 @@ class Time(Date):
if not record:
return ''
value = record[self.attrs['name']].get_client(record)
- if value:
+ if value is not None:
return value.strftime(self.renderer.props.format)
else:
return ''
--
tryton-client
More information about the tryton-debian-vcs
mailing list