[tryton-debian-vcs] tryton-proteus branch debian updated. debian/4.0.3-1-3-gd012666

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Tue Dec 6 16:11:26 UTC 2016


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

commit d0126666594c183da9061d311b7b7308c9dc00e5
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Dec 6 10:58:33 2016 +0100

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

diff --git a/debian/changelog b/debian/changelog
index b749c48..0d96279 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+tryton-proteus (4.2.0-1) unstable; urgency=medium
+
+  * Merging upstream version 4.2.0.
+  * Updating the Depends for 4.2.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Mon, 05 Dec 2016 15:31:43 +0100
+
 tryton-proteus (4.0.3-1) unstable; urgency=medium
 
   * Merging upstream version 4.0.3.
commit 7f0902f5f12bf857c2ca3a5b68bf532ba20c477d
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Mon Dec 5 10:05:33 2016 +0100

    Updating the Depends for 4.2.

diff --git a/debian/control b/debian/control
index 1c4ecd8..ac6e8ce 100644
--- a/debian/control
+++ b/debian/control
@@ -22,7 +22,6 @@ Architecture: all
 Depends:
  python-dateutil,
  python-pkg-resources,
- python-simplejson,
  ${misc:Depends},
  ${python:Depends},
 Suggests: tryton-server
commit 9014dfbb960628870ffe8643309fd3505ac2efe5
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Mon Dec 5 09:34:53 2016 +0100

    Merging upstream version 4.2.0.

diff --git a/CHANGELOG b/CHANGELOG
index e26b764..7679b52 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,11 +1,6 @@
-Version 4.0.3 - 2016-11-06
-* Bug fixes (see mercurial logs for details)
-
-Version 4.0.2 - 2016-09-03
-* Bug fixes (see mercurial logs for details)
-
-Version 4.0.1 - 2016-08-02
+Version 4.2.0 - 2016-11-28
 * Bug fixes (see mercurial logs for details)
+* Fill default Report data
 
 Version 4.0.0 - 2016-05-02
 * Bug fixes (see mercurial logs for details)
diff --git a/INSTALL b/INSTALL
index fb3635e..66e2493 100644
--- a/INSTALL
+++ b/INSTALL
@@ -7,7 +7,6 @@ Prerequisites
  * Python 2.7 or later (http://www.python.org/)
  * python-dateutil (http://labix.org/python-dateutil)
  * Optional: trytond (http://www.tryton.org/)
- * Optional: simplejson (http://undefined.org/python/#simplejson)
  * Optional: cdecimal (http://www.bytereef.org/mpdecimal/index.html)
 
 Installation
@@ -25,5 +24,5 @@ site-packages directory on your system.
 For advanced options, please refer to the easy_install and/or the distutils
 documentation:
 
-  http://peak.telecommunity.com/DevCenter/EasyInstall
+  http://setuptools.readthedocs.io/en/latest/easy_install.html
   http://docs.python.org/inst/inst.html
diff --git a/PKG-INFO b/PKG-INFO
index 2266a9f..8278c40 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: proteus
-Version: 4.0.3
+Version: 4.2.0
 Summary: Library to access Tryton server as a client
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: issue_tracker at tryton.org
 License: LGPL-3
-Download-URL: http://downloads.tryton.org/4.0/
+Download-URL: http://downloads.tryton.org/4.2/
 Description: proteus
         =======
         
@@ -32,12 +32,12 @@ Description: proteus
         Installing a module
         ~~~~~~~~~~~~~~~~~~~
         
-        Find the module, call the install button and run the install wizard.
+        Find the module, call the activate button and run the upgrade wizard.
         
             >>> Module = Model.get('ir.module')
             >>> party_module, = Module.find([('name', '=', 'party')])
-            >>> party_module.click('install')
-            >>> Wizard('ir.module.install_upgrade').execute('upgrade')
+            >>> party_module.click('activate')
+            >>> Wizard('ir.module.activate_upgrade').execute('upgrade')
         
         Creating a party
         ~~~~~~~~~~~~~~~~
@@ -68,11 +68,11 @@ Description: proteus
         `Model` instance as value.
         
             >>> Lang = Model.get('ir.lang')
-            >>> (en,) = Lang.find([('code', '=', 'en_US')])
+            >>> en, = Lang.find([('code', '=', 'en')])
             >>> party.lang = en
             >>> party.save()
             >>> party.lang.code
-            u'en_US'
+            u'en'
         
         Creating an address for the party
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/README b/README
index 8d58603..91ea807 100644
--- a/README
+++ b/README
@@ -23,12 +23,12 @@ Configuration to connect to a sqlite memory database using trytond as module.
 Installing a module
 ~~~~~~~~~~~~~~~~~~~
 
-Find the module, call the install button and run the install wizard.
+Find the module, call the activate button and run the upgrade wizard.
 
     >>> Module = Model.get('ir.module')
     >>> party_module, = Module.find([('name', '=', 'party')])
-    >>> party_module.click('install')
-    >>> Wizard('ir.module.install_upgrade').execute('upgrade')
+    >>> party_module.click('activate')
+    >>> Wizard('ir.module.activate_upgrade').execute('upgrade')
 
 Creating a party
 ~~~~~~~~~~~~~~~~
@@ -59,11 +59,11 @@ The language on party is a `Many2One` relation field. So it requires to get a
 `Model` instance as value.
 
     >>> Lang = Model.get('ir.lang')
-    >>> (en,) = Lang.find([('code', '=', 'en_US')])
+    >>> en, = Lang.find([('code', '=', 'en')])
     >>> party.lang = en
     >>> party.save()
     >>> party.lang.code
-    u'en_US'
+    u'en'
 
 Creating an address for the party
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/proteus.egg-info/PKG-INFO b/proteus.egg-info/PKG-INFO
index 2266a9f..8278c40 100644
--- a/proteus.egg-info/PKG-INFO
+++ b/proteus.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: proteus
-Version: 4.0.3
+Version: 4.2.0
 Summary: Library to access Tryton server as a client
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: issue_tracker at tryton.org
 License: LGPL-3
-Download-URL: http://downloads.tryton.org/4.0/
+Download-URL: http://downloads.tryton.org/4.2/
 Description: proteus
         =======
         
@@ -32,12 +32,12 @@ Description: proteus
         Installing a module
         ~~~~~~~~~~~~~~~~~~~
         
-        Find the module, call the install button and run the install wizard.
+        Find the module, call the activate button and run the upgrade wizard.
         
             >>> Module = Model.get('ir.module')
             >>> party_module, = Module.find([('name', '=', 'party')])
-            >>> party_module.click('install')
-            >>> Wizard('ir.module.install_upgrade').execute('upgrade')
+            >>> party_module.click('activate')
+            >>> Wizard('ir.module.activate_upgrade').execute('upgrade')
         
         Creating a party
         ~~~~~~~~~~~~~~~~
@@ -68,11 +68,11 @@ Description: proteus
         `Model` instance as value.
         
             >>> Lang = Model.get('ir.lang')
-            >>> (en,) = Lang.find([('code', '=', 'en_US')])
+            >>> en, = Lang.find([('code', '=', 'en')])
             >>> party.lang = en
             >>> party.save()
             >>> party.lang.code
-            u'en_US'
+            u'en'
         
         Creating an address for the party
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/proteus.egg-info/requires.txt b/proteus.egg-info/requires.txt
index 4e8fa73..b1a68ae 100644
--- a/proteus.egg-info/requires.txt
+++ b/proteus.egg-info/requires.txt
@@ -3,8 +3,5 @@ python-dateutil
 [cdecimal]
 cdecimal
 
-[simplejson]
-simplejson
-
 [trytond]
-trytond >= 4.0, < 4.1
+trytond >= 4.2, < 4.3
diff --git a/proteus/__init__.py b/proteus/__init__.py
index e710f4b..125f160 100644
--- a/proteus/__init__.py
+++ b/proteus/__init__.py
@@ -3,7 +3,7 @@
 '''
 A library to access Tryton's models like a client.
 '''
-__version__ = "4.0.3"
+__version__ = "4.2.0"
 __all__ = ['Model', 'Wizard', 'Report']
 import sys
 try:
@@ -874,15 +874,15 @@ class Model(object):
             if definition['type'] in ('one2many', 'many2many'):
                 if value and len(value) and isinstance(value[0], (int, long)):
                     self._values[field] = value
-                    continue
-                relation = Model.get(definition['relation'], self._config)
-                records = []
-                for vals in (value or []):
-                    record = relation()
-                    record._default_set(vals)
-                    records.append(record)
-                self._values[field] = ModelList(definition, records, self,
-                    field)
+                else:
+                    relation = Model.get(definition['relation'], self._config)
+                    records = []
+                    for vals in (value or []):
+                        record = relation()
+                        record._default_set(vals)
+                        records.append(record)
+                    self._values[field] = ModelList(definition, records, self,
+                        field)
             else:
                 self._values[field] = value
             fieldnames.append(field)
@@ -1136,9 +1136,14 @@ class Report(object):
         self._proxy = self._config.get_proxy(name, type='report')
 
     def execute(self, models=None, data=None):
-        if data is None:
-            data = {}
         ids = [m.id for m in models] if models else data.get('ids', [])
+        if data is None:
+            data = {
+                'id': ids[0],
+                'ids': ids,
+                }
+            if models:
+                data['model'] = models[0].__class__.__name__
         return self._proxy.execute(ids, data, self._context)
 
 
diff --git a/proteus/pyson.py b/proteus/pyson.py
index 112d6df..0d3645e 100644
--- a/proteus/pyson.py
+++ b/proteus/pyson.py
@@ -2,10 +2,7 @@
 # this repository contains the full copyright notices and license terms.
 __all__ = ['PYSONEncoder', 'PYSONDecoder', 'Eval', 'Not', 'Bool', 'And', 'Or',
     'Equal', 'Greater', 'Less', 'If', 'Get', 'In', 'Date', 'DateTime', 'Len']
-try:
-    import simplejson as json
-except ImportError:
-    import json
+import json
 import datetime
 from dateutil.relativedelta import relativedelta
 from functools import reduce, wraps
@@ -315,10 +312,10 @@ class Greater(PYSON):
         super(Greater, self).__init__()
         for i in (statement1, statement2):
             if isinstance(i, PYSON):
-                assert i.types().issubset(set([int, long, float])), \
+                assert i.types().issubset({int, long, float, type(None)}), \
                     'statement must be an integer or a float'
             else:
-                assert isinstance(i, (int, long, float)), \
+                assert isinstance(i, (int, long, float, type(None))), \
                     'statement must be an integer or a float'
         if isinstance(equal, PYSON):
             assert equal.types() == set([bool])
@@ -346,6 +343,8 @@ class Greater(PYSON):
     @staticmethod
     def _convert(dct):
         for i in ('s1', 's2'):
+            if dct[i] is None:
+                dct[i] = 0.0
             if not isinstance(dct[i], (int, long, float)):
                 dct = dct.copy()
                 dct[i] = float(dct[i])
diff --git a/proteus/tests/test_model.py b/proteus/tests/test_model.py
index 627bdfd..1c3d1df 100644
--- a/proteus/tests/test_model.py
+++ b/proteus/tests/test_model.py
@@ -88,9 +88,9 @@ class TestModel(ProteusTestCase):
         self.assertEqual(User(name='Foo').name, 'Foo')
 
         Lang = Model.get('ir.lang')
-        en_US = Lang.find([('code', '=', 'en_US')])[0]
-        self.assertEqual(User(language=en_US).language, en_US)
-        self.assertEqual(User(language=en_US.id).language, en_US)
+        en, = Lang.find([('code', '=', 'en')])
+        self.assertEqual(User(language=en).language, en)
+        self.assertEqual(User(language=en.id).language, en)
 
         Group = Model.get('res.group')
         groups = Group.find()
@@ -143,10 +143,10 @@ class TestModel(ProteusTestCase):
         test.save()
 
         Lang = Model.get('ir.lang')
-        en_US = Lang.find([('code', '=', 'en_US')])[0]
-        test.language = en_US
+        en, = Lang.find([('code', '=', 'en')])
+        test.language = en
         test.save()
-        self.assertEqual(test.language, en_US)
+        self.assertEqual(test.language, en)
 
         test.language = None
         test.save()
diff --git a/proteus/tests/test_wizard.py b/proteus/tests/test_wizard.py
index 7edf200..cbdf4e6 100644
--- a/proteus/tests/test_wizard.py
+++ b/proteus/tests/test_wizard.py
@@ -18,7 +18,7 @@ class TestWizard(ProteusTestCase):
         Lang = Model.get('ir.lang')
         Module = Model.get('ir.module')
         translation_export = Wizard('ir.translation.export')
-        translation_export.form.language, = Lang.find([('code', '=', 'en_US')])
+        translation_export.form.language, = Lang.find([('code', '=', 'en')])
         translation_export.form.module, = Module.find([('name', '=', 'ir')])
         translation_export.execute('export')
         self.assert_(translation_export.form.file)
diff --git a/setup.py b/setup.py
index 7846c4e..e17376c 100644
--- a/setup.py
+++ b/setup.py
@@ -80,7 +80,6 @@ setup(name=name,
         ],
     extras_require={
         'trytond': [get_require_version('trytond')],
-        'simplejson': ['simplejson'],
         'cdecimal': ['cdecimal'],
         },
     dependency_links=dependency_links,
-- 
tryton-proteus



More information about the tryton-debian-vcs mailing list