[tryton-debian-vcs] tryton-server branch upstream updated. upstream/3.0.2-1-gd465352

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Wed Mar 26 19:50:14 UTC 2014


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

commit d465352ac7e658d4411bd53bac35080aed9a0910
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Mar 26 18:44:24 2014 +0100

    Adding upstream version 3.0.3.

diff --git a/CHANGELOG b/CHANGELOG
index 827c7db..86ffc80 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.0.3 - 2014-03-22
+* Bug fixes (see mercurial logs for details)
+
 Version 3.0.2 - 2014-01-18
 * Bug fixes (see mercurial logs for details)
 
diff --git a/COPYRIGHT b/COPYRIGHT
index 59d0304..56848fa 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,7 +1,7 @@
 Copyright (C) 2004-2008 Tiny SPRL.
-Copyright (C) 2007-2013 Cédric Krier.
+Copyright (C) 2007-2014 Cédric Krier.
 Copyright (C) 2007-2013 Bertrand Chenal.
-Copyright (C) 2008-2013 B2CK SPRL.
+Copyright (C) 2008-2014 B2CK SPRL.
 Copyright (C) 2011 Openlabs Technologies & Consulting (P) Ltd.
 
 This program is free software: you can redistribute it and/or modify
diff --git a/PKG-INFO b/PKG-INFO
index 9fd8c2a..2d31743 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond
-Version: 3.0.2
+Version: 3.0.3
 Summary: Tryton server
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/doc/topics/views/index.rst b/doc/topics/views/index.rst
index 1b1ff00..bf9da74 100644
--- a/doc/topics/views/index.rst
+++ b/doc/topics/views/index.rst
@@ -303,14 +303,10 @@ Display a button.
 
     * ``string``: The string that will be displayed inside the button.
 
-    * ``name``: The name of the action:
+    * ``name``: The name of the function that will be called. The function must
+      have this syntax:
 
-        * ``object``: the name of the function that will called.  The function
-          must have this syntax:
-
-          ``button(self, ids)``
-
-        * ``action``: the id of the ir.action that will be called.
+        ``button(cls, records)``
 
     * ``icon``
 
diff --git a/trytond.egg-info/PKG-INFO b/trytond.egg-info/PKG-INFO
index 9fd8c2a..2d31743 100644
--- a/trytond.egg-info/PKG-INFO
+++ b/trytond.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond
-Version: 3.0.2
+Version: 3.0.3
 Summary: Tryton server
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/trytond/backend/sqlite/database.py b/trytond/backend/sqlite/database.py
index d754289..d0e4b52 100644
--- a/trytond/backend/sqlite/database.py
+++ b/trytond/backend/sqlite/database.py
@@ -356,23 +356,21 @@ class Cursor(CursorInterface):
         self._conn.rollback()
 
     def test(self):
-        sqlite_master = Table('sqlite_master')
-        select = sqlite_master.select(sqlite_master.name)
-        select.where = sqlite_master.type == 'table'
-        select.where &= sqlite_master.name.in_([
-                'ir_model',
-                'ir_model_field',
-                'ir_ui_view',
-                'ir_ui_menu',
-                'res_user',
-                'res_group',
-                'ir_module_module',
-                'ir_module_module_dependency',
-                'ir_translation',
-                'ir_lang',
-                ])
         try:
-            self.cursor.execute(*select)
+            self.cursor.execute("SELECT name "
+                "FROM sqlite_master "
+                "WHERE type = 'table' AND name in ("
+                    "'ir_model', "
+                    "'ir_model_field', "
+                    "'ir_ui_view', "
+                    "'ir_ui_menu', "
+                    "'res_user', "
+                    "'res_group', "
+                    "'ir_module_module', "
+                    "'ir_module_module_dependency', "
+                    "'ir_translation', "
+                    "'ir_lang'"
+                    ")")
         except Exception:
             return False
         return len(self.cursor.fetchall()) != 0
diff --git a/trytond/ir/translation.py b/trytond/ir/translation.py
index 3f13f68..e6a3f57 100644
--- a/trytond/ir/translation.py
+++ b/trytond/ir/translation.py
@@ -791,7 +791,7 @@ class Translation(ModelSQL, ModelView):
             if len(module_translations) <= RECORD_CACHE_SIZE:
                 id2translation[translation.id] = translation
 
-        def override_translation(ressource_id, new_translation, fuzzy):
+        def override_translation(ressource_id, new_translation, src, fuzzy):
             res_id_module, res_id = ressource_id.split('.')
             if res_id:
                 model_data, = ModelData.search([
@@ -803,13 +803,17 @@ class Translation(ModelSQL, ModelView):
                 res_id = -1
             with contextlib.nested(Transaction().set_user(0),
                     Transaction().set_context(module=res_id_module)):
-                translation, = cls.search([
-                        ('name', '=', name),
-                        ('res_id', '=', res_id),
-                        ('lang', '=', lang),
-                        ('type', '=', ttype),
-                        ('module', '=', res_id_module),
-                        ])
+                domain = [
+                    ('name', '=', name),
+                    ('res_id', '=', res_id),
+                    ('lang', '=', lang),
+                    ('type', '=', ttype),
+                    ('module', '=', res_id_module),
+                    ]
+                if ttype in ('odt', 'view', 'wizard_button', 'selection',
+                        'error'):
+                    domain.append(('src', '=', src))
+                translation, = cls.search(domain)
                 if translation.value != new_translation:
                     translation.value = new_translation
                     translation.overriding_module = module
@@ -835,7 +839,7 @@ class Translation(ModelSQL, ModelView):
                 noupdate = False
 
                 if '.' in res_id:
-                    override_translation(res_id, value, fuzzy)
+                    override_translation(res_id, value, ttype, fuzzy)
                     continue
 
                 model = name.split(',')[0]
diff --git a/trytond/ir/trigger.py b/trytond/ir/trigger.py
index a0c78c4..c04842d 100644
--- a/trytond/ir/trigger.py
+++ b/trytond/ir/trigger.py
@@ -27,8 +27,8 @@ class Trigger(ModelSQL, ModelView):
     model = fields.Many2One('ir.model', 'Model', required=True, select=True)
     on_time = fields.Boolean('On Time', select=True, states={
             'invisible': (Eval('on_create', False)
-                or Eval('on_write', False)
-                or Eval('on_delete', False)),
+                | Eval('on_write', False)
+                | Eval('on_delete', False)),
         }, depends=['on_create', 'on_write', 'on_delete'],
         on_change=['on_time'])
     on_create = fields.Boolean('On Create', select=True, states={
diff --git a/trytond/model/modelsql.py b/trytond/model/modelsql.py
index 3f81ca8..798a893 100644
--- a/trytond/model/modelsql.py
+++ b/trytond/model/modelsql.py
@@ -1083,12 +1083,12 @@ class ModelSQL(ModelStorage):
         table = cls.__table__()
         right = left + 1
 
-        childs = cls.search([
-                (parent, '=', parent_id),
-                ], order=[])
+        cursor.execute(*table.select(table.id,
+                where=Column(table, parent) == parent_id))
+        childs = cursor.fetchall()
 
-        for child in childs:
-            right = cls._rebuild_tree(parent, child.id, right)
+        for child_id, in childs:
+            right = cls._rebuild_tree(parent, child_id, right)
 
         field = cls._fields[parent]
 
diff --git a/trytond/tests/test_mptt.py b/trytond/tests/test_mptt.py
index faff5a3..5b5fd49 100644
--- a/trytond/tests/test_mptt.py
+++ b/trytond/tests/test_mptt.py
@@ -19,9 +19,10 @@ class MPTTTestCase(unittest.TestCase):
         self.mptt = POOL.get('test.mptt')
 
     def CheckTree(self, parent_id=None, left=-1, right=sys.maxint):
-        childs = self.mptt.search([
-                ('parent', '=', parent_id),
-                ], order=[('left', 'ASC')])
+        with Transaction().set_context(active_test=False):
+            childs = self.mptt.search([
+                    ('parent', '=', parent_id),
+                    ], order=[('left', 'ASC')])
         for child in childs:
             assert child.left > left, \
                 '%s: left %d <= parent left %d' % \
@@ -112,6 +113,16 @@ class MPTTTestCase(unittest.TestCase):
         with Transaction().start(DB_NAME, USER,
                 context=CONTEXT) as transaction:
             records = self.mptt.search([])
+            self.mptt.write(records[::2], {
+                    'active': False
+                    })
+            self.CheckTree()
+
+            transaction.cursor.rollback()
+
+        with Transaction().start(DB_NAME, USER,
+                context=CONTEXT) as transaction:
+            records = self.mptt.search([])
             self.mptt.write(records[:len(records) // 2], {
                     'active': False
                     })
diff --git a/trytond/tests/workflow.py b/trytond/tests/workflow.py
index be43445..2724b8a 100644
--- a/trytond/tests/workflow.py
+++ b/trytond/tests/workflow.py
@@ -25,7 +25,7 @@ class WorkflowedModel(Workflow, ModelSQL):
                 ))
 
     @staticmethod
-    def default_state(cls):
+    def default_state():
         return 'start'
 
     @classmethod
diff --git a/trytond/version.py b/trytond/version.py
index 37aca7a..08eb75c 100644
--- a/trytond/version.py
+++ b/trytond/version.py
@@ -1,6 +1,6 @@
 #This file is part of Tryton.  The COPYRIGHT file at the top level of
 #this repository contains the full copyright notices and license terms.
 PACKAGE = "trytond"
-VERSION = "3.0.2"
+VERSION = "3.0.3"
 LICENSE = "GPL-3"
 WEBSITE = "http://www.tryton.org/"
-- 
tryton-server



More information about the tryton-debian-vcs mailing list