[tryton-debian-vcs] tryton-modules-account-payment-clearing branch upstream updated. upstream/3.8.1-2-gd7a7d8b
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Thu Jun 2 16:07:52 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-account-payment-clearing.git;a=commitdiff;h=upstream/3.8.1-2-gd7a7d8b
commit d7a7d8b2fe5febdfcb1fe257e0ce1ec361637c70
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Fri May 27 18:35:09 2016 +0200
Adding upstream version 4.0.1.
Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>
diff --git a/CHANGELOG b/CHANGELOG
index 755023a..61a74a2 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 4.0.1 - 2016-05-11
+* Bug fixes (see mercurial logs for details)
+
Version 4.0.0 - 2016-05-02
* Bug fixes (see mercurial logs for details)
* Add Python3 support
diff --git a/PKG-INFO b/PKG-INFO
index 4de5edd..3aa9fea 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: trytond_account_payment_clearing
-Version: 4.0.0
+Version: 4.0.1
Summary: Tryton module for payment clearing
Home-page: http://www.tryton.org/
Author: Tryton
diff --git a/locale/lo_LA.po b/locale/lo_LA.po
index c8e704f..6e2caf5 100644
--- a/locale/lo_LA.po
+++ b/locale/lo_LA.po
@@ -4,16 +4,16 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:account.payment,clearing_move:"
msgid "Clearing Move"
-msgstr ""
+msgstr "ຊໍາລະເຄື່ອນຍ້າຍ"
msgctxt "field:account.payment.journal,clearing_account:"
msgid "Clearing Account"
-msgstr ""
+msgstr "ບັນຊີສະສາງ"
msgctxt "field:account.payment.journal,clearing_journal:"
msgid "Clearing Journal"
-msgstr ""
+msgstr "ບັນຊີສະສາງປະຈຳວັນ"
msgctxt "field:account.statement.line,payment:"
msgid "Payment"
-msgstr ""
+msgstr "ການຈ່າຍ"
diff --git a/tryton.cfg b/tryton.cfg
index 4397362..34ce850 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
[tryton]
-version=4.0.0
+version=4.0.1
depends:
account_payment
ir
diff --git a/trytond_account_payment_clearing.egg-info/PKG-INFO b/trytond_account_payment_clearing.egg-info/PKG-INFO
index 6b041f8..8713192 100644
--- a/trytond_account_payment_clearing.egg-info/PKG-INFO
+++ b/trytond_account_payment_clearing.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: trytond-account-payment-clearing
-Version: 4.0.0
+Version: 4.0.1
Summary: Tryton module for payment clearing
Home-page: http://www.tryton.org/
Author: Tryton
diff --git a/trytond_account_payment_clearing.egg-info/SOURCES.txt b/trytond_account_payment_clearing.egg-info/SOURCES.txt
index d19fbc1..1e7d91e 100644
--- a/trytond_account_payment_clearing.egg-info/SOURCES.txt
+++ b/trytond_account_payment_clearing.egg-info/SOURCES.txt
@@ -28,12 +28,16 @@ tryton.cfg
./locale/hu_HU.po
./locale/it_IT.po
./locale/ja_JP.po
+./locale/lo_LA.po
./locale/lt_LT.po
./locale/nl_NL.po
./locale/pt_BR.po
./locale/ru_RU.po
./locale/sl_SI.po
+./locale/zh_CN.po
./tests/__init__.py
+./tests/scenario_account_negative_payment_clearing.rst
+./tests/scenario_account_payment_clearing.rst
./tests/test_account_payment_clearing.py
./view/payment_form.xml
./view/payment_journal_form.xml
diff --git a/trytond_account_payment_clearing.egg-info/requires.txt b/trytond_account_payment_clearing.egg-info/requires.txt
index 76ccaec..c934446 100644
--- a/trytond_account_payment_clearing.egg-info/requires.txt
+++ b/trytond_account_payment_clearing.egg-info/requires.txt
@@ -1,2 +1,2 @@
trytond_account_payment >= 4.0, < 4.1
-trytond >= 4.0, < 4.1
\ No newline at end of file
+trytond >= 4.0, < 4.1
commit 74475035757b100e14eba6ce251c5c43016e3a24
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Fri May 27 18:25:49 2016 +0200
Adding upstream version 4.0.0.
Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>
diff --git a/CHANGELOG b/CHANGELOG
index 0f3cd95..755023a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,6 @@
-Version 3.8.1 - 2016-04-06
+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/PKG-INFO b/PKG-INFO
index 050ceeb..4de5edd 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond_account_payment_clearing
-Version: 3.8.1
+Version: 4.0.0
Summary: Tryton module for payment clearing
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_account_payment_clearing
================================
@@ -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/account.py b/account.py
index 76721de..4f8a9dc 100644
--- a/account.py
+++ b/account.py
@@ -4,10 +4,10 @@ from trytond.pool import PoolMeta
__all__ = ['Move']
-__metaclass__ = PoolMeta
class Move:
+ __metaclass__ = PoolMeta
__name__ = 'account.move'
@classmethod
diff --git a/locale/lo_LA.po b/locale/lo_LA.po
new file mode 100644
index 0000000..c8e704f
--- /dev/null
+++ b/locale/lo_LA.po
@@ -0,0 +1,19 @@
+#
+msgid ""
+msgstr "Content-Type: text/plain; charset=utf-8\n"
+
+msgctxt "field:account.payment,clearing_move:"
+msgid "Clearing Move"
+msgstr ""
+
+msgctxt "field:account.payment.journal,clearing_account:"
+msgid "Clearing Account"
+msgstr ""
+
+msgctxt "field:account.payment.journal,clearing_journal:"
+msgid "Clearing Journal"
+msgstr ""
+
+msgctxt "field:account.statement.line,payment:"
+msgid "Payment"
+msgstr ""
diff --git a/locale/zh_CN.po b/locale/zh_CN.po
new file mode 100644
index 0000000..c8e704f
--- /dev/null
+++ b/locale/zh_CN.po
@@ -0,0 +1,19 @@
+#
+msgid ""
+msgstr "Content-Type: text/plain; charset=utf-8\n"
+
+msgctxt "field:account.payment,clearing_move:"
+msgid "Clearing Move"
+msgstr ""
+
+msgctxt "field:account.payment.journal,clearing_account:"
+msgid "Clearing Account"
+msgstr ""
+
+msgctxt "field:account.payment.journal,clearing_journal:"
+msgid "Clearing Journal"
+msgstr ""
+
+msgctxt "field:account.statement.line,payment:"
+msgid "Payment"
+msgstr ""
diff --git a/payment.py b/payment.py
index 77720be..48474c8 100644
--- a/payment.py
+++ b/payment.py
@@ -7,10 +7,10 @@ from trytond.model import ModelView, Workflow, fields
from trytond.pyson import Eval, Bool
__all__ = ['Journal', 'Payment']
-__metaclass__ = PoolMeta
class Journal:
+ __metaclass__ = PoolMeta
__name__ = 'account.payment.journal'
clearing_account = fields.Many2One('account.account', 'Clearing Account',
domain=[('party_required', '=', False)],
@@ -26,6 +26,7 @@ class Journal:
class Payment:
+ __metaclass__ = PoolMeta
__name__ = 'account.payment'
clearing_move = fields.Many2One('account.move', 'Clearing Move',
readonly=True)
@@ -50,7 +51,7 @@ class Payment:
cls.write(*sum((([m.origin], {'clearing_move': m.id})
for m in moves), ()))
- to_reconcile = defaultdict(list)
+ to_reconcile = []
for payment in payments:
if (payment.line
and not payment.line.reconciliation
@@ -58,8 +59,8 @@ class Payment:
lines = [l for l in payment.clearing_move.lines
if l.account == payment.line.account] + [payment.line]
if not sum(l.debit - l.credit for l in lines):
- to_reconcile[payment.party].extend(lines)
- for lines in to_reconcile.itervalues():
+ to_reconcile.append(lines)
+ for lines in to_reconcile:
Line.reconcile(lines)
def create_clearing_move(self, date=None):
diff --git a/setup.py b/setup.py
index e3258cc..b1f7370 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'))
@@ -71,7 +77,7 @@ setup(name=name,
package_data={
'trytond.modules.account_payment_clearing': (info.get('xml', [])
+ ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.odt',
- 'icons/*.svg']),
+ 'icons/*.svg', 'tests/*.rst']),
},
classifiers=[
'Development Status :: 5 - Production/Stable',
@@ -83,6 +89,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',
@@ -96,6 +103,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',
@@ -112,4 +122,9 @@ setup(name=name,
test_suite='tests',
test_loader='trytond.test_loader:Loader',
tests_require=tests_require,
+ use_2to3=True,
+ convert_2to3_doctests=[
+ 'tests/scenario_account_negative_payment_clearing.rst',
+ 'tests/scenario_account_payment_clearing.rst',
+ ],
)
diff --git a/statement.py b/statement.py
index 00c3512..a82e794 100644
--- a/statement.py
+++ b/statement.py
@@ -6,10 +6,10 @@ from trytond.pyson import Eval, If, Bool
from trytond.transaction import Transaction
__all__ = ['Statement', 'StatementLine']
-__metaclass__ = PoolMeta
class Statement:
+ __metaclass__ = PoolMeta
__name__ = 'account.statement'
@classmethod
@@ -40,6 +40,7 @@ class Statement:
class StatementLine:
+ __metaclass__ = PoolMeta
__name__ = 'account.statement.line'
payment = fields.Many2One('account.payment', 'Payment',
domain=[
diff --git a/tests/__init__.py b/tests/__init__.py
index bb4ae69..d500392 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_account_payment_clearing import suite
+try:
+ from trytond.modules.account_payment_clearing.tests.test_account_payment_clearing import suite
+except ImportError:
+ from .test_account_payment_clearing import suite
__all__ = ['suite']
diff --git a/tests/scenario_account_negative_payment_clearing.rst b/tests/scenario_account_negative_payment_clearing.rst
new file mode 100644
index 0000000..8cd9088
--- /dev/null
+++ b/tests/scenario_account_negative_payment_clearing.rst
@@ -0,0 +1,121 @@
+==================================
+Negative Payment Clearing Scenario
+==================================
+
+Imports::
+ >>> import datetime
+ >>> from dateutil.relativedelta import relativedelta
+ >>> from decimal import Decimal
+ >>> from proteus import config, Model, Wizard
+ >>> from trytond.modules.company.tests.tools import create_company, \
+ ... get_company
+ >>> from trytond.modules.account.tests.tools import create_fiscalyear, \
+ ... create_chart, get_accounts
+ >>> from trytond.modules.account_invoice.tests.tools import \
+ ... set_fiscalyear_invoice_sequences
+ >>> today = datetime.date.today()
+
+Create database::
+
+ >>> config = config.set_trytond()
+ >>> config.pool.test = True
+
+Install account_payment_clearing::
+
+ >>> Module = Model.get('ir.module')
+ >>> account_payment_module, = Module.find(
+ ... [('name', '=', 'account_payment_clearing')])
+ >>> account_payment_module.click('install')
+ >>> account_statement_module, = Module.find(
+ ... [('name', '=', 'account_statement')])
+ >>> account_statement_module.click('install')
+ >>> Wizard('ir.module.install_upgrade').execute('upgrade')
+
+Create company::
+
+ >>> _ = create_company()
+ >>> company = get_company()
+
+Create fiscal year::
+
+ >>> fiscalyear = set_fiscalyear_invoice_sequences(
+ ... create_fiscalyear(company))
+ >>> fiscalyear.click('create_period')
+
+Create chart of accounts::
+
+ >>> _ = create_chart(company)
+ >>> accounts = get_accounts(company)
+ >>> receivable = accounts['receivable']
+ >>> payable = accounts['payable']
+ >>> cash = accounts['cash']
+
+ >>> Account = Model.get('account.account')
+ >>> bank_clearing = Account(name='Bank Clearing', type=payable.type,
+ ... reconcile=True, deferral=True, parent=payable.parent, kind='other')
+ >>> bank_clearing.save()
+
+ >>> Journal = Model.get('account.journal')
+ >>> expense, = Journal.find([('code', '=', 'EXP')])
+
+Create payment journal::
+
+ >>> PaymentJournal = Model.get('account.payment.journal')
+ >>> payment_journal = PaymentJournal(name='Manual',
+ ... process_method='manual', clearing_journal=expense,
+ ... clearing_account=bank_clearing)
+ >>> payment_journal.save()
+
+Create parties::
+
+ >>> Party = Model.get('party.party')
+ >>> supplier = Party(name='Supplier')
+ >>> supplier.save()
+
+Create payable move::
+
+ >>> Move = Model.get('account.move')
+ >>> move = Move()
+ >>> move.journal = expense
+ >>> line = move.lines.new(account=payable, party=supplier,
+ ... debit=Decimal('-50.00'))
+ >>> line = move.lines.new(account=expense, credit=Decimal('-50.00'))
+ >>> move.click('post')
+ >>> payable.reload()
+ >>> payable.balance
+ Decimal('-50.00')
+
+Pay the line::
+
+ >>> Payment = Model.get('account.payment')
+ >>> line, = [l for l in move.lines if l.account == payable]
+ >>> pay_line = Wizard('account.move.line.pay', [line])
+ >>> pay_line.form.journal = payment_journal
+ >>> pay_line.execute('pay')
+ >>> payment, = Payment.find([('state', '=', 'draft')])
+ >>> payment.amount
+ Decimal('50.00')
+ >>> payment.click('approve')
+ >>> payment.state
+ u'approved'
+ >>> process_payment = Wizard('account.payment.process', [payment])
+ >>> process_payment.execute('process')
+ >>> payment.reload()
+ >>> payment.state
+ u'processing'
+
+Succeed payment::
+
+ >>> payment.click('succeed')
+ >>> payment.state
+ u'succeeded'
+ >>> payment.clearing_move.state
+ u'draft'
+ >>> payable.reload()
+ >>> payable.balance
+ Decimal('0.00')
+ >>> bank_clearing.reload()
+ >>> bank_clearing.balance
+ Decimal('-50.00')
+ >>> bool(payment.line.reconciliation)
+ True
diff --git a/tests/scenario_account_payment_clearing.rst b/tests/scenario_account_payment_clearing.rst
index c45e605..9262d3f 100644
--- a/tests/scenario_account_payment_clearing.rst
+++ b/tests/scenario_account_payment_clearing.rst
@@ -11,7 +11,7 @@ Imports::
... get_company
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
... create_chart, get_accounts
- >>> from.trytond.modules.account_invoice.tests.tools import \
+ >>> from trytond.modules.account_invoice.tests.tools import \
... set_fiscalyear_invoice_sequences
>>> today = datetime.date.today()
diff --git a/tests/test_account_payment_clearing.py b/tests/test_account_payment_clearing.py
index c0ffdfd..fcbb467 100644
--- a/tests/test_account_payment_clearing.py
+++ b/tests/test_account_payment_clearing.py
@@ -5,6 +5,7 @@ import doctest
import trytond.tests.test_tryton
from trytond.tests.test_tryton import ModuleTestCase
from trytond.tests.test_tryton import doctest_setup, doctest_teardown
+from trytond.tests.test_tryton import doctest_checker
class AccountPaymentTestCase(ModuleTestCase):
@@ -19,5 +20,11 @@ def suite():
suite.addTests(doctest.DocFileSuite(
'scenario_account_payment_clearing.rst',
setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8',
+ checker=doctest_checker,
+ optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
+ suite.addTests(doctest.DocFileSuite(
+ 'scenario_account_negative_payment_clearing.rst',
+ setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8',
+ checker=doctest_checker,
optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
return suite
diff --git a/tryton.cfg b/tryton.cfg
index f427461..4397362 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
[tryton]
-version=3.8.1
+version=4.0.0
depends:
account_payment
ir
diff --git a/trytond_account_payment_clearing.egg-info/PKG-INFO b/trytond_account_payment_clearing.egg-info/PKG-INFO
index 45df29b..6b041f8 100644
--- a/trytond_account_payment_clearing.egg-info/PKG-INFO
+++ b/trytond_account_payment_clearing.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond-account-payment-clearing
-Version: 3.8.1
+Version: 4.0.0
Summary: Tryton module for payment clearing
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_account_payment_clearing
================================
@@ -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_account_payment_clearing.egg-info/SOURCES.txt b/trytond_account_payment_clearing.egg-info/SOURCES.txt
index a9b382d..d19fbc1 100644
--- a/trytond_account_payment_clearing.egg-info/SOURCES.txt
+++ b/trytond_account_payment_clearing.egg-info/SOURCES.txt
@@ -53,11 +53,14 @@ locale/fr_FR.po
locale/hu_HU.po
locale/it_IT.po
locale/ja_JP.po
+locale/lo_LA.po
locale/lt_LT.po
locale/nl_NL.po
locale/pt_BR.po
locale/ru_RU.po
locale/sl_SI.po
+locale/zh_CN.po
+tests/scenario_account_negative_payment_clearing.rst
tests/scenario_account_payment_clearing.rst
trytond_account_payment_clearing.egg-info/PKG-INFO
trytond_account_payment_clearing.egg-info/SOURCES.txt
diff --git a/trytond_account_payment_clearing.egg-info/requires.txt b/trytond_account_payment_clearing.egg-info/requires.txt
index fdae59f..76ccaec 100644
--- a/trytond_account_payment_clearing.egg-info/requires.txt
+++ b/trytond_account_payment_clearing.egg-info/requires.txt
@@ -1,2 +1,2 @@
-trytond_account_payment >= 3.8, < 3.9
-trytond >= 3.8, < 3.9
+trytond_account_payment >= 4.0, < 4.1
+trytond >= 4.0, < 4.1
\ No newline at end of file
--
tryton-modules-account-payment-clearing
More information about the tryton-debian-vcs
mailing list