[tryton-debian-vcs] tryton-modules-sale-shipment-cost branch debian updated. debian/3.0.0-3-4-g25fd009
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Tue Apr 22 13:10:17 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-sale-shipment-cost.git;a=commitdiff;h=debian/3.0.0-3-4-g25fd009
commit 25fd009be5bc4b10e2284217d8d2d8455042444e
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Tue Apr 22 15:00:13 2014 +0200
Bumping minimal required Python version to 2.7.
diff --git a/debian/control b/debian/control
index de8fc62..b4b2c14 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-sale-shipment-cost.git
Vcs-Git: git://anonscm.debian.org/tryton/tryton-modules-sale-shipment-cost.git
-X-Python-Version: >= 2.6
+X-Python-Version: >= 2.7
Package: tryton-modules-sale-shipment-cost
Architecture: all
commit 794cca446c3562e469cb7bab5a644f2230100cef
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Tue Apr 22 14:46:47 2014 +0200
Updating copyright.
diff --git a/debian/copyright b/debian/copyright
index 68f671e..038bbcc 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-2012 Nicolas Évrard
- 2011-2013 B2CK SPRL
+ 2011-2014 Nicolas Évrard
+ 2011-2014 B2CK SPRL
License: GPL-3+
Files: debian/*
commit 7829e8ab6fad4b30b89915d3816f0ef19ad56eb6
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Tue Apr 22 14:23:25 2014 +0200
Merging upstream version 3.2.0.
diff --git a/CHANGELOG b/CHANGELOG
index 81cac82..5b37101 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 52304b0..36b0b21 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-2012 Nicolas Évrard.
-Copyright (C) 2011-2013 B2CK SPRL.
+Copyright (C) 2011-2014 Nicolas Évrard.
+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 f646c01..0a6912f 100644
--- a/INSTALL
+++ b/INSTALL
@@ -4,7 +4,7 @@ Installing trytond_sale_shipment_cost
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_carrier (http://www.tryton.org/)
* trytond_sale (http://www.tryton.org/)
diff --git a/MANIFEST.in b/MANIFEST.in
index fc0b03e..f2f691a 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,13 +1,11 @@
include INSTALL
include README
-include TODO
include COPYRIGHT
include CHANGELOG
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 bf1eda9..87cf390 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond_sale_shipment_cost
-Version: 3.0.0
+Version: 3.2.0
Summary: Tryton module for sale shipment cost
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_sale_shipment_cost
==========================
@@ -43,9 +43,11 @@ Description: trytond_sale_shipment_cost
http://www.tryton.org/
+Keywords: tryton sale shipment cost
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
@@ -62,6 +64,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/locale/ca_ES.po b/locale/ca_ES.po
index 8488b6c..0657c31 100644
--- a/locale/ca_ES.po
+++ b/locale/ca_ES.po
@@ -12,7 +12,7 @@ msgstr "Transportista"
msgctxt "field:sale.configuration,sale_shipment_cost_method:"
msgid "Sale Shipment Cost Method"
-msgstr "Mètode de cost enviament venda"
+msgstr "Mètode de cost enviament"
msgctxt "field:sale.line,shipment_cost:"
msgid "Shipment Cost"
diff --git a/locale/de_DE.po b/locale/de_DE.po
index 6a5513c..1e66c1c 100644
--- a/locale/de_DE.po
+++ b/locale/de_DE.po
@@ -40,7 +40,7 @@ msgstr "Währung Kosten"
msgctxt "field:stock.shipment.out,cost_currency_digits:"
msgid "Cost Currency Digits"
-msgstr "Kosten Stellen Währung"
+msgstr "Nachkommastellen Währung Kosten"
msgctxt "field:stock.shipment.out,cost_invoice_line:"
msgid "Cost Invoice Line"
diff --git a/sale.py b/sale.py
index 603678c..406ec91 100644
--- a/sale.py
+++ b/sale.py
@@ -31,7 +31,6 @@ class Sale:
__name__ = 'sale.sale'
carrier = fields.Many2One('carrier', 'Carrier',
domain=[('carrier_product.salable', '=', True)],
- on_change=['carrier', 'party', 'currency', 'sale_date'],
states={
'readonly': Eval('state') != 'draft',
},
@@ -43,18 +42,6 @@ class Sale:
'readonly': Eval('state') != 'draft',
}, depends=['state'])
- @classmethod
- def __setup__(cls):
- super(Sale, cls).__setup__()
-
- for fname in ('carrier', 'party', 'currency', 'sale_date',
- 'shipment_cost_method', 'lines'):
- if fname not in cls.lines.on_change:
- cls.lines.on_change.append(fname)
- for fname in cls.lines.on_change:
- if fname not in cls.carrier.on_change:
- cls.carrier.on_change.append(fname)
-
@staticmethod
def default_carrier():
Config = Pool().get('sale.configuration')
@@ -70,9 +57,12 @@ class Sale:
def _get_carrier_context(self):
return {}
+ @fields.depends(methods=['lines'])
def on_change_carrier(self):
return self.on_change_lines()
+ @fields.depends('carrier', 'party', 'currency', 'sale_date',
+ 'shipment_cost_method', 'lines')
def on_change_lines(self):
pool = Pool()
Product = pool.get('product.product')
@@ -95,16 +85,14 @@ class Sale:
cost_line = {}
products = [line.product for line in self.lines or []
- if line.product]
+ if getattr(line, 'product', None)]
stockable = any(product.type in ('goods', 'assets')
for product in products)
if cost and currency_id and stockable:
- if (self.currency
- and currency_id != self.currency.id):
- date = self.sale_date or today
- with Transaction().set_context(date=date):
- cost = Currency.compute(Currency(currency_id), cost,
- self.currency)
+ date = self.sale_date or today
+ with Transaction().set_context(date=date):
+ cost = Currency.compute(Currency(currency_id), cost,
+ self.currency)
product = self.carrier.carrier_product
with Transaction().set_context(party_context):
description = Product(product.id).rec_name
@@ -140,12 +128,13 @@ class Sale:
if not self.lines:
self.lines = []
for line in self.lines:
- if line.shipment_cost:
+ if getattr(line, 'shipment_cost', None):
if line.shipment_cost != cost_line.get('shipment_cost'):
to_remove = line.id
self.lines.remove(line)
if cost_line:
- cost_line['description'] = line.description
+ cost_line['description'] = getattr(line, 'description',
+ '')
else:
cost_line = {}
break
@@ -158,7 +147,7 @@ class Sale:
if to_remove:
lines.setdefault('remove', []).append(to_remove)
if cost_line:
- lines.setdefault('add', []).append(cost_line)
+ lines.setdefault('add', []).append((-1, cost_line))
return result
def create_shipment(self, shipment_type):
diff --git a/setup.py b/setup.py
index 6d5518c..404f1da 100644
--- a/setup.py
+++ b/setup.py
@@ -11,40 +11,55 @@ 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_sale_shipment_cost'
+
+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'))
-tests_require = ['proteus >= %s.%s, < %s.%s' %
- (major_version, minor_version, major_version, minor_version + 1)]
+tests_require = [get_require_version('proteus')]
for dep in ['account', 'party', 'stock']:
- tests_require.append('trytond_%s >= %s.%s, < %s.%s' %
- (dep, major_version, minor_version, major_version,
- minor_version + 1))
+ tests_require.append(get_require_version('trytond_%s' % dep))
-setup(name='trytond_sale_shipment_cost',
- version=info.get('version', '0.0.1'),
+setup(name=name,
+ version=version,
description='Tryton module for sale shipment cost',
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 sale shipment cost',
package_dir={'trytond.modules.sale_shipment_cost': '.'},
packages=[
'trytond.modules.sale_shipment_cost',
@@ -57,6 +72,7 @@ setup(name='trytond_sale_shipment_cost',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Plugins',
+ 'Framework :: Tryton',
'Intended Audience :: Developers',
'Intended Audience :: Financial and Insurance Industry',
'Intended Audience :: Legal Industry',
@@ -73,7 +89,6 @@ setup(name='trytond_sale_shipment_cost',
'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 ba6582b..6d83c88 100644
--- a/stock.py
+++ b/stock.py
@@ -13,7 +13,7 @@ class ShipmentOut:
__name__ = 'stock.shipment.out'
carrier = fields.Many2One('carrier', 'Carrier', states={
'readonly': Eval('state') != 'draft',
- }, on_change=['carrier'],
+ },
depends=['state'])
cost_currency = fields.Many2One('currency.currency',
'Cost Currency', states={
@@ -23,7 +23,7 @@ class ShipmentOut:
'packed']),
}, depends=['carrier', 'state'])
cost_currency_digits = fields.Function(fields.Integer(
- 'Cost Currency Digits', on_change_with=['currency']),
+ 'Cost Currency Digits'),
'on_change_with_cost_currency_digits')
cost = fields.Numeric('Cost',
digits=(16, Eval('cost_currency_digits', 2)), states={
@@ -41,15 +41,8 @@ class ShipmentOut:
'missing_account_revenue': ('Missing "Account Revenue" on '
'product "%s".'),
})
- if not cls.inventory_moves.on_change:
- cls.inventory_moves.on_change = []
- for fname in ('carrier', 'customer', 'inventory_moves'):
- if fname not in cls.inventory_moves.on_change:
- cls.inventory_moves.on_change.append(fname)
- for fname in cls.inventory_moves.on_change:
- if fname not in cls.carrier.on_change:
- cls.carrier.on_change.append(fname)
+ @fields.depends('currency')
def on_change_with_cost_currency_digits(self, name=None):
if self.cost_currency:
return self.cost_currency.digits
@@ -61,9 +54,11 @@ class ShipmentOut:
def get_carrier_context(self):
return self._get_carrier_context()
+ @fields.depends(methods=['inventory_moves'])
def on_change_carrier(self):
return self.on_change_inventory_moves()
+ @fields.depends('carrier', 'customer', 'inventory_moves')
def on_change_inventory_moves(self):
Currency = Pool().get('currency.currency')
diff --git a/tests/scenario_sale_shipment_cost.rst b/tests/scenario_sale_shipment_cost.rst
index bd506a9..2247a64 100644
--- a/tests/scenario_sale_shipment_cost.rst
+++ b/tests/scenario_sale_shipment_cost.rst
@@ -38,14 +38,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()
@@ -199,18 +199,18 @@ Sale products with cost on shipment::
>>> cost_line = sale.lines[-1]
>>> cost_line.product == carrier_product
True
- >>> cost_line.quantity == 1
- True
- >>> cost_line.amount == Decimal('3')
- True
+ >>> cost_line.quantity
+ 1
+ >>> cost_line.amount
+ Decimal('3.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('103')
- True
+ >>> sale.untaxed_amount
+ Decimal('103.00')
Send products::
@@ -218,14 +218,14 @@ Send products::
>>> shipment, = sale.shipments
>>> shipment.carrier == carrier
True
- >>> shipment.cost == Decimal('3')
- True
+ >>> shipment.cost
+ Decimal('3')
>>> shipment.cost_currency == currency
True
>>> move, = shipment.inventory_moves
>>> move.quantity = 4
- >>> shipment.cost == Decimal('3')
- True
+ >>> shipment.cost
+ Decimal('3')
>>> shipment.cost_currency == currency
True
>>> shipment.state
@@ -248,8 +248,8 @@ Check customer invoice::
>>> sale.reload()
>>> invoice, = sale.invoices
- >>> invoice.untaxed_amount == Decimal('83')
- True
+ >>> invoice.untaxed_amount
+ Decimal('83.00')
Sale products with cost on order::
@@ -268,16 +268,16 @@ Sale products with cost on order::
True
>>> cost_line.quantity == 1
True
- >>> cost_line.amount == Decimal('3')
- True
+ >>> cost_line.amount
+ Decimal('3.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('63')
- True
+ >>> sale.untaxed_amount
+ Decimal('63.00')
Check customer shipment::
@@ -289,5 +289,5 @@ Check customer invoice::
>>> sale.reload()
>>> invoice, = sale.invoices
- >>> invoice.untaxed_amount == Decimal('63')
- True
+ >>> invoice.untaxed_amount
+ Decimal('63.00')
diff --git a/tests/test_sale_shipment_cost.py b/tests/test_sale_shipment_cost.py
index 5e0b43a..5a19c69 100644
--- a/tests/test_sale_shipment_cost.py
+++ b/tests/test_sale_shipment_cost.py
@@ -1,54 +1,26 @@
-#!/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
import trytond.tests.test_tryton
-from trytond.tests.test_tryton import test_view, test_depends
-from trytond.backend.sqlite.database import Database as SQLiteDatabase
+from trytond.tests.test_tryton import test_view, test_depends, doctest_dropdb
class SaleShipmentCostTestCase(unittest.TestCase):
- '''
- Test Sale Shipment Cost module.
- '''
+ 'Test Sale Shipment Cost module'
def setUp(self):
trytond.tests.test_tryton.install_module('sale_shipment_cost')
def test0005views(self):
- '''
- Test views.
- '''
+ 'Test views'
test_view('sale_shipment_cost')
def test0006depends(self):
- '''
- Test depends.
- '''
+ 'Test depends'
test_depends()
-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()
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
@@ -57,6 +29,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 b83c8e2..2fa3972 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
[tryton]
-version=3.0.0
+version=3.2.0
depends:
account_invoice
carrier
diff --git a/trytond_sale_shipment_cost.egg-info/PKG-INFO b/trytond_sale_shipment_cost.egg-info/PKG-INFO
index 3d56bea..6460ee8 100644
--- a/trytond_sale_shipment_cost.egg-info/PKG-INFO
+++ b/trytond_sale_shipment_cost.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond-sale-shipment-cost
-Version: 3.0.0
+Version: 3.2.0
Summary: Tryton module for sale shipment cost
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_sale_shipment_cost
==========================
@@ -43,9 +43,11 @@ Description: trytond_sale_shipment_cost
http://www.tryton.org/
+Keywords: tryton sale shipment cost
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
@@ -62,6 +64,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_sale_shipment_cost.egg-info/requires.txt b/trytond_sale_shipment_cost.egg-info/requires.txt
index 61ff648..e11bdfd 100644
--- a/trytond_sale_shipment_cost.egg-info/requires.txt
+++ b/trytond_sale_shipment_cost.egg-info/requires.txt
@@ -1,6 +1,6 @@
-trytond_account_invoice >= 3.0, < 3.1
-trytond_carrier >= 3.0, < 3.1
-trytond_currency >= 3.0, < 3.1
-trytond_sale >= 3.0, < 3.1
-trytond_stock >= 3.0, < 3.1
-trytond >= 3.0, < 3.1
\ No newline at end of file
+trytond_account_invoice >= 3.2, < 3.3
+trytond_carrier >= 3.2, < 3.3
+trytond_currency >= 3.2, < 3.3
+trytond_sale >= 3.2, < 3.3
+trytond_stock >= 3.2, < 3.3
+trytond >= 3.2, < 3.3
\ No newline at end of file
--
tryton-modules-sale-shipment-cost
More information about the tryton-debian-vcs
mailing list