[tryton-debian-vcs] tryton-client branch debian updated. debian/3.6.2-1-2-g81fdf61

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Mon Sep 21 12:24:40 UTC 2015


The following commit has been merged in the debian branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-client.git;a=commitdiff;h=debian/3.6.2-1-2-g81fdf61

commit 81fdf611f181eaa40d774a0d841bc1e927423bb1
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sun Sep 20 19:45:37 2015 +0200

    Releasing debian version 3.6.3-1.
    
    Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>

diff --git a/debian/changelog b/debian/changelog
index 2983dd5..0d96757 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+tryton-client (3.6.3-1) unstable; urgency=medium
+
+  * Merging upstream version 3.6.3.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Sun, 20 Sep 2015 19:45:37 +0200
+
 tryton-client (3.6.2-1) unstable; urgency=medium
 
   * Adapting section naming in gbp.conf to current git-buildpackage.
commit 2ccb401259e3ce2ae9c57d49a59cbf1e8d820f9b
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sun Sep 20 19:45:36 2015 +0200

    Merging upstream version 3.6.3.

diff --git a/CHANGELOG b/CHANGELOG
index c6e0f2b..a64a66d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.6.3 - 2015-09-08
+* Bug fixes (see mercurial logs for details)
+
 Version 3.6.2 - 2015-07-13
 * Bug fixes (see mercurial logs for details)
 
diff --git a/PKG-INFO b/PKG-INFO
index af5290e..926ed32 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: tryton
-Version: 3.6.2
+Version: 3.6.3
 Summary: Tryton client
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/doc/usage.rst b/doc/usage.rst
index b32f63e..6ba5c44 100644
--- a/doc/usage.rst
+++ b/doc/usage.rst
@@ -49,6 +49,11 @@ Options
 
 -s SERVER, --server=SERVER           Specify the server hostname
 
+Environment
+***********
+
+`GTKOSXAPPLICATION`                  Activate with native Mac desktop
+
 URL
 ***
 
@@ -481,16 +486,6 @@ Save Tree Expanded State:
 Spell Checking:
   Check box to enable spell checking in fields.
 
-.. _Menu-Options-Form-Tabs_Position:
-
-Tabs Position
-  Sets up the position of the :term:`tabs` inside :term:`views`:
-
-  * Top
-  * Left
-  * Right
-  * Bottom
-
 .. _Menu-Options-Email:
 
 Email...:
diff --git a/tryton.egg-info/PKG-INFO b/tryton.egg-info/PKG-INFO
index af5290e..926ed32 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.2
+Version: 3.6.3
 Summary: Tryton client
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/tryton/__init__.py b/tryton/__init__.py
index db5050e..4fd62c1 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.2"
+__version__ = "3.6.3"
diff --git a/tryton/common/common.py b/tryton/common/common.py
index dc27950..ee2a494 100644
--- a/tryton/common/common.py
+++ b/tryton/common/common.py
@@ -453,8 +453,8 @@ def file_selection(title, filename='',
         filename = win.get_preview_filename()
         if filename:
             try:
-                pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(filename.decode(
-                        sys.getfilesystemencoding().encode('utf-8')), 128, 128)
+                pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(
+                    filename, 128, 128)
                 img.set_from_pixbuf(pixbuf)
                 have_preview = True
             except (IOError, glib.GError):
diff --git a/tryton/common/datetime_.py b/tryton/common/datetime_.py
index b1507c4..1b8de7a 100644
--- a/tryton/common/datetime_.py
+++ b/tryton/common/datetime_.py
@@ -154,7 +154,7 @@ class Date(gtk.Entry):
         self.emit('date-changed')
         return False
 
-    def activate(self, entry):
+    def activate(self, entry=None):
         self.parse()
         self.update_label()
         self.emit('date-changed')
@@ -293,7 +293,7 @@ class Time(gtk.ComboBoxEntry):
         self.emit('time-changed')
         return False
 
-    def activate(self, entry):
+    def activate(self, entry=None):
         self.parse()
         self.update_label()
         self.emit('time-changed')
diff --git a/tryton/common/domain_parser.py b/tryton/common/domain_parser.py
index 2f93858..abee926 100644
--- a/tryton/common/domain_parser.py
+++ b/tryton/common/domain_parser.py
@@ -12,6 +12,8 @@ from collections import OrderedDict
 
 from tryton.common import untimezoned_date, timezoned_date, datetime_strftime
 from tryton.common.datetime_ import date_parse
+from tryton.common.timedelta import parse as timedelta_parse
+from tryton.common.timedelta import format as timedelta_format
 from tryton.pyson import PYSONDecoder
 
 __all__ = ['DomainParser']
@@ -288,6 +290,9 @@ def convert_value(field, value, context=None):
         except (ValueError, TypeError):
             return
 
+    def convert_timedelta():
+        return timedelta_parse(value, context.get(field.get('converter')))
+
     def convert_many2one():
         if value == '':
             return None
@@ -303,6 +308,7 @@ def convert_value(field, value, context=None):
         'datetime': convert_datetime,
         'date': convert_date,
         'time': convert_time,
+        'timedelta': convert_timedelta,
         'many2one': convert_many2one,
         }
     return converts.get(field['type'], lambda: value)()
@@ -430,6 +436,18 @@ def test_convert_time():
         assert convert_value(field, value) == result
 
 
+def test_convert_timedelta():
+    field = {
+        'type': 'timedelta',
+        }
+    for value, result in [
+            ('1d 2:00', datetime.timedelta(days=1, hours=2)),
+            ('foo', datetime.timedelta()),
+            (None, None),
+            ]:
+        assert convert_value(field, value) == result
+
+
 def format_value(field, value, target=None, context=None):
     "Format value for field"
     if context is None:
@@ -487,6 +505,11 @@ def format_value(field, value, target=None, context=None):
             return ''
         return datetime.time.strftime(value, time_format(field))
 
+    def format_timedelta():
+        if not value:
+            return ''
+        return timedelta_format(value, context.get(field.get('converter')))
+
     def format_many2one():
         if value is None:
             return ''
@@ -502,6 +525,7 @@ def format_value(field, value, target=None, context=None):
         'datetime': format_datetime,
         'date': format_date,
         'time': format_time,
+        'timedelta': format_timedelta,
         'many2one': format_many2one,
         }
     if isinstance(value, (list, tuple)):
@@ -634,6 +658,19 @@ def test_format_time():
         assert format_value(field, value) == result
 
 
+def test_format_timedelta():
+    field = {
+        'type': 'timedelta',
+        }
+    for value, result in [
+            (datetime.timedelta(days=1, hours=2), '"1d 02:00"'),
+            (datetime.timedelta(), ''),
+            (None, ''),
+            ('', ''),
+            ]:
+        assert format_value(field, value) == result
+
+
 def complete_value(field, value):
     "Complete value for field"
 
diff --git a/tryton/config.py b/tryton/config.py
index a58bce9..a71b8ab 100644
--- a/tryton/config.py
+++ b/tryton/config.py
@@ -19,7 +19,8 @@ _ = gettext.gettext
 
 def get_home_dir():
     if os.name == 'nt':
-        return os.path.join(os.environ['HOMEDRIVE'], os.environ['HOMEPATH'])
+        return os.path.join(os.environ['HOMEDRIVE'], os.environ['HOMEPATH']
+            ).decode(sys.getfilesystemencoding()).encode('utf-8')
     return os.environ['HOME']
 
 
diff --git a/tryton/gui/main.py b/tryton/gui/main.py
index 7d30662..4dbb7ff 100644
--- a/tryton/gui/main.py
+++ b/tryton/gui/main.py
@@ -42,9 +42,9 @@ import tryton.plugins
 from tryton.common.placeholder_entry import PlaceholderEntry
 import pango
 import time
-try:
+if os.environ.get('GTKOSXAPPLICATION'):
     import gtkosx_application
-except ImportError:
+else:
     gtkosx_application = None
 try:
     import gtkspell
diff --git a/tryton/gui/window/form.py b/tryton/gui/window/form.py
index 6fcab91..ca68ac1 100644
--- a/tryton/gui/window/form.py
+++ b/tryton/gui/window/form.py
@@ -246,6 +246,8 @@ class Form(SignalEvent, TabContent):
                 [x[0] for x in fields], context=self.screen.context)
         except RPCException:
             return
+        date_format = self.screen.context.get('date_format', '%x')
+        datetime_format = date_format + ' %X.%f'
         message_str = ''
         for line in res:
             for (key, val) in fields:
@@ -253,7 +255,7 @@ class Form(SignalEvent, TabContent):
                 if line.get(key, False) \
                         and key in ('create_date', 'write_date'):
                     date = timezoned_date(line[key])
-                    value = common.datetime_strftime(date, '%X')
+                    value = common.datetime_strftime(date, datetime_format)
                 message_str += val + ' ' + value + '\n'
         message_str += _('Model:') + ' ' + self.model
         message(message_str)
diff --git a/tryton/gui/window/view_form/model/field.py b/tryton/gui/window/view_form/model/field.py
index da2b16c..45f2be1 100644
--- a/tryton/gui/window/view_form/model/field.py
+++ b/tryton/gui/window/view_form/model/field.py
@@ -210,8 +210,10 @@ class DateTimeField(Field):
         elif value and not isinstance(value, datetime.datetime):
             current_value = self.get_client(record)
             if current_value:
-                value = datetime.datetime.combine(
-                    value, current_value.time())
+                time = current_value.time()
+            else:
+                time = datetime.time()
+            value = datetime.datetime.combine(value, time)
         if value:
             value = common.untimezoned_date(value)
         super(DateTimeField, self).set_client(record, value,
diff --git a/tryton/gui/window/view_form/model/record.py b/tryton/gui/window/view_form/model/record.py
index 3beed43..9637f45 100644
--- a/tryton/gui/window/view_form/model/record.py
+++ b/tryton/gui/window/view_form/model/record.py
@@ -275,7 +275,8 @@ class Record(SignalEvent):
     def get_timestamp(self):
         result = {self.model_name + ',' + str(self.id): self._timestamp}
         for name, field in self.group.fields.iteritems():
-            result.update(field.get_timestamp(self))
+            if name in self._loaded:
+                result.update(field.get_timestamp(self))
         return result
 
     def pre_validate(self):
diff --git a/tryton/gui/window/view_form/screen/screen.py b/tryton/gui/window/view_form/screen/screen.py
index 34b0562..61cee60 100644
--- a/tryton/gui/window/view_form/screen/screen.py
+++ b/tryton/gui/window/view_form/screen/screen.py
@@ -142,7 +142,9 @@ class Screen(SignalEvent):
                         if type_ == 'datetime':
                             fields[name]['format'] = '"%H:%M:%S"'
 
-                self.domain_parser = DomainParser(fields)
+                context = rpc.CONTEXT.copy()
+                context.update(self.context)
+                self.domain_parser = DomainParser(fields, context)
 
             self.screen_container.set_screen(self)
             self.screen_container.show_filter()
diff --git a/tryton/gui/window/view_form/view/list.py b/tryton/gui/window/view_form/view/list.py
index 988f043..ffcc948 100644
--- a/tryton/gui/window/view_form/view/list.py
+++ b/tryton/gui/window/view_form/view/list.py
@@ -227,7 +227,7 @@ class AdaptModelGroup(gtk.GenericTreeModel):
             return False
         children = record.children_group(self.children_field)
         if children is None:
-            return True
+            return False
         length = len(children)
         if self.__removed and self.__removed in children:
             length -= 1
@@ -235,7 +235,10 @@ class AdaptModelGroup(gtk.GenericTreeModel):
 
     def on_iter_children(self, record):
         if record is None:
-            return None
+            if self.group:
+                return self.group[0]
+            else:
+                return None
         if self.children_field:
             children = record.children_group(self.children_field)
             if children:
@@ -243,15 +246,19 @@ class AdaptModelGroup(gtk.GenericTreeModel):
         return None
 
     def on_iter_n_children(self, record):
-        if record is None or not self.children_field:
+        if record is None:
             return len(self.group)
+        if not self.children_field:
+            return 0
         return len(record.children_group(self.children_field))
 
     def on_iter_nth_child(self, record, nth):
-        if record is None or not self.children_field:
+        if record is None:
             if nth < len(self.group):
                 return self.group[nth]
             return None
+        if not self.children_field:
+            return None
         if nth < len(record.children_group(self.children_field)):
             return record.children_group(self.children_field)[nth]
         return None
diff --git a/tryton/gui/window/view_form/view/list_gtk/editabletree.py b/tryton/gui/window/view_form/view/list_gtk/editabletree.py
index 6d244f3..460b6c0 100644
--- a/tryton/gui/window/view_form/view/list_gtk/editabletree.py
+++ b/tryton/gui/window/view_form/view/list_gtk/editabletree.py
@@ -111,6 +111,7 @@ class EditableTreeView(TreeView):
         if hasattr(field, 'editabletree_entry'):
             entry = field.editabletree_entry
             if isinstance(entry, (Date, Time)):
+                entry.activate()
                 txt = entry.props.value
             if isinstance(entry, gtk.Entry):
                 txt = entry.get_text()
@@ -144,6 +145,7 @@ class EditableTreeView(TreeView):
 
         if event.keyval in self.leaving_events or leaving:
             if isinstance(entry, (Date, Time)):
+                entry.activate()
                 txt = entry.props.value
             elif isinstance(entry, gtk.Entry):
                 txt = entry.get_text()
@@ -263,6 +265,7 @@ class EditableTreeView(TreeView):
         model = self.get_model()
         record = model.get_value(model.get_iter(path), 0)
         if isinstance(entry, (Date, Time)):
+            entry.activate()
             self.on_quit_cell(record, column, entry.props.value)
         elif isinstance(entry, gtk.Entry):
             self.on_quit_cell(record, column, entry.get_text())
-- 
tryton-client



More information about the tryton-debian-vcs mailing list