[tryton-debian-vcs] tryton-modules-account-dunning-letter branch upstream updated. upstream/3.4.1-1-g88b89fe

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Thu Apr 23 16:01:15 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-account-dunning-letter.git;a=commitdiff;h=upstream/3.4.1-1-g88b89fe

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

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

diff --git a/CHANGELOG b/CHANGELOG
index 796da36..1b06dc3 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,6 @@
-Version 3.4.1 - 2015-03-02
+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 5439a37..5088a33 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_account_dunning_letter
-Version: 3.4.1
+Version: 3.6.0
 Summary: Tryton module for account dunning letter
 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_account_dunning_letter
         ==============================
         
@@ -64,5 +64,7 @@ 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
 Classifier: Topic :: Office/Business :: Financial :: Accounting
diff --git a/__init__.py b/__init__.py
index 95ebfc3..554c027 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 .dunning import *
diff --git a/dunning.py b/dunning.py
index ff313a7..295df9f 100644
--- a/dunning.py
+++ b/dunning.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 operator import attrgetter
 from itertools import groupby, chain
 
@@ -45,7 +45,9 @@ class Letter(CompanyReport):
     __name__ = 'account.dunning.letter'
 
     @classmethod
-    def parse(cls, report, records, data, localcontext):
+    def get_context(cls, records, data):
+        report_context = super(Letter, cls).get_context(records, data)
+
         pool = Pool()
         Date = pool.get('ir.date')
 
@@ -72,11 +74,11 @@ class Letter(CompanyReport):
                 continue
             letters[party] = PartyLetter(dunnings=current_dunnings,
                 payments=current_payments)
-        localcontext['letters'] = letters
-        localcontext['today'] = Date.today()
-        localcontext['get_payment_amount'] = cls.get_payment_amount
-        localcontext['get_payment_currency'] = cls.get_payment_currency
-        return super(Letter, cls).parse(report, records, data, localcontext)
+        report_context['letters'] = letters
+        report_context['today'] = Date.today()
+        report_context['get_payment_amount'] = cls.get_payment_amount
+        report_context['get_payment_currency'] = cls.get_payment_currency
+        return report_context
 
     @staticmethod
     def get_party_letter():
@@ -126,14 +128,13 @@ class Letter(CompanyReport):
     @staticmethod
     def get_payment_amount(payment):
         if payment.amount_second_currency:
-            return payment.amount_second_currency.copy_sign(
-                payment.credit - payment.debit)
+            return -payment.amount_second_currency
         else:
             return payment.credit - payment.debit
 
     @staticmethod
     def get_payment_currency(payment):
-        if payment.amount_second_currency:
+        if payment.second_currency:
             return payment.second_currency
         else:
             return payment.account.company.currency
diff --git a/letter.odt b/letter.odt
index 313b03a..5f5f83f 100644
Binary files a/letter.odt and b/letter.odt differ
diff --git a/locale/de_DE.po b/locale/de_DE.po
index f8dd7fa..25c6c6a 100644
--- a/locale/de_DE.po
+++ b/locale/de_DE.po
@@ -4,7 +4,7 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "field:account.dunning.level,print_on_letter:"
 msgid "Print on Letter"
-msgstr "Auf Mahnschreiben drucken"
+msgstr "Auf Mahnschreiben andrucken"
 
 msgctxt "model:ir.action,name:report_letter"
 msgid "Dunning Letter"
diff --git a/locale/es_EC.po b/locale/es_EC.po
index ccfb6da..ab85bcf 100644
--- a/locale/es_EC.po
+++ b/locale/es_EC.po
@@ -4,15 +4,15 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "field:account.dunning.level,print_on_letter:"
 msgid "Print on Letter"
-msgstr "Imprimir en una Carta"
+msgstr "Imprimir en una carta"
 
 msgctxt "model:ir.action,name:report_letter"
 msgid "Dunning Letter"
-msgstr "Carta de Cobro"
+msgstr "Carta de cobro"
 
 msgctxt "odt:account.dunning.letter:"
 msgid "Amount"
-msgstr "Valor"
+msgstr "Importe"
 
 msgctxt "odt:account.dunning.letter:"
 msgid "Date"
@@ -28,7 +28,7 @@ msgstr "Descripción"
 
 msgctxt "odt:account.dunning.letter:"
 msgid "Due Date"
-msgstr "Fecha de Vencimiento"
+msgstr "Fecha de vencimiento"
 
 msgctxt "odt:account.dunning.letter:"
 msgid "E-Mail:"
@@ -36,7 +36,7 @@ msgstr "Correo electrónico:"
 
 msgctxt "odt:account.dunning.letter:"
 msgid "Pending Payments Received"
-msgstr "Pagos Pendientes Recibidos"
+msgstr "Pagos pendientes recibidos"
 
 msgctxt "odt:account.dunning.letter:"
 msgid "Phone:"
@@ -48,7 +48,7 @@ msgstr "Referencia"
 
 msgctxt "odt:account.dunning.letter:"
 msgid "Reminder Notice"
-msgstr "Aviso Recordatorio"
+msgstr "Aviso recordatorio"
 
 msgctxt "odt:account.dunning.letter:"
 msgid "VAT Number:"
diff --git a/setup.py b/setup.py
index f51cfa8..455139b 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
@@ -47,7 +47,7 @@ for dep in info.get('depends', []):
         requires.append(get_require_version('trytond_%s' % dep))
 requires.append(get_require_version('trytond'))
 
-tests_require = []
+tests_require = [get_require_version('proteus')]
 dependency_links = []
 if minor_version % 2:
     # Add development index for testing with proteus
@@ -91,6 +91,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',
         'Topic :: Office/Business :: Financial :: Accounting',
         ],
diff --git a/tests/__init__.py b/tests/__init__.py
index f1b3bee..e1241c6 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_account_dunning_letter import suite
 
diff --git a/tests/scenario_account_dunning_letter.rst b/tests/scenario_account_dunning_letter.rst
new file mode 100644
index 0000000..affe96a
--- /dev/null
+++ b/tests/scenario_account_dunning_letter.rst
@@ -0,0 +1,182 @@
+========================
+Account Dunning 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
+    >>> today = datetime.date.today()
+
+Create database::
+
+    >>> config = config.set_trytond()
+    >>> config.pool.test = True
+
+Install account_dunning_letter::
+
+    >>> Module = Model.get('ir.module.module')
+    >>> module, = Module.find([
+    ...         ('name', '=', 'account_dunning_letter'),
+    ...         ])
+    >>> module.click('install')
+    >>> Wizard('ir.module.module.install_upgrade').execute('upgrade')
+
+Create company::
+
+    >>> _ = create_company()
+    >>> company = get_company()
+
+Reload the context::
+
+    >>> User = Model.get('res.user')
+    >>> Group = Model.get('res.group')
+    >>> config._context = User.get_preferences(True, config.context)
+
+Create account admin user::
+
+    >>> account_admin_user = User()
+    >>> account_admin_user.name = 'Account Admin'
+    >>> account_admin_user.login = 'account_admin'
+    >>> account_admin_group, = Group.find([
+    ...         ('name', '=', 'Account Administration'),
+    ...         ])
+    >>> account_admin_user.groups.append(account_admin_group)
+    >>> account_admin_user.save()
+
+Create account user::
+
+    >>> account_user = User()
+    >>> account_user.name = 'Account'
+    >>> account_user.login = 'account'
+    >>> account_group, = Group.find([
+    ...         ('name', '=', 'Account'),
+    ...         ])
+    >>> account_user.groups.append(account_group)
+    >>> account_user.save()
+
+Create dunning user::
+
+    >>> dunning_user = User()
+    >>> dunning_user.name = 'Dunning'
+    >>> dunning_user.login = 'dunning'
+    >>> dunning_group, = Group.find([('name', '=', 'Dunning')])
+    >>> dunning_user.groups.append(dunning_group)
+    >>> dunning_user.save()
+
+Create fiscal year::
+
+    >>> fiscalyear = create_fiscalyear(company)
+    >>> fiscalyear.click('create_period')
+    >>> period = fiscalyear.periods[0]
+
+Create chart of accounts::
+
+    >>> _ = create_chart(company)
+    >>> accounts = get_accounts(company)
+    >>> receivable = accounts['receivable']
+    >>> revenue = accounts['revenue']
+    >>> cash = accounts['cash']
+
+Create dunning procedure::
+
+    >>> config.user = account_admin_user.id
+    >>> Procedure = Model.get('account.dunning.procedure')
+    >>> procedure = Procedure(name='Procedure')
+    >>> level = procedure.levels.new()
+    >>> level.sequence = 1
+    >>> level.days = 5
+    >>> level = procedure.levels.new()
+    >>> level.sequence = 2
+    >>> level.days = 20
+    >>> level = procedure.levels.new()
+    >>> level.sequence = 3
+    >>> level.days = 40
+    >>> procedure.save()
+
+Create parties::
+
+    >>> Party = Model.get('party.party')
+    >>> customer = Party(name='Customer')
+    >>> customer.dunning_procedure = procedure
+    >>> customer.save()
+
+Create some moves::
+
+    >>> config.user = account_user.id
+    >>> Journal = Model.get('account.journal')
+    >>> Move = Model.get('account.move')
+    >>> journal_revenue, = Journal.find([
+    ...         ('code', '=', 'REV'),
+    ...         ])
+    >>> journal_cash, = Journal.find([
+    ...         ('code', '=', 'CASH'),
+    ...         ])
+    >>> move = Move()
+    >>> move.period = period
+    >>> move.journal = journal_revenue
+    >>> move.date = period.start_date
+    >>> line = move.lines.new()
+    >>> line.account = revenue
+    >>> line.credit = Decimal(100)
+    >>> line = move.lines.new()
+    >>> line.account = receivable
+    >>> line.debit = Decimal(100)
+    >>> line.party = customer
+    >>> line.maturity_date = period.start_date
+    >>> move.save()
+    >>> reconcile1, = [l for l in move.lines if l.account == receivable]
+    >>> move = Move()
+    >>> move.period = period
+    >>> move.journal = journal_cash
+    >>> move.date = period.start_date
+    >>> line = move.lines.new()
+    >>> line.account = cash
+    >>> line.debit = Decimal(100)
+    >>> line = move.lines.new()
+    >>> line.account = receivable
+    >>> line.credit = Decimal(100)
+    >>> line.party = customer
+    >>> move.save()
+    >>> reconcile2, = [l for l in move.lines if l.account == receivable]
+    >>> reconcile_lines = Wizard('account.move.reconcile_lines',
+    ...     [reconcile1, reconcile2])
+    >>> move = Move()
+    >>> move.period = period
+    >>> move.journal = journal_revenue
+    >>> move.date = period.start_date
+    >>> line = move.lines.new()
+    >>> line.account = revenue
+    >>> line.credit = Decimal(100)
+    >>> line = move.lines.new()
+    >>> line.account = receivable
+    >>> line.debit = Decimal(100)
+    >>> line.party = customer
+    >>> line.maturity_date = period.start_date
+    >>> move.save()
+    >>> dunning_line, = [l for l in move.lines if l.account == receivable]
+
+Create dunnings::
+
+    >>> config.user = dunning_user.id
+    >>> Dunning = Model.get('account.dunning')
+    >>> create_dunning = Wizard('account.dunning.create')
+    >>> create_dunning.form.date = period.start_date + relativedelta(days=5)
+    >>> create_dunning.execute('create_')
+    >>> dunning, = Dunning.find([])
+
+Process dunning::
+
+    >>> process_dunning = Wizard('account.dunning.process',
+    ...     [dunning])
+    >>> process_dunning.execute('process')
+    >>> dunning.reload()
+    >>> dunning.state
+    u'done'
+
diff --git a/tests/test_account_dunning_letter.py b/tests/test_account_dunning_letter.py
index edf0093..1c72aa3 100644
--- a/tests/test_account_dunning_letter.py
+++ b/tests/test_account_dunning_letter.py
@@ -1,27 +1,22 @@
-#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
+import doctest
 import trytond.tests.test_tryton
-from trytond.tests.test_tryton import test_view, test_depends
+from trytond.tests.test_tryton import ModuleTestCase
+from trytond.tests.test_tryton import doctest_setup, doctest_teardown
 
 
-class AccountDunningLetterTestCase(unittest.TestCase):
+class AccountDunningLetterTestCase(ModuleTestCase):
     'Test AccountDunningLetter module'
-
-    def setUp(self):
-        trytond.tests.test_tryton.install_module('account_dunning_letter')
-
-    def test0005views(self):
-        'Test views'
-        test_view('account_dunning_letter')
-
-    def test0006depends(self):
-        'Test depends'
-        test_depends()
+    module = 'account_dunning_letter'
 
 
 def suite():
     suite = trytond.tests.test_tryton.suite()
     suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
         AccountDunningLetterTestCase))
+    suite.addTests(doctest.DocFileSuite('scenario_account_dunning_letter.rst',
+            setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8',
+            optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
     return suite
diff --git a/tryton.cfg b/tryton.cfg
index fcce38e..af15a24 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.4.1
+version=3.6.0
 depends:
     account
     account_dunning
diff --git a/trytond_account_dunning_letter.egg-info/PKG-INFO b/trytond_account_dunning_letter.egg-info/PKG-INFO
index d78f05b..1a10341 100644
--- a/trytond_account_dunning_letter.egg-info/PKG-INFO
+++ b/trytond_account_dunning_letter.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond-account-dunning-letter
-Version: 3.4.1
+Version: 3.6.0
 Summary: Tryton module for account dunning letter
 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_account_dunning_letter
         ==============================
         
@@ -64,5 +64,7 @@ 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
 Classifier: Topic :: Office/Business :: Financial :: Accounting
diff --git a/trytond_account_dunning_letter.egg-info/SOURCES.txt b/trytond_account_dunning_letter.egg-info/SOURCES.txt
index 3ec9f08..6a68dee 100644
--- a/trytond_account_dunning_letter.egg-info/SOURCES.txt
+++ b/trytond_account_dunning_letter.egg-info/SOURCES.txt
@@ -34,6 +34,7 @@ locale/es_EC.po
 locale/es_ES.po
 locale/fr_FR.po
 locale/sl_SI.po
+tests/scenario_account_dunning_letter.rst
 trytond_account_dunning_letter.egg-info/PKG-INFO
 trytond_account_dunning_letter.egg-info/SOURCES.txt
 trytond_account_dunning_letter.egg-info/dependency_links.txt
diff --git a/trytond_account_dunning_letter.egg-info/requires.txt b/trytond_account_dunning_letter.egg-info/requires.txt
index 01483c4..b5d8770 100644
--- a/trytond_account_dunning_letter.egg-info/requires.txt
+++ b/trytond_account_dunning_letter.egg-info/requires.txt
@@ -1,5 +1,5 @@
-trytond_account >= 3.4, < 3.5
-trytond_account_dunning >= 3.4, < 3.5
-trytond_company >= 3.4, < 3.5
-trytond_party >= 3.4, < 3.5
-trytond >= 3.4, < 3.5
\ No newline at end of file
+trytond_account >= 3.6, < 3.7
+trytond_account_dunning >= 3.6, < 3.7
+trytond_company >= 3.6, < 3.7
+trytond_party >= 3.6, < 3.7
+trytond >= 3.6, < 3.7
\ No newline at end of file
-- 
tryton-modules-account-dunning-letter



More information about the tryton-debian-vcs mailing list