[tryton-debian-vcs] tryton-modules-sale-credit-limit branch upstream updated. upstream/3.8.0-1-g66139d1

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Thu Jun 2 16:25:41 UTC 2016


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

commit 66139d1573b7b13b23147b8f87353850e65f737d
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Fri May 27 18:26:14 2016 +0200

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

diff --git a/CHANGELOG b/CHANGELOG
index 8d80dcb..68cbe07 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,7 @@
+Version 4.0.0 - 2016-05-02
+* Bug fixes (see mercurial logs for details)
+* Add Python3 support
+
 Version 3.8.0 - 2015-11-02
 * Bug fixes (see mercurial logs for details)
 
diff --git a/COPYRIGHT b/COPYRIGHT
index 196a420..93ef5be 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,5 +1,5 @@
-Copyright (C) 2011-2015 Cédric Krier.
-Copyright (C) 2011-2015 B2CK SPRL.
+Copyright (C) 2011-2016 Cédric Krier.
+Copyright (C) 2011-2016 B2CK SPRL.
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
diff --git a/PKG-INFO b/PKG-INFO
index d26e7d4..ee4f033 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_sale_credit_limit
-Version: 3.8.0
+Version: 4.0.0
 Summary: Tryton module for sale credit limit
 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.8/
+Download-URL: http://downloads.tryton.org/4.0/
 Description: trytond_sale_credit_limit
         =========================
         
@@ -54,6 +54,7 @@ Classifier: Intended Audience :: Legal Industry
 Classifier: License :: OSI Approved :: GNU General Public License (GPL)
 Classifier: Natural Language :: Bulgarian
 Classifier: Natural Language :: Catalan
+Classifier: Natural Language :: Chinese (Simplified)
 Classifier: Natural Language :: Czech
 Classifier: Natural Language :: Dutch
 Classifier: Natural Language :: English
@@ -67,6 +68,9 @@ Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: Implementation :: CPython
 Classifier: Programming Language :: Python :: Implementation :: PyPy
 Classifier: Topic :: Office/Business
diff --git a/party.py b/party.py
index c80ed9a..0e1b8b8 100644
--- a/party.py
+++ b/party.py
@@ -4,10 +4,10 @@ from trytond.pool import Pool, PoolMeta
 from trytond.transaction import Transaction
 
 __all__ = ['Party']
-__metaclass__ = PoolMeta
 
 
 class Party:
+    __metaclass__ = PoolMeta
     __name__ = 'party.party'
 
     @classmethod
diff --git a/sale.py b/sale.py
index 2cdee82..ca9bd9d 100644
--- a/sale.py
+++ b/sale.py
@@ -3,10 +3,10 @@
 from trytond.pool import PoolMeta
 
 __all__ = ['Sale']
-__metaclass__ = PoolMeta
 
 
 class Sale:
+    __metaclass__ = PoolMeta
     __name__ = 'sale.sale'
 
     @classmethod
diff --git a/setup.py b/setup.py
index 86c7f3f..8693e0c 100644
--- a/setup.py
+++ b/setup.py
@@ -5,11 +5,17 @@
 from setuptools import setup
 import re
 import os
-import ConfigParser
+import io
+try:
+    from configparser import ConfigParser
+except ImportError:
+    from ConfigParser import ConfigParser
 
 
 def read(fname):
-    return open(os.path.join(os.path.dirname(__file__), fname)).read()
+    return io.open(
+        os.path.join(os.path.dirname(__file__), fname),
+        'r', encoding='utf-8').read()
 
 
 def get_require_version(name):
@@ -21,7 +27,7 @@ def get_require_version(name):
         major_version, minor_version + 1)
     return require
 
-config = ConfigParser.ConfigParser()
+config = ConfigParser()
 config.readfp(open('tryton.cfg'))
 info = dict(config.items('tryton'))
 for key in ('depends', 'extras_depend', 'xml'):
@@ -43,7 +49,7 @@ if minor_version % 2:
 
 requires = []
 for dep in info.get('depends', []):
-    if not re.match(r'(ir|res|webdav)(\W|$)', dep):
+    if not re.match(r'(ir|res)(\W|$)', dep):
         requires.append(get_require_version('trytond_%s' % dep))
 requires.append(get_require_version('trytond'))
 
@@ -75,6 +81,7 @@ setup(name=name,
         'License :: OSI Approved :: GNU General Public License (GPL)',
         'Natural Language :: Bulgarian',
         'Natural Language :: Catalan',
+        'Natural Language :: Chinese (Simplified)',
         'Natural Language :: Czech',
         'Natural Language :: Dutch',
         'Natural Language :: English',
@@ -88,6 +95,9 @@ setup(name=name,
         'Natural Language :: Spanish',
         'Operating System :: OS Independent',
         'Programming Language :: Python :: 2.7',
+        'Programming Language :: Python :: 3.3',
+        'Programming Language :: Python :: 3.4',
+        'Programming Language :: Python :: 3.5',
         'Programming Language :: Python :: Implementation :: CPython',
         'Programming Language :: Python :: Implementation :: PyPy',
         'Topic :: Office/Business',
@@ -102,4 +112,5 @@ setup(name=name,
     """,
     test_suite='tests',
     test_loader='trytond.test_loader:Loader',
+    use_2to3=True,
     )
diff --git a/tests/__init__.py b/tests/__init__.py
index 8358e36..333baa0 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -1,6 +1,9 @@
 # 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_sale_credit_limit import suite
+try:
+    from trytond.modules.sale_credit_limit.tests.test_sale_credit_limit import suite
+except ImportError:
+    from .test_sale_credit_limit import suite
 
 __all__ = ['suite']
diff --git a/tests/test_sale_credit_limit.py b/tests/test_sale_credit_limit.py
index bf9572f..c99c8b0 100644
--- a/tests/test_sale_credit_limit.py
+++ b/tests/test_sale_credit_limit.py
@@ -1,52 +1,58 @@
 # 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
-import doctest
 from decimal import Decimal
 import trytond.tests.test_tryton
-from trytond.tests.test_tryton import ModuleTestCase
-from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT
-from trytond.transaction import Transaction
+from trytond.tests.test_tryton import ModuleTestCase, with_transaction
+from trytond.pool import Pool
 from trytond.exceptions import UserWarning
 
+from trytond.modules.company.tests import create_company, set_company
+from trytond.modules.account.tests import create_chart, get_fiscalyear
+from trytond.modules.account_invoice.tests import set_invoice_sequences
+
 
 class SaleCreditLimitTestCase(ModuleTestCase):
     'Test SaleCreditLimit module'
     module = 'sale_credit_limit'
 
-    def setUp(self):
-        super(SaleCreditLimitTestCase, self).setUp()
-        self.account = POOL.get('account.account')
-        self.move = POOL.get('account.move')
-        self.period = POOL.get('account.period')
-        self.journal = POOL.get('account.journal')
-        self.party = POOL.get('party.party')
-        self.sale = POOL.get('sale.sale')
-        self.sale_line = POOL.get('sale.line')
-        self.company = POOL.get('company.company')
-        self.payment_term = POOL.get('account.invoice.payment_term')
-        self.property = POOL.get('ir.property')
-        self.model_field = POOL.get('ir.model.field')
-
-    def test0010check_credit_limit(self):
+    @with_transaction()
+    def test_check_credit_limit(self):
         'Test check_credit_limit'
-        with Transaction().start(DB_NAME, USER, context=CONTEXT):
-            receivable, = self.account.search([
+        pool = Pool()
+        Account = pool.get('account.account')
+        Move = pool.get('account.move')
+        Journal = pool.get('account.journal')
+        Party = pool.get('party.party')
+        Sale = pool.get('sale.sale')
+        PaymentTerm = pool.get('account.invoice.payment_term')
+        Property = pool.get('ir.property')
+        ModelField = pool.get('ir.model.field')
+        FiscalYear = pool.get('account.fiscalyear')
+
+        company = create_company()
+        with set_company(company):
+            create_chart(company)
+            fiscalyear = set_invoice_sequences(get_fiscalyear(company))
+            fiscalyear.save()
+            FiscalYear.create_period([fiscalyear])
+            period = fiscalyear.periods[0]
+
+            receivable, = Account.search([
                     ('kind', '=', 'receivable'),
                     ])
-            revenue, = self.account.search([
+            revenue, = Account.search([
                     ('kind', '=', 'revenue'),
                     ])
-            journal, = self.journal.search([], limit=1)
-            period, = self.period.search([], limit=1)
-            party, = self.party.create([{
+            journal, = Journal.search([], limit=1)
+            party, = Party.create([{
                         'name': 'Party',
                         'addresses': [
                             ('create', [{}]),
                             ],
                         'credit_limit_amount': Decimal('100'),
                         }])
-            self.move.create([{
+            Move.create([{
                         'journal': journal.id,
                         'period': period.id,
                         'date': period.start_date,
@@ -61,10 +67,7 @@ class SaleCreditLimitTestCase(ModuleTestCase):
                                         }]),
                             ],
                         }])
-            company, = self.company.search([
-                    ('rec_name', '=', 'Dunder Mifflin'),
-                    ])
-            payment_term, = self.payment_term.create([{
+            payment_term, = PaymentTerm.create([{
                         'name': 'Test',
                         'lines': [
                             ('create', [{
@@ -72,16 +75,16 @@ class SaleCreditLimitTestCase(ModuleTestCase):
                                         }])
                             ],
                         }])
-            field, = self.model_field.search([
+            field, = ModelField.search([
                     ('model.model', '=', 'product.template'),
                     ('name', '=', 'account_revenue'),
                     ], limit=1)
-            self.property.create([{
+            Property.create([{
                     'field': field.id,
                     'value': str(revenue),
                     'company': company.id,
                     }])
-            sale, = self.sale.create([{
+            sale, = Sale.create([{
                         'party': party.id,
                         'company': company.id,
                         'payment_term': payment_term.id,
@@ -97,34 +100,30 @@ class SaleCreditLimitTestCase(ModuleTestCase):
                             ],
                         }])
             self.assertEqual(party.credit_amount, Decimal('100'))
-            self.sale.quote([sale])
-            self.sale.confirm([sale])
+            Sale.quote([sale])
+            Sale.confirm([sale])
             self.assertEqual(party.credit_amount, Decimal('100'))
             # Test limit reaches
-            self.assertRaises(UserWarning, self.sale.process, [sale])
+            self.assertRaises(UserWarning, Sale.process, [sale])
             # Increase limit
             party.credit_limit_amount = Decimal('200')
             party.save()
             # process should work
-            self.sale.process([sale])
+            Sale.process([sale])
             self.assertEqual(sale.state, 'processing')
             self.assertEqual(party.credit_amount, Decimal('150'))
 
             # Re-process
-            self.sale.process([sale])
+            Sale.process([sale])
             # Decrease limit
             party.credit_limit_amount = Decimal('100')
             party.save()
             # process should still work as sale is already processing
-            self.sale.process([sale])
+            Sale.process([sale])
 
 
 def suite():
     suite = trytond.tests.test_tryton.suite()
-    from trytond.modules.account.tests import test_account
-    for test in test_account.suite():
-        if test not in suite and not isinstance(test, doctest.DocTestCase):
-            suite.addTest(test)
     suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
         SaleCreditLimitTestCase))
     return suite
diff --git a/tryton.cfg b/tryton.cfg
index 7016ae2..44fb748 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.8.0
+version=4.0.0
 depends:
     ir
     account_credit_limit
diff --git a/trytond_sale_credit_limit.egg-info/PKG-INFO b/trytond_sale_credit_limit.egg-info/PKG-INFO
index 8abc102..f0555df 100644
--- a/trytond_sale_credit_limit.egg-info/PKG-INFO
+++ b/trytond_sale_credit_limit.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond-sale-credit-limit
-Version: 3.8.0
+Version: 4.0.0
 Summary: Tryton module for sale credit limit
 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.8/
+Download-URL: http://downloads.tryton.org/4.0/
 Description: trytond_sale_credit_limit
         =========================
         
@@ -54,6 +54,7 @@ Classifier: Intended Audience :: Legal Industry
 Classifier: License :: OSI Approved :: GNU General Public License (GPL)
 Classifier: Natural Language :: Bulgarian
 Classifier: Natural Language :: Catalan
+Classifier: Natural Language :: Chinese (Simplified)
 Classifier: Natural Language :: Czech
 Classifier: Natural Language :: Dutch
 Classifier: Natural Language :: English
@@ -67,6 +68,9 @@ Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: Implementation :: CPython
 Classifier: Programming Language :: Python :: Implementation :: PyPy
 Classifier: Topic :: Office/Business
diff --git a/trytond_sale_credit_limit.egg-info/requires.txt b/trytond_sale_credit_limit.egg-info/requires.txt
index 56af832..355231b 100644
--- a/trytond_sale_credit_limit.egg-info/requires.txt
+++ b/trytond_sale_credit_limit.egg-info/requires.txt
@@ -1,6 +1,6 @@
-trytond_account_credit_limit >= 3.8, < 3.9
-trytond_sale >= 3.8, < 3.9
-trytond_currency >= 3.8, < 3.9
-trytond_account_invoice >= 3.8, < 3.9
-trytond_company >= 3.8, < 3.9
-trytond >= 3.8, < 3.9
\ No newline at end of file
+trytond_account_credit_limit >= 4.0, < 4.1
+trytond_sale >= 4.0, < 4.1
+trytond_currency >= 4.0, < 4.1
+trytond_account_invoice >= 4.0, < 4.1
+trytond_company >= 4.0, < 4.1
+trytond >= 4.0, < 4.1
\ No newline at end of file
-- 
tryton-modules-sale-credit-limit



More information about the tryton-debian-vcs mailing list