[tryton-debian-vcs] tryton-modules-carrier-weight branch debian updated. debian/3.0.0-3-4-g7f5d236

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Tue Apr 22 13:07:09 UTC 2014


The following commit has been merged in the debian branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-carrier-weight.git;a=commitdiff;h=debian/3.0.0-3-4-g7f5d236

commit 7f5d236c388a0106bdacac23199ef33deec08b68
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Apr 22 14:59:52 2014 +0200

    Bumping minimal required Python version to 2.7.

diff --git a/debian/control b/debian/control
index c5dae89..0efa899 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Standards-Version: 3.9.5
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=tryton/tryton-modules-carrier-weight.git
 Vcs-Git: git://anonscm.debian.org/tryton/tryton-modules-carrier-weight.git
-X-Python-Version: >= 2.6
+X-Python-Version: >= 2.7
 
 Package: tryton-modules-carrier-weight
 Architecture: all
commit 5ec12a0a8421dbde5a59d28d269d8661384961e7
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Apr 22 14:45:58 2014 +0200

    Updating copyright.

diff --git a/debian/copyright b/debian/copyright
index 80406ce..51c54a0 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,10 +1,10 @@
 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 
 Files: *
-Copyright: 2011-2013 Cédric Krier
+Copyright: 2011-2014 Cédric Krier
            2011-2013 Bertrand Chenal
            2011 Nicolas Évrard
-           2011-2013 B2CK SPRL
+           2011-2014 B2CK SPRL
 License: GPL-3+
 
 Files: debian/*
commit 9f487646550452ecd95526419396b97ab193c662
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Apr 22 14:21:44 2014 +0200

    Merging upstream version 3.2.0.

diff --git a/CHANGELOG b/CHANGELOG
index 69dc0e9..b63bd8a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.2.0 - 2014-04-21
+* Bug fixes (see mercurial logs for details)
+
 Version 3.0.0 - 2013-10-21
 * Bug fixes (see mercurial logs for details)
 
diff --git a/COPYRIGHT b/COPYRIGHT
index cb2d2c5..2687aff 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,7 +1,7 @@
-Copyright (C) 2011-2013 Cédric Krier.
+Copyright (C) 2011-2014 Cédric Krier.
 Copyright (C) 2011-2013 Bertrand Chenal.
 Copyright (C) 2011 Nicolas Évrard.
-Copyright (C) 2011-2013 B2CK SPRL.
+Copyright (C) 2011-2014 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/INSTALL b/INSTALL
index 34adbe8..4880a77 100644
--- a/INSTALL
+++ b/INSTALL
@@ -4,7 +4,7 @@ Installing trytond_carrier_weight
 Prerequisites
 -------------
 
- * Python 2.6 or later (http://www.python.org/)
+ * Python 2.7 or later (http://www.python.org/)
  * trytond (http://www.tryton.org/)
  * trytond_product (http://www.tryton.org/)
  * trytond_product_measurements (http://www.tryton.org/)
diff --git a/MANIFEST.in b/MANIFEST.in
index 05c3f79..f2f691a 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -6,7 +6,6 @@ include LICENSE
 include tryton.cfg
 include *.xml
 include view/*.xml
-include *.odt
 include locale/*.po
 include doc/*
 include tests/*.rst
diff --git a/PKG-INFO b/PKG-INFO
index ee71556..16c6b8a 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_carrier_weight
-Version: 3.0.0
+Version: 3.2.0
 Summary: Tryton module to add cost method "on weight" on carrier
 Home-page: http://www.tryton.org/
 Author: Tryton
-Author-email: UNKNOWN
+Author-email: issue_tracker at tryton.org
 License: GPL-3
-Download-URL: http://downloads.tryton.org/3.0/
+Download-URL: http://downloads.tryton.org/3.2/
 Description: trytond_carrier_weight
         ======================
         
@@ -43,9 +43,11 @@ Description: trytond_carrier_weight
         
           http://www.tryton.org/
         
+Keywords: tryton carrier weight
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Plugins
+Classifier: Framework :: Tryton
 Classifier: Intended Audience :: Developers
 Classifier: Intended Audience :: Financial and Insurance Industry
 Classifier: Intended Audience :: Legal Industry
@@ -61,6 +63,5 @@ Classifier: Natural Language :: Russian
 Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python :: 2.6
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Topic :: Office/Business
diff --git a/carrier.py b/carrier.py
index 323c74e..3dc5053 100644
--- a/carrier.py
+++ b/carrier.py
@@ -21,8 +21,8 @@ class Carrier:
             'readonly': Bool(Eval('weight_price_list', [])),
             },
         depends=['carrier_cost_method', 'weight_price_list'])
-    weight_uom_digits = fields.Function(fields.Integer('Weight Uom Digits',
-            on_change_with=['weight_uom']), 'on_change_with_weight_uom_digits')
+    weight_uom_digits = fields.Function(fields.Integer('Weight Uom Digits'),
+        'on_change_with_weight_uom_digits')
     weight_currency = fields.Many2One('currency.currency', 'Currency',
         states={
             'invisible': Eval('carrier_cost_method') != 'weight',
@@ -31,7 +31,7 @@ class Carrier:
             },
         depends=['carrier_cost_method', 'weight_price_list'])
     weight_currency_digits = fields.Function(fields.Integer(
-            'Weight Currency Digits', on_change_with=['weight_currency']),
+            'Weight Currency Digits'),
         'on_change_with_weight_currency_digits')
     weight_price_list = fields.One2Many('carrier.weight_price_list', 'carrier',
         'Price List',
@@ -60,11 +60,13 @@ class Carrier:
             return Company(company).currency.digits
         return 2
 
+    @fields.depends('weight_uom')
     def on_change_with_weight_uom_digits(self, name=None):
         if self.weight_uom:
             return self.weight_uom.digits
         return 2
 
+    @fields.depends('weight_currency')
     def on_change_with_weight_currency_digits(self, name=None):
         if self.weight_currency:
             return self.weight_currency.digits
diff --git a/locale/de_DE.po b/locale/de_DE.po
index 7984fd0..2a96bdb 100644
--- a/locale/de_DE.po
+++ b/locale/de_DE.po
@@ -8,7 +8,7 @@ msgstr "Währung"
 
 msgctxt "field:carrier,weight_currency_digits:"
 msgid "Weight Currency Digits"
-msgstr "Gewicht Währung Stellen"
+msgstr "Nachkommastellen Währung Gewicht"
 
 msgctxt "field:carrier,weight_price_list:"
 msgid "Price List"
@@ -20,7 +20,7 @@ msgstr "Gewicht Maßeinheit"
 
 msgctxt "field:carrier,weight_uom_digits:"
 msgid "Weight Uom Digits"
-msgstr "Gewicht Maßeinheit Stellen"
+msgstr "Nachkommastellen Maßeinheit Gewicht"
 
 msgctxt "field:carrier.weight_price_list,carrier:"
 msgid "Carrier"
diff --git a/locale/es_CO.po b/locale/es_CO.po
index e2f77ed..5a71c5c 100644
--- a/locale/es_CO.po
+++ b/locale/es_CO.po
@@ -44,7 +44,7 @@ msgstr "Precio"
 
 msgctxt "field:carrier.weight_price_list,rec_name:"
 msgid "Name"
-msgstr "Nombre de Contacto"
+msgstr "Nombre"
 
 msgctxt "field:carrier.weight_price_list,weight:"
 msgid "Weight"
diff --git a/locale/fr_FR.po b/locale/fr_FR.po
index d657841..c6585af 100644
--- a/locale/fr_FR.po
+++ b/locale/fr_FR.po
@@ -4,7 +4,7 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "field:carrier,weight_currency:"
 msgid "Currency"
-msgstr "Devises"
+msgstr "Devise"
 
 msgctxt "field:carrier,weight_currency_digits:"
 msgid "Weight Currency Digits"
diff --git a/sale.py b/sale.py
index 3976fa9..ba7e9ef 100644
--- a/sale.py
+++ b/sale.py
@@ -36,7 +36,9 @@ class Sale:
         for key, parcel in groupby(lines, key=keyfunc):
             weight = 0
             for line in parcel:
-                if line.product and line.quantity and line.unit:
+                if (getattr(line, 'product', None)
+                        and getattr(line, 'quantity', None)
+                        and getattr(line, 'unit', None)):
                     quantity = Uom.compute_qty(line.unit, line.quantity,
                         line.product.default_uom, round=False)
                     if line.product.weight:
diff --git a/setup.py b/setup.py
index cf682f6..0c0d42a 100644
--- a/setup.py
+++ b/setup.py
@@ -11,33 +11,51 @@ import ConfigParser
 def read(fname):
     return open(os.path.join(os.path.dirname(__file__), fname)).read()
 
+
+def get_require_version(name):
+    if minor_version % 2:
+        require = '%s >= %s.%s.dev0, < %s.%s'
+    else:
+        require = '%s >= %s.%s, < %s.%s'
+    require %= (name, major_version, minor_version,
+        major_version, minor_version + 1)
+    return require
+
 config = ConfigParser.ConfigParser()
 config.readfp(open('tryton.cfg'))
 info = dict(config.items('tryton'))
 for key in ('depends', 'extras_depend', 'xml'):
     if key in info:
         info[key] = info[key].strip().splitlines()
-major_version, minor_version, _ = info.get('version', '0.0.1').split('.', 2)
+version = info.get('version', '0.0.1')
+major_version, minor_version, _ = version.split('.', 2)
 major_version = int(major_version)
 minor_version = int(minor_version)
+name = 'trytond_carrier_weight'
+
+download_url = 'http://downloads.tryton.org/%s.%s/' % (
+    major_version, minor_version)
+if minor_version % 2:
+    version = '%s.%s.dev0' % (major_version, minor_version)
+    download_url = (
+        'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % (
+            name[8:], name, version))
 
 requires = []
 for dep in info.get('depends', []):
     if not re.match(r'(ir|res|webdav)(\W|$)', dep):
-        requires.append('trytond_%s >= %s.%s, < %s.%s' %
-            (dep, major_version, minor_version, major_version,
-                minor_version + 1))
-requires.append('trytond >= %s.%s, < %s.%s' %
-    (major_version, minor_version, major_version, minor_version + 1))
+        requires.append(get_require_version('trytond_%s' % dep))
+requires.append(get_require_version('trytond'))
 
-setup(name='trytond_carrier_weight',
-    version=info.get('version', '0.0.1'),
+setup(name=name,
+    version=version,
     description='Tryton module to add cost method "on weight" on carrier',
     long_description=read('README'),
     author='Tryton',
+    author_email='issue_tracker at tryton.org',
     url='http://www.tryton.org/',
-    download_url=("http://downloads.tryton.org/" +
-        info.get('version', '0.0.1').rsplit('.', 1)[0] + '/'),
+    download_url=download_url,
+    keywords='tryton carrier weight',
     package_dir={'trytond.modules.carrier_weight': '.'},
     packages=[
         'trytond.modules.carrier_weight',
@@ -50,6 +68,7 @@ setup(name='trytond_carrier_weight',
     classifiers=[
         'Development Status :: 5 - Production/Stable',
         'Environment :: Plugins',
+        'Framework :: Tryton',
         'Intended Audience :: Developers',
         'Intended Audience :: Financial and Insurance Industry',
         'Intended Audience :: Legal Industry',
@@ -65,7 +84,6 @@ setup(name='trytond_carrier_weight',
         'Natural Language :: Slovenian',
         'Natural Language :: Spanish',
         'Operating System :: OS Independent',
-        'Programming Language :: Python :: 2.6',
         'Programming Language :: Python :: 2.7',
         'Topic :: Office/Business',
         ],
diff --git a/stock.py b/stock.py
index 0511f59..22ba55b 100644
--- a/stock.py
+++ b/stock.py
@@ -37,9 +37,9 @@ class ShipmentIn:
         for key, parcel in groupby(lines, key=keyfunc):
             weight = 0
             for line in parcel:
-                if (line.product
-                        and line.quantity
-                        and line.uom
+                if (getattr(line, 'product', None)
+                        and getattr(line, 'quantity', None)
+                        and getattr(line, 'uom', None)
                         and line.product.weight):
                     quantity = Uom.compute_qty(line.uom, line.quantity,
                         line.product.default_uom, round=False)
diff --git a/tests/scenario_carrier_weight.rst b/tests/scenario_carrier_weight.rst
index 61f9a76..6334874 100644
--- a/tests/scenario_carrier_weight.rst
+++ b/tests/scenario_carrier_weight.rst
@@ -37,14 +37,14 @@ Create company::
     >>> company_config = Wizard('company.company.config')
     >>> company_config.execute('company')
     >>> company = company_config.form
-    >>> party = Party(name='B2CK')
+    >>> party = Party(name='Dunder Mifflin')
     >>> party.save()
     >>> company.party = party
-    >>> currencies = Currency.find([('code', '=', 'EUR')])
+    >>> currencies = Currency.find([('code', '=', 'USD')])
     >>> if not currencies:
-    ...     currency = Currency(name='Euro', symbol=u'€', code='EUR',
+    ...     currency = Currency(name='U.S. Dollar', symbol='$', code='USD',
     ...         rounding=Decimal('0.01'), mon_grouping='[3, 3, 0]',
-    ...         mon_decimal_point=',')
+    ...         mon_decimal_point='.', mon_thousands_sep=',')
     ...     currency.save()
     ...     CurrencyRate(date=today + relativedelta(month=1, day=1),
     ...         rate=Decimal('1.0'), currency=currency).save()
@@ -203,11 +203,11 @@ Receive a single product line::
     >>> move.to_location = shipment.warehouse.input_location
     >>> move.product = product
     >>> move.quantity = 4
-    >>> move.unit_price == Decimal(8)
-    True
+    >>> move.unit_price
+    Decimal('8')
     >>> shipment.carrier = carrier
-    >>> shipment.cost == Decimal(25)
-    True
+    >>> shipment.cost
+    Decimal('25')
     >>> shipment.cost_currency == currency
     True
     >>> shipment.save()
@@ -216,8 +216,8 @@ Receive a single product line::
     >>> shipment.state
     u'received'
     >>> move, = shipment.incoming_moves
-    >>> move.unit_price == Decimal('14.25')
-    True
+    >>> move.unit_price
+    Decimal('14.2500')
 
 Create payment term::
 
@@ -247,16 +247,16 @@ Sale products with cost on shipment::
     True
     >>> cost_line.quantity == 1
     True
-    >>> cost_line.amount == Decimal(40)
-    True
+    >>> cost_line.amount
+    Decimal('40.00')
     >>> sale.save()
     >>> Sale.quote([sale.id], config.context)
     >>> Sale.confirm([sale.id], config.context)
     >>> Sale.process([sale.id], config.context)
     >>> sale.state
     u'processing'
-    >>> sale.untaxed_amount == Decimal(140)
-    True
+    >>> sale.untaxed_amount
+    Decimal('140.00')
 
 Send products::
 
@@ -264,14 +264,14 @@ Send products::
     >>> shipment, = sale.shipments
     >>> shipment.carrier == carrier
     True
-    >>> shipment.cost == Decimal(40)
-    True
+    >>> shipment.cost
+    Decimal('40')
     >>> shipment.cost_currency == currency
     True
     >>> move, = shipment.inventory_moves
     >>> move.quantity = 4
-    >>> shipment.cost == Decimal(25)
-    True
+    >>> shipment.cost
+    Decimal('25')
     >>> shipment.cost_currency == currency
     True
     >>> shipment.state
@@ -294,8 +294,8 @@ Check customer invoice::
 
     >>> sale.reload()
     >>> invoice, = sale.invoices
-    >>> invoice.untaxed_amount == Decimal('105')
-    True
+    >>> invoice.untaxed_amount
+    Decimal('105.00')
 
 Sale products with cost on order::
 
@@ -314,16 +314,16 @@ Sale products with cost on order::
     True
     >>> cost_line.quantity == 1
     True
-    >>> cost_line.amount == Decimal(25)
-    True
+    >>> cost_line.amount
+    Decimal('25.00')
     >>> sale.save()
     >>> Sale.quote([sale.id], config.context)
     >>> Sale.confirm([sale.id], config.context)
     >>> Sale.process([sale.id], config.context)
     >>> sale.state
     u'processing'
-    >>> sale.untaxed_amount == Decimal(85)
-    True
+    >>> sale.untaxed_amount
+    Decimal('85.00')
 
 Check customer shipment::
 
@@ -335,5 +335,5 @@ Check customer invoice::
 
     >>> sale.reload()
     >>> invoice, = sale.invoices
-    >>> invoice.untaxed_amount == Decimal(85)
-    True
+    >>> invoice.untaxed_amount
+    Decimal('85.00')
diff --git a/tests/test_carrier_weight.py b/tests/test_carrier_weight.py
index cc35240..6c0942e 100644
--- a/tests/test_carrier_weight.py
+++ b/tests/test_carrier_weight.py
@@ -1,27 +1,16 @@
-#!/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.
-import sys
-import os
-DIR = os.path.abspath(os.path.normpath(os.path.join(__file__,
-    '..', '..', '..', '..', '..', 'trytond')))
-if os.path.isdir(DIR):
-    sys.path.insert(0, os.path.dirname(DIR))
-
 import unittest
 import doctest
 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.backend.sqlite.database import Database as SQLiteDatabase
+    test_view, test_depends, doctest_dropdb
 from trytond.transaction import Transaction
 
 
 class CarrierWeightTestCase(unittest.TestCase):
-    '''
-    Test CarrierWeight module.
-    '''
+    'Test CarrierWeight module'
 
     def setUp(self):
         trytond.tests.test_tryton.install_module('carrier_weight')
@@ -35,21 +24,15 @@ class CarrierWeightTestCase(unittest.TestCase):
         self.weight_price_list = POOL.get('carrier.weight_price_list')
 
     def test0005views(self):
-        '''
-        Test views.
-        '''
+        'Test views'
         test_view('carrier_weight')
 
     def test0006depends(self):
-        '''
-        Test depends.
-        '''
+        'Test depends'
         test_depends()
 
     def test0010compute_weight_price(self):
-        '''
-        Test compute_weight_price.
-        '''
+        'Test compute_weight_price'
         with Transaction().start(DB_NAME, USER, context=CONTEXT):
             party, = self.party.create([{
                         'name': 'Carrier',
@@ -104,19 +87,6 @@ class CarrierWeightTestCase(unittest.TestCase):
                 self.assertEqual(carrier.compute_weight_price(weight), price)
 
 
-def doctest_dropdb(test):
-    '''
-    Remove sqlite memory database
-    '''
-    database = SQLiteDatabase().connect()
-    cursor = database.cursor(autocommit=True)
-    try:
-        database.drop(cursor, ':memory:')
-        cursor.commit()
-    finally:
-        cursor.close()
-
-
 def suite():
     suite = trytond.tests.test_tryton.suite()
     from trytond.modules.product.tests import test_product
@@ -133,6 +103,3 @@ def suite():
         setUp=doctest_dropdb, tearDown=doctest_dropdb, encoding='utf-8',
             optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
     return suite
-
-if __name__ == '__main__':
-    unittest.TextTestRunner(verbosity=2).run(suite())
diff --git a/tryton.cfg b/tryton.cfg
index fcc9507..fb801cd 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.0.0
+version=3.2.0
 depends:
     carrier
     company
diff --git a/trytond_carrier_weight.egg-info/PKG-INFO b/trytond_carrier_weight.egg-info/PKG-INFO
index 57fbd58..0760c6e 100644
--- a/trytond_carrier_weight.egg-info/PKG-INFO
+++ b/trytond_carrier_weight.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond-carrier-weight
-Version: 3.0.0
+Version: 3.2.0
 Summary: Tryton module to add cost method "on weight" on carrier
 Home-page: http://www.tryton.org/
 Author: Tryton
-Author-email: UNKNOWN
+Author-email: issue_tracker at tryton.org
 License: GPL-3
-Download-URL: http://downloads.tryton.org/3.0/
+Download-URL: http://downloads.tryton.org/3.2/
 Description: trytond_carrier_weight
         ======================
         
@@ -43,9 +43,11 @@ Description: trytond_carrier_weight
         
           http://www.tryton.org/
         
+Keywords: tryton carrier weight
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Plugins
+Classifier: Framework :: Tryton
 Classifier: Intended Audience :: Developers
 Classifier: Intended Audience :: Financial and Insurance Industry
 Classifier: Intended Audience :: Legal Industry
@@ -61,6 +63,5 @@ Classifier: Natural Language :: Russian
 Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python :: 2.6
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Topic :: Office/Business
diff --git a/trytond_carrier_weight.egg-info/requires.txt b/trytond_carrier_weight.egg-info/requires.txt
index 96ada65..55c95d5 100644
--- a/trytond_carrier_weight.egg-info/requires.txt
+++ b/trytond_carrier_weight.egg-info/requires.txt
@@ -1,6 +1,6 @@
-trytond_carrier >= 3.0, < 3.1
-trytond_company >= 3.0, < 3.1
-trytond_currency >= 3.0, < 3.1
-trytond_product >= 3.0, < 3.1
-trytond_product_measurements >= 3.0, < 3.1
-trytond >= 3.0, < 3.1
\ No newline at end of file
+trytond_carrier >= 3.2, < 3.3
+trytond_company >= 3.2, < 3.3
+trytond_currency >= 3.2, < 3.3
+trytond_product >= 3.2, < 3.3
+trytond_product_measurements >= 3.2, < 3.3
+trytond >= 3.2, < 3.3
\ No newline at end of file
-- 
tryton-modules-carrier-weight



More information about the tryton-debian-vcs mailing list