[tryton-debian-vcs] tryton-modules-currency branch upstream updated. upstream/3.4.1-1-gb2ace42

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Thu Apr 23 16:03:54 UTC 2015


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

commit b2ace42e43783404236586ef2b31dde16b82bc0e
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Thu Apr 23 16:59:58 2015 +0200

    Adding upstream version 3.6.0.
    
    Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>

diff --git a/CHANGELOG b/CHANGELOG
index b7603af..97f9a22 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,6 @@
-Version 3.4.1 - 2015-02-28
+Version 3.6.0 - 2015-04-20
 * Bug fixes (see mercurial logs for details)
-
+* Add support for PyPy
 Version 3.4.0 - 2014-10-20
 * Bug fixes (see mercurial logs for details)
 
diff --git a/PKG-INFO b/PKG-INFO
index e2a9094..0e45ace 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_currency
-Version: 3.4.1
+Version: 3.6.0
 Summary: Tryton module with currencies
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: issue_tracker at tryton.org
 License: GPL-3
-Download-URL: http://downloads.tryton.org/3.4/
+Download-URL: http://downloads.tryton.org/3.6/
 Description: trytond_currency
         ================
         
@@ -65,4 +65,6 @@ Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Classifier: Programming Language :: Python :: Implementation :: PyPy
 Classifier: Topic :: Office/Business
diff --git a/__init__.py b/__init__.py
index d0e99ec..c50ba06 100644
--- a/__init__.py
+++ b/__init__.py
@@ -1,5 +1,5 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# This file is part of Tryton.  The COPYRIGHT file at the top level of
+# this repository contains the full copyright notices and license terms.
 
 from trytond.pool import Pool
 from .currency import *
diff --git a/currency.py b/currency.py
index e8e1b50..03803b3 100644
--- a/currency.py
+++ b/currency.py
@@ -1,9 +1,11 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level
-#of this repository contains the full copyright notices and license terms.
+# This file is part of Tryton.  The COPYRIGHT file at the top level of
+# this repository contains the full copyright notices and license terms.
 import datetime
+import json
+
 from decimal import Decimal, ROUND_HALF_EVEN
 from trytond.model import ModelView, ModelSQL, fields
-from trytond.tools import safe_eval, datetime_strftime
+from trytond.tools import datetime_strftime
 from trytond.transaction import Transaction
 from trytond.pool import Pool
 from trytond.rpc import RPC
@@ -119,7 +121,7 @@ class Currency(ModelSQL, ModelView):
         Check if mon_grouping is list of numbers
         '''
         try:
-            grouping = safe_eval(self.mon_grouping)
+            grouping = json.loads(self.mon_grouping)
             for i in grouping:
                 if not isinstance(i, int):
                     raise ValueError
@@ -135,9 +137,9 @@ class Currency(ModelSQL, ModelView):
 
     @classmethod
     def search_global(cls, text):
-        for id_, rec_name, icon in super(Currency, cls).search_global(text):
+        for record, rec_name, icon in super(Currency, cls).search_global(text):
             icon = icon or 'tryton-currency'
-            yield id_, rec_name, icon
+            yield record, rec_name, icon
 
     @classmethod
     def search_rec_name(cls, name, clause):
diff --git a/locale/ca_ES.po b/locale/ca_ES.po
index dac967e..975de36 100644
--- a/locale/ca_ES.po
+++ b/locale/ca_ES.po
@@ -870,7 +870,7 @@ msgstr "Platinum"
 
 msgctxt "model:currency.currency,name:xts"
 msgid "Code for testing purposes"
-msgstr "Code for testing purposes"
+msgstr "Codi reservat per a fer proves"
 
 msgctxt "model:currency.currency,name:xxx"
 msgid "No currency"
diff --git a/locale/es_EC.po b/locale/es_EC.po
index da908fc..85e29d6 100644
--- a/locale/es_EC.po
+++ b/locale/es_EC.po
@@ -30,15 +30,15 @@ msgstr "Código"
 
 msgctxt "field:currency.currency,create_date:"
 msgid "Create Date"
-msgstr "Fecha de Creación"
+msgstr "Fecha de creación"
 
 msgctxt "field:currency.currency,create_uid:"
 msgid "Create User"
-msgstr "Creado por Usuario"
+msgstr "Creado por usuario"
 
 msgctxt "field:currency.currency,digits:"
 msgid "Display Digits"
-msgstr "Dígitos a Mostrar"
+msgstr "Decimales a mostrar"
 
 msgctxt "field:currency.currency,id:"
 msgid "ID"
@@ -46,7 +46,7 @@ msgstr "ID"
 
 msgctxt "field:currency.currency,mon_decimal_point:"
 msgid "Decimal Separator"
-msgstr "Separador Decimal"
+msgstr "Separador decimal"
 
 msgctxt "field:currency.currency,mon_grouping:"
 msgid "Grouping"
@@ -54,7 +54,7 @@ msgstr "Agrupación"
 
 msgctxt "field:currency.currency,mon_thousands_sep:"
 msgid "Thousands Separator"
-msgstr "Separador de Miles"
+msgstr "Separador de miles"
 
 msgctxt "field:currency.currency,n_cs_precedes:"
 msgid "Negative Currency Symbol Precedes"
@@ -118,19 +118,19 @@ msgstr "Símbolo"
 
 msgctxt "field:currency.currency,write_date:"
 msgid "Write Date"
-msgstr "Fecha de Modificación"
+msgstr "Fecha de modificación"
 
 msgctxt "field:currency.currency,write_uid:"
 msgid "Write User"
-msgstr "Modificado por Usuario"
+msgstr "Modificado por usuario"
 
 msgctxt "field:currency.currency.rate,create_date:"
 msgid "Create Date"
-msgstr "Fecha de Creación"
+msgstr "Fecha de creación"
 
 msgctxt "field:currency.currency.rate,create_uid:"
 msgid "Create User"
-msgstr "Creado por Usuario"
+msgstr "Creado por usuario"
 
 msgctxt "field:currency.currency.rate,currency:"
 msgid "Currency"
@@ -154,11 +154,11 @@ msgstr "Nombre"
 
 msgctxt "field:currency.currency.rate,write_date:"
 msgid "Write Date"
-msgstr "Fecha de Modificación"
+msgstr "Fecha de modificación"
 
 msgctxt "field:currency.currency.rate,write_uid:"
 msgid "Write User"
-msgstr "Modificado por Usuario"
+msgstr "Modificado por usuario"
 
 msgctxt "model:currency.currency,name:"
 msgid "Currency"
@@ -894,7 +894,7 @@ msgstr "Dólar zimbabuense"
 
 msgctxt "model:currency.currency.rate,name:"
 msgid "Rate"
-msgstr "Tasa de Cambio"
+msgstr "Tasa de cambio"
 
 msgctxt "model:ir.action,name:act_currency_form"
 msgid "Currencies"
@@ -914,11 +914,11 @@ msgstr "Administración de Monedas"
 
 msgctxt "view:currency.currency.rate:"
 msgid "Rate"
-msgstr "Tasa de Cambio"
+msgstr "Tasa de cambio"
 
 msgctxt "view:currency.currency.rate:"
 msgid "Rates"
-msgstr "Tasas de Cambio"
+msgstr "Tasas de cambio"
 
 msgctxt "view:currency.currency:"
 msgid "Currencies"
@@ -934,4 +934,4 @@ msgstr "Formato"
 
 msgctxt "view:currency.currency:"
 msgid "Rates"
-msgstr "Tasas de Cambio"
+msgstr "Tasas de cambio"
diff --git a/setup.py b/setup.py
index 12f4d53..649616b 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#This file is part of Tryton.  The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# This file is part of Tryton.  The COPYRIGHT file at the top level of
+# this repository contains the full copyright notices and license terms.
 
 from setuptools import setup
 import re
@@ -86,6 +86,8 @@ setup(name=name,
         'Natural Language :: Spanish',
         'Operating System :: OS Independent',
         'Programming Language :: Python :: 2.7',
+        'Programming Language :: Python :: Implementation :: CPython',
+        'Programming Language :: Python :: Implementation :: PyPy',
         'Topic :: Office/Business',
         ],
     platforms='any',
diff --git a/tests/__init__.py b/tests/__init__.py
index d70527c..c027384 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -1,5 +1,5 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# This file is part of Tryton.  The COPYRIGHT file at the top level of
+# this repository contains the full copyright notices and license terms.
 
 from .test_currency import suite
 
diff --git a/tests/test_currency.py b/tests/test_currency.py
index 3218726..d648f97 100644
--- a/tests/test_currency.py
+++ b/tests/test_currency.py
@@ -1,18 +1,19 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# This file is part of Tryton.  The COPYRIGHT file at the top level of
+# this repository contains the full copyright notices and license terms.
 import unittest
 from decimal import Decimal
 import trytond.tests.test_tryton
-from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT, test_view,\
-    test_depends
+from trytond.tests.test_tryton import ModuleTestCase
+from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT
 from trytond.transaction import Transaction
 
 
-class CurrencyTestCase(unittest.TestCase):
+class CurrencyTestCase(ModuleTestCase):
     'Test Currency module'
+    module = 'currency'
 
     def setUp(self):
-        trytond.tests.test_tryton.install_module('currency')
+        super(CurrencyTestCase, self).setUp()
         self.rate = POOL.get('currency.currency.rate')
         self.currency = POOL.get('currency.currency')
         self.date = POOL.get('ir.date')
@@ -22,14 +23,6 @@ class CurrencyTestCase(unittest.TestCase):
             ('code', '=', code),
             ], limit=1)[0]
 
-    def test0005views(self):
-        'Test views'
-        test_view('currency')
-
-    def test0006depends(self):
-        'Test depends'
-        test_depends()
-
     def test0010currencies(self):
         'Create currencies'
 
diff --git a/tests/tools.py b/tests/tools.py
new file mode 100644
index 0000000..c2d989e
--- /dev/null
+++ b/tests/tools.py
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+# This file is part of Tryton.  The COPYRIGHT file at the top level of
+# this repository contains the full copyright notices and license terms.
+import datetime
+from decimal import Decimal
+
+from proteus import Model
+
+__all__ = ['get_currency']
+
+_names = {
+    'USD': 'U.S. Dollar',
+    'EUR': 'Euro',
+    }
+_symbols = {
+    'USD': '$',
+    'EUR': u'€',
+    }
+_rates = {
+    'USD': Decimal('1.0'),
+    'EUR': Decimal('2.0'),
+    }
+
+
+def get_currency(code='USD', config=None):
+    "Get currency with code"
+    Currency = Model.get('currency.currency', config=config)
+    CurrencyRate = Model.get('currency.currency.rate', config=config)
+
+    currencies = Currency.find([('code', '=', code)])
+    if not currencies:
+        currency = Currency(name=_names.get(code, code),
+            symbol=_symbols.get(code, code), code=code,
+            rounding=Decimal('0.01'), mon_grouping='[3, 3, 0]',
+            mon_decimal_point='.', mon_thousands_sep=',')
+        currency.save()
+        rate = _rates.get(code)
+        if rate is not None:
+            CurrencyRate(date=datetime.date.min, rate=rate,
+                currency=currency).save()
+    else:
+        currency, = currencies
+    return currency
diff --git a/tryton.cfg b/tryton.cfg
index c7408bc..781768d 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.4.1
+version=3.6.0
 depends:
     ir
     res
diff --git a/trytond_currency.egg-info/PKG-INFO b/trytond_currency.egg-info/PKG-INFO
index 99f3675..10813b8 100644
--- a/trytond_currency.egg-info/PKG-INFO
+++ b/trytond_currency.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond-currency
-Version: 3.4.1
+Version: 3.6.0
 Summary: Tryton module with currencies
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: issue_tracker at tryton.org
 License: GPL-3
-Download-URL: http://downloads.tryton.org/3.4/
+Download-URL: http://downloads.tryton.org/3.6/
 Description: trytond_currency
         ================
         
@@ -65,4 +65,6 @@ Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Classifier: Programming Language :: Python :: Implementation :: PyPy
 Classifier: Topic :: Office/Business
diff --git a/trytond_currency.egg-info/SOURCES.txt b/trytond_currency.egg-info/SOURCES.txt
index 9317a3b..afcafea 100644
--- a/trytond_currency.egg-info/SOURCES.txt
+++ b/trytond_currency.egg-info/SOURCES.txt
@@ -27,6 +27,7 @@ tryton.cfg
 ./locale/sl_SI.po
 ./tests/__init__.py
 ./tests/test_currency.py
+./tests/tools.py
 ./view/currency_form.xml
 ./view/currency_rate_form.xml
 ./view/currency_rate_graph.xml
diff --git a/trytond_currency.egg-info/requires.txt b/trytond_currency.egg-info/requires.txt
index 569dee7..3c84d7b 100644
--- a/trytond_currency.egg-info/requires.txt
+++ b/trytond_currency.egg-info/requires.txt
@@ -1 +1 @@
-trytond >= 3.4, < 3.5
\ No newline at end of file
+trytond >= 3.6, < 3.7
\ No newline at end of file
-- 
tryton-modules-currency



More information about the tryton-debian-vcs mailing list