[tryton-debian-vcs] tryton-modules-account-statement branch upstream updated. upstream/3.0.1-1-g91c07c7

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


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-statement.git;a=commitdiff;h=upstream/3.0.1-1-g91c07c7

commit 91c07c75a41b77c1d5f4803cb96c0b6605c99113
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Apr 22 14:20:48 2014 +0200

    Adding upstream version 3.2.0.

diff --git a/CHANGELOG b/CHANGELOG
index 0e8e662..7c13179 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,7 @@
-Version 3.0.1 - 2014-01-18
+Version 3.2.0 - 2014-04-21
 * Bug fixes (see mercurial logs for details)
+* Append new line under the original one
+* Prevent usage of paid invoice in draft statements
 
 Version 3.0.0 - 2013-10-21
 * Bug fixes (see mercurial logs for details)
diff --git a/COPYRIGHT b/COPYRIGHT
index 5d422e0..77715d8 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,6 +1,6 @@
-Copyright (C) 2008-2013 Cédric Krier.
+Copyright (C) 2008-2014 Cédric Krier.
 Copyright (C) 2008-2013 Bertrand Chenal.
-Copyright (C) 2008-2013 B2CK SPRL.
+Copyright (C) 2008-2014 B2CK SPRL.
 Copyright (C) 2004-2008 Tiny SPRL.
 
 This program is free software: you can redistribute it and/or modify
diff --git a/INSTALL b/INSTALL
index d7e3980..56d9a0e 100644
--- a/INSTALL
+++ b/INSTALL
@@ -4,7 +4,7 @@ Installing trytond_account_statement
 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_account (http://www.tryton.org/)
  * trytond_company (http://www.tryton.org/)
diff --git a/MANIFEST.in b/MANIFEST.in
index 2f9d677..5abcf8d 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,12 +1,10 @@
 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 tests/*.rst
diff --git a/PKG-INFO b/PKG-INFO
index 627d223..10e9944 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_account_statement
-Version: 3.0.1
+Version: 3.2.0
 Summary: Tryton module with account statements
 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_account_statement
         =========================
         
@@ -43,6 +43,7 @@ Description: trytond_account_statement
         
           http://www.tryton.org/
         
+Keywords: tryton account statement
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Plugins
@@ -62,7 +63,6 @@ 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
 Classifier: Topic :: Office/Business :: Financial :: Accounting
diff --git a/journal.xml b/journal.xml
index ad9a92b..54f890b 100644
--- a/journal.xml
+++ b/journal.xml
@@ -51,5 +51,14 @@ this repository contains the full copyright notices and license terms. -->
             <field name="perm_delete" eval="True"/>
         </record>
 
+        <record model="ir.rule.group" id="rule_group_statement_journal">
+            <field name="model" search="[('model', '=', 'account.statement.journal')]"/>
+            <field name="global_p" eval="True"/>
+        </record>
+        <record model="ir.rule" id="rule_statement_journal1">
+            <field name="domain">[('company', '=', user.company.id if user.company else None)]</field>
+            <field name="rule_group" ref="rule_group_statement_journal"/>
+        </record>
+
     </data>
 </tryton>
diff --git a/locale/bg_BG.po b/locale/bg_BG.po
index 89f7e17..1f60a0b 100644
--- a/locale/bg_BG.po
+++ b/locale/bg_BG.po
@@ -28,6 +28,10 @@ msgctxt "error:account.statement:"
 msgid "Statement \"%s\" must be cancelled before deletion."
 msgstr ""
 
+msgctxt "error:account.statement:"
+msgid "There are paid invoices on draft statements, do you want to proceed?"
+msgstr ""
+
 msgctxt "field:account.statement,balance:"
 msgid "Balance"
 msgstr "Баланс"
diff --git a/locale/ca_ES.po b/locale/ca_ES.po
index 883a1b8..abbbfb1 100644
--- a/locale/ca_ES.po
+++ b/locale/ca_ES.po
@@ -30,6 +30,10 @@ msgctxt "error:account.statement:"
 msgid "Statement \"%s\" must be cancelled before deletion."
 msgstr "Heu de cancel·lar l'extracte \"%s\"abans de ser eliminat."
 
+msgctxt "error:account.statement:"
+msgid "There are paid invoices on draft statements, do you want to proceed?"
+msgstr "Hi ha factures pagades a extractes esborrany, voleu continuar? "
+
 msgctxt "field:account.statement,balance:"
 msgid "Balance"
 msgstr "Saldo"
diff --git a/locale/cs_CZ.po b/locale/cs_CZ.po
index ca6fb04..c7f1745 100644
--- a/locale/cs_CZ.po
+++ b/locale/cs_CZ.po
@@ -28,6 +28,10 @@ msgctxt "error:account.statement:"
 msgid "Statement \"%s\" must be cancelled before deletion."
 msgstr ""
 
+msgctxt "error:account.statement:"
+msgid "There are paid invoices on draft statements, do you want to proceed?"
+msgstr ""
+
 msgctxt "field:account.statement,balance:"
 msgid "Balance"
 msgstr ""
diff --git a/locale/de_DE.po b/locale/de_DE.po
index 9f71231..02e92bd 100644
--- a/locale/de_DE.po
+++ b/locale/de_DE.po
@@ -7,8 +7,8 @@ msgid ""
 "Account \"%(account)s\" in statement line \"%(line)s\" is the same as the "
 "one configured as credit or debit on journal \"%(journal)s\"."
 msgstr ""
-"Konto \"%(account)s\" in Kontoauszugszeile \"%(line)s\" ist dasselbe wie das"
-" als Soll oder Haben eingetragene in Journal \"%(journal)s\"."
+"Konto \"%(account)s\" in Bankauszugszeile \"%(line)s\" ist dasselbe wie das "
+"für Soll oder Haben eingetragene in Journal \"%(journal)s\"."
 
 msgctxt "error:account.statement.line:"
 msgid "Amount \"%s\" is greater than the amount to pay of invoice."
@@ -21,8 +21,7 @@ msgstr "Der Betrag sollte einen positiven oder negativen Wert aufweisen."
 msgctxt "error:account.statement.line:"
 msgid "Please provide debit and credit account on statement journal \"%s\"."
 msgstr ""
-"Bitte tragen Sie Soll- und Habenkonto für das Kontoauszugsjournal \"%s\" "
-"ein."
+"Bitte tragen Sie Soll- und Habenkonto für das Bankauszugsjournal \"%s\" ein."
 
 msgctxt "error:account.statement:"
 msgid "End Balance must be \"%s\"."
@@ -30,7 +29,13 @@ msgstr "Endsaldo muss \"%s\" sein."
 
 msgctxt "error:account.statement:"
 msgid "Statement \"%s\" must be cancelled before deletion."
-msgstr "Kontoauszug \"%s\" muss annulliert werden, bevor er gelöscht werden kann."
+msgstr "Bankauszug \"%s\" muss annulliert werden, bevor er gelöscht werden kann."
+
+msgctxt "error:account.statement:"
+msgid "There are paid invoices on draft statements, do you want to proceed?"
+msgstr ""
+"Es existieren bezahlte Rechnungen in Entwürfen von Bankauszügen.\n"
+"Trotzdem fortfahren?"
 
 msgctxt "field:account.statement,balance:"
 msgid "Balance"
@@ -50,7 +55,7 @@ msgstr "Erstellt durch"
 
 msgctxt "field:account.statement,currency_digits:"
 msgid "Currency Digits"
-msgstr "Stellen Währung"
+msgstr "Nachkommastellen Währung"
 
 msgctxt "field:account.statement,date:"
 msgid "Date"
@@ -178,7 +183,7 @@ msgstr "Name"
 
 msgctxt "field:account.statement.line,statement:"
 msgid "Statement"
-msgstr "Kontoauszug"
+msgstr "Bankauszug"
 
 msgctxt "field:account.statement.line,write_date:"
 msgid "Write Date"
@@ -190,31 +195,31 @@ msgstr "Letzte Änderung durch"
 
 msgctxt "model:account.journal.type,name:journal_type_statement"
 msgid "Statement"
-msgstr "Kontoauszug"
+msgstr "Bankauszug"
 
 msgctxt "model:account.statement,name:"
 msgid "Account Statement"
-msgstr "Zahlungsverkehr"
+msgstr "Bankauszug"
 
 msgctxt "model:account.statement.journal,name:"
 msgid "Statement Journal"
-msgstr "Journal Kontoauszug"
+msgstr "Bankauszugsjournal"
 
 msgctxt "model:account.statement.line,name:"
 msgid "Account Statement Line"
-msgstr "Zahlungsverkehr Position"
+msgstr "Bankauszugszeile"
 
 msgctxt "model:ir.action,name:act_move_lines_form"
 msgid "Move Lines"
-msgstr "Buchungsposten"
+msgstr "Buchungszeilen"
 
 msgctxt "model:ir.action,name:act_statement_form"
 msgid "Statements"
-msgstr "Zahlungsverkehr"
+msgstr "Bankauszüge"
 
 msgctxt "model:ir.action,name:act_statement_journal_form"
 msgid "Statement Journals"
-msgstr "Journale Zahlungsverkehr"
+msgstr "Bankauszugsjournale"
 
 msgctxt "model:ir.action.act_window.domain,name:act_statement_form_domain_all"
 msgid "All"
@@ -237,23 +242,23 @@ msgstr "Geprüft"
 
 msgctxt "model:ir.ui.menu,name:menu_statement_configuration"
 msgid "Statements"
-msgstr "Zahlungsverkehr"
+msgstr "Bankauszüge"
 
 msgctxt "model:ir.ui.menu,name:menu_statement_form"
 msgid "Statements"
-msgstr "Alle Kontoauszüge"
+msgstr "Bankauszüge"
 
 msgctxt "model:ir.ui.menu,name:menu_statement_journal_form"
 msgid "Statement Journals"
-msgstr "Journale Kontoauszüge"
+msgstr "Bankauszugsjournale"
 
 msgctxt "model:ir.ui.menu,name:menu_statements"
 msgid "Statements"
-msgstr "Zahlungsverkehr"
+msgstr "Bankauszüge"
 
 msgctxt "model:res.group,name:group_statement"
 msgid "Statement"
-msgstr "Kontoauszug"
+msgstr "Bankauszug"
 
 msgctxt "selection:account.statement,state:"
 msgid "Canceled"
@@ -273,11 +278,11 @@ msgstr "Geprüft"
 
 msgctxt "view:account.statement.journal:"
 msgid "Statement Journal"
-msgstr "Journal Kontoauszug"
+msgstr "Bankauszugsjournal"
 
 msgctxt "view:account.statement.journal:"
 msgid "Statement Journals"
-msgstr "Journale Kontoauszüge"
+msgstr "Bankauszugsjournale"
 
 msgctxt "view:account.statement.line:"
 msgid "Amount"
@@ -285,11 +290,11 @@ msgstr "Betrag"
 
 msgctxt "view:account.statement.line:"
 msgid "Statement Line"
-msgstr "Kontoauszug Position"
+msgstr "Bankauszug Zeile"
 
 msgctxt "view:account.statement.line:"
 msgid "Statement Lines"
-msgstr "Kontoauszug Positionen"
+msgstr "Bankauszug Zeile"
 
 msgctxt "view:account.statement:"
 msgid "Cancel"
@@ -309,15 +314,15 @@ msgstr "Festschreiben"
 
 msgctxt "view:account.statement:"
 msgid "Statement"
-msgstr "Kontoauszug"
+msgstr "Bankauszug"
 
 msgctxt "view:account.statement:"
 msgid "Statement Lines"
-msgstr "Kontoauszug Positionen"
+msgstr "Bankauszug Zeilen"
 
 msgctxt "view:account.statement:"
 msgid "Statements"
-msgstr "Kontoauszüge"
+msgstr "Bankauszüge"
 
 msgctxt "view:account.statement:"
 msgid "Validate"
diff --git a/locale/es_AR.po b/locale/es_AR.po
index 3d79ce0..0cca9b9 100644
--- a/locale/es_AR.po
+++ b/locale/es_AR.po
@@ -31,6 +31,10 @@ msgctxt "error:account.statement:"
 msgid "Statement \"%s\" must be cancelled before deletion."
 msgstr "Debe cancelar el extracto «%s» antes de eliminar."
 
+msgctxt "error:account.statement:"
+msgid "There are paid invoices on draft statements, do you want to proceed?"
+msgstr "Hay facturas pagadas en extractos en borrador, ¿desea continuar?"
+
 msgctxt "field:account.statement,balance:"
 msgid "Balance"
 msgstr "Saldo"
diff --git a/locale/es_CO.po b/locale/es_CO.po
index bb25cb4..0d23d38 100644
--- a/locale/es_CO.po
+++ b/locale/es_CO.po
@@ -12,11 +12,11 @@ msgstr ""
 
 msgctxt "error:account.statement.line:"
 msgid "Amount \"%s\" is greater than the amount to pay of invoice."
-msgstr "Cantidad \"%s\" es mayor que la cantidad a pagar en la factura."
+msgstr "El valor \"%s\" es mayor que el valor a pagar en la factura."
 
 msgctxt "error:account.statement.line:"
 msgid "Amount should be a positive or negative value."
-msgstr "La cantidad debe ser un valor positivo o negativo!"
+msgstr "El valor debería ser positivo o negativo!"
 
 msgctxt "error:account.statement.line:"
 msgid "Please provide debit and credit account on statement journal \"%s\"."
@@ -26,12 +26,17 @@ msgstr ""
 
 msgctxt "error:account.statement:"
 msgid "End Balance must be \"%s\"."
-msgstr "El Balance debe ser %s!"
+msgstr "El Saldo Final debe ser \"%s!\"."
 
 msgctxt "error:account.statement:"
 msgid "Statement \"%s\" must be cancelled before deletion."
 msgstr "El estado de cuenta \"%s\" debe ser cancelado antes de ser eliminado."
 
+msgctxt "error:account.statement:"
+msgid "There are paid invoices on draft statements, do you want to proceed?"
+msgstr ""
+"Hay facturas pagadas en estados de cuenta en borrador, desea continuar?"
+
 msgctxt "field:account.statement,balance:"
 msgid "Balance"
 msgstr "Balance"
@@ -58,7 +63,7 @@ msgstr "Fecha"
 
 msgctxt "field:account.statement,end_balance:"
 msgid "End Balance"
-msgstr "Balance Final"
+msgstr "Saldo Final"
 
 msgctxt "field:account.statement,id:"
 msgid "ID"
@@ -66,7 +71,7 @@ msgstr "ID"
 
 msgctxt "field:account.statement,journal:"
 msgid "Journal"
-msgstr "Libro Diario"
+msgstr "Libro Contable"
 
 msgctxt "field:account.statement,lines:"
 msgid "Transactions"
@@ -114,7 +119,7 @@ msgstr "ID"
 
 msgctxt "field:account.statement.journal,journal:"
 msgid "Journal"
-msgstr "Libro Diario"
+msgstr "Libro Contable"
 
 msgctxt "field:account.statement.journal,name:"
 msgid "Name"
@@ -138,7 +143,7 @@ msgstr "Cuenta"
 
 msgctxt "field:account.statement.line,amount:"
 msgid "Amount"
-msgstr "Cantidad"
+msgstr "Valor"
 
 msgctxt "field:account.statement.line,create_date:"
 msgid "Create Date"
@@ -228,7 +233,7 @@ msgstr "Borrador"
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_statement_form_domain_posted"
 msgid "Posted"
-msgstr "Confirmado"
+msgstr "Contabilizado"
 
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_statement_form_domain_validated"
@@ -245,7 +250,7 @@ msgstr "Estados de Cuenta"
 
 msgctxt "model:ir.ui.menu,name:menu_statement_journal_form"
 msgid "Statement Journals"
-msgstr "Diarios de Estados de Cuenta"
+msgstr "Libros de Estados de Cuenta"
 
 msgctxt "model:ir.ui.menu,name:menu_statements"
 msgid "Statements"
@@ -257,7 +262,7 @@ msgstr "Estado de Cuenta"
 
 msgctxt "selection:account.statement,state:"
 msgid "Canceled"
-msgstr "Cancelado"
+msgstr "Anulado"
 
 msgctxt "selection:account.statement,state:"
 msgid "Draft"
@@ -265,7 +270,7 @@ msgstr "Borrador"
 
 msgctxt "selection:account.statement,state:"
 msgid "Posted"
-msgstr "Confirmado"
+msgstr "Contabilizado"
 
 msgctxt "selection:account.statement,state:"
 msgid "Validated"
@@ -281,7 +286,7 @@ msgstr "Libros de Estados de Cuenta"
 
 msgctxt "view:account.statement.line:"
 msgid "Amount"
-msgstr "Cantidad"
+msgstr "Valor"
 
 msgctxt "view:account.statement.line:"
 msgid "Statement Line"
@@ -305,7 +310,7 @@ msgstr "Info Adicional"
 
 msgctxt "view:account.statement:"
 msgid "Post"
-msgstr "Confirmar"
+msgstr "Contabilizar"
 
 msgctxt "view:account.statement:"
 msgid "Statement"
diff --git a/locale/es_ES.po b/locale/es_ES.po
index a1ee8d4..a6e20a0 100644
--- a/locale/es_ES.po
+++ b/locale/es_ES.po
@@ -7,7 +7,7 @@ msgid ""
 "Account \"%(account)s\" in statement line \"%(line)s\" is the same as the "
 "one configured as credit or debit on journal \"%(journal)s\"."
 msgstr ""
-"La cuenta \"%(account)s\" en la línea de estracto \"%(line)s\" es la misma "
+"La cuenta \"%(account)s\" en la línea de extracto \"%(line)s\" es la misma "
 "que la configurada como haber o debe en el diario \"%(journal)s\"."
 
 msgctxt "error:account.statement.line:"
@@ -31,6 +31,10 @@ msgctxt "error:account.statement:"
 msgid "Statement \"%s\" must be cancelled before deletion."
 msgstr "Debe cancelar el extracto \"%s\" antes de borrarlo."
 
+msgctxt "error:account.statement:"
+msgid "There are paid invoices on draft statements, do you want to proceed?"
+msgstr "Existen facturas pagadas en extractos borrador, quiere continuar?"
+
 msgctxt "field:account.statement,balance:"
 msgid "Balance"
 msgstr "Saldo"
diff --git a/locale/fr_FR.po b/locale/fr_FR.po
index 7f38537..0829d7e 100644
--- a/locale/fr_FR.po
+++ b/locale/fr_FR.po
@@ -34,6 +34,12 @@ msgctxt "error:account.statement:"
 msgid "Statement \"%s\" must be cancelled before deletion."
 msgstr "Le relevé \"%s\" doit être annulé avant suppression."
 
+msgctxt "error:account.statement:"
+msgid "There are paid invoices on draft statements, do you want to proceed?"
+msgstr ""
+"Il y a des factures payées sur des relevés en brouillon, souhaitez-vous "
+"continuer ?"
+
 msgctxt "field:account.statement,balance:"
 msgid "Balance"
 msgstr "Balance"
diff --git a/locale/nl_NL.po b/locale/nl_NL.po
index b47120d..d873fdd 100644
--- a/locale/nl_NL.po
+++ b/locale/nl_NL.po
@@ -28,6 +28,10 @@ msgctxt "error:account.statement:"
 msgid "Statement \"%s\" must be cancelled before deletion."
 msgstr ""
 
+msgctxt "error:account.statement:"
+msgid "There are paid invoices on draft statements, do you want to proceed?"
+msgstr ""
+
 #, fuzzy
 msgctxt "field:account.statement,balance:"
 msgid "Balance"
diff --git a/locale/ru_RU.po b/locale/ru_RU.po
index a637262..4def06c 100644
--- a/locale/ru_RU.po
+++ b/locale/ru_RU.po
@@ -28,6 +28,10 @@ msgctxt "error:account.statement:"
 msgid "Statement \"%s\" must be cancelled before deletion."
 msgstr ""
 
+msgctxt "error:account.statement:"
+msgid "There are paid invoices on draft statements, do you want to proceed?"
+msgstr ""
+
 #, fuzzy
 msgctxt "field:account.statement,balance:"
 msgid "Balance"
diff --git a/locale/sl_SI.po b/locale/sl_SI.po
index 7e198fb..7b85bfd 100644
--- a/locale/sl_SI.po
+++ b/locale/sl_SI.po
@@ -31,13 +31,17 @@ msgctxt "error:account.statement:"
 msgid "Statement \"%s\" must be cancelled before deletion."
 msgstr "Izpisek \"%s\" mora biti pred izbrisom preklican."
 
+msgctxt "error:account.statement:"
+msgid "There are paid invoices on draft statements, do you want to proceed?"
+msgstr "Na pripravljenih izpiskih so plačani računi. Ali želite nadaljevati?"
+
 msgctxt "field:account.statement,balance:"
 msgid "Balance"
 msgstr "Bilanca"
 
 msgctxt "field:account.statement,company:"
 msgid "Company"
-msgstr "Podjetje"
+msgstr "Družba"
 
 msgctxt "field:account.statement,create_date:"
 msgid "Create Date"
@@ -93,7 +97,7 @@ msgstr "Zapisal"
 
 msgctxt "field:account.statement.journal,company:"
 msgid "Company"
-msgstr "Podjetje"
+msgstr "Družba"
 
 msgctxt "field:account.statement.journal,create_date:"
 msgid "Create Date"
@@ -169,7 +173,7 @@ msgstr "Knjižba"
 
 msgctxt "field:account.statement.line,party:"
 msgid "Party"
-msgstr "Stranka"
+msgstr "Partner"
 
 msgctxt "field:account.statement.line,rec_name:"
 msgid "Name"
@@ -222,7 +226,7 @@ msgstr "Vse"
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_statement_form_domain_draft"
 msgid "Draft"
-msgstr "Osnutki"
+msgstr "Priprava"
 
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_statement_form_domain_posted"
@@ -260,7 +264,7 @@ msgstr "Preklicano"
 
 msgctxt "selection:account.statement,state:"
 msgid "Draft"
-msgstr "Osnutek"
+msgstr "V pripravi"
 
 msgctxt "selection:account.statement,state:"
 msgid "Posted"
@@ -296,7 +300,7 @@ msgstr "Preklic"
 
 msgctxt "view:account.statement:"
 msgid "Draft"
-msgstr "Osnutek"
+msgstr "Priprava"
 
 msgctxt "view:account.statement:"
 msgid "Other Info"
diff --git a/setup.py b/setup.py
index 635b8fd..fa87e64 100644
--- a/setup.py
+++ b/setup.py
@@ -11,36 +11,53 @@ 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_account_statement'
+
+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')]
 
-setup(name='trytond_account_statement',
-    version=info.get('version', '0.0.1'),
+setup(name=name,
+    version=version,
     description='Tryton module with account statements',
     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 account statement',
     package_dir={'trytond.modules.account_statement': '.'},
     packages=[
         'trytond.modules.account_statement',
@@ -69,7 +86,6 @@ setup(name='trytond_account_statement',
         'Natural Language :: Slovenian',
         'Natural Language :: Spanish',
         'Operating System :: OS Independent',
-        'Programming Language :: Python :: 2.6',
         'Programming Language :: Python :: 2.7',
         'Topic :: Office/Business',
         'Topic :: Office/Business :: Financial :: Accounting',
diff --git a/statement.py b/statement.py
index 2f78359..6692b3c 100644
--- a/statement.py
+++ b/statement.py
@@ -23,17 +23,16 @@ class Statement(Workflow, ModelSQL, ModelView):
             ],
         depends=_DEPENDS)
     journal = fields.Many2One('account.statement.journal', 'Journal',
-        required=True,
+        required=True, select=True,
         domain=[
             ('company', '=', Eval('context', {}).get('company', -1)),
             ],
         states={
-            'readonly': (Eval('state') != 'draft') | Eval('lines'),
+            'readonly': (Eval('state') != 'draft') | Eval('lines', [0]),
             },
-        on_change=['journal', 'state', 'lines'], select=True,
-        depends=['state', 'lines'])
-    currency_digits = fields.Function(fields.Integer('Currency Digits',
-            on_change_with=['journal']), 'on_change_with_currency_digits')
+        depends=['state'])
+    currency_digits = fields.Function(fields.Integer('Currency Digits'),
+        'on_change_with_currency_digits')
     date = fields.Date('Date', required=True, states=_STATES, depends=_DEPENDS,
         select=True)
     start_balance = fields.Numeric('Start Balance', required=True,
@@ -45,13 +44,12 @@ class Statement(Workflow, ModelSQL, ModelView):
     balance = fields.Function(
         fields.Numeric('Balance',
             digits=(16, Eval('currency_digits', 2)),
-            on_change_with=['start_balance', 'end_balance'],
             depends=['currency_digits']),
         'on_change_with_balance')
     lines = fields.One2Many('account.statement.line', 'statement',
         'Transactions', states={
             'readonly': (Eval('state') != 'draft') | ~Eval('journal'),
-            }, on_change=['lines', 'journal'],
+            },
         depends=['state', 'journal'])
     state = fields.Selection([
         ('draft', 'Draft'),
@@ -68,6 +66,8 @@ class Statement(Workflow, ModelSQL, ModelView):
                 'wrong_end_balance': 'End Balance must be "%s".',
                 'delete_cancel': ('Statement "%s" must be cancelled before '
                     'deletion.'),
+                'paid_invoice_draft_statement': ('There are paid invoices on '
+                    'draft statements, do you want to proceed?'),
                 })
         cls._transitions |= set((
                 ('draft', 'validated'),
@@ -138,6 +138,7 @@ class Statement(Workflow, ModelSQL, ModelView):
             return company.currency.digits
         return 2
 
+    @fields.depends('journal', 'state', 'lines')
     def on_change_journal(self):
         res = {}
         if not self.journal:
@@ -155,6 +156,7 @@ class Statement(Workflow, ModelSQL, ModelView):
         res['start_balance'] = statement.end_balance
         return res
 
+    @fields.depends('journal')
     def on_change_with_currency_digits(self, name=None):
         if self.journal:
             return self.journal.currency.digits
@@ -188,10 +190,12 @@ class Statement(Workflow, ModelSQL, ModelView):
             end_balance += line.amount
         return end_balance
 
+    @fields.depends('start_balance', 'end_balance')
     def on_change_with_balance(self, name=None):
         return ((getattr(self, 'end_balance', 0) or 0)
             - (getattr(self, 'start_balance', 0) or 0))
 
+    @fields.depends('lines', 'journal')
     def on_change_lines(self):
         pool = Pool()
         Currency = pool.get('currency.currency')
@@ -202,7 +206,7 @@ class Statement(Workflow, ModelSQL, ModelView):
         if self.journal and self.lines:
             invoices = set()
             for line in self.lines:
-                if line.invoice:
+                if getattr(line, 'invoice', None):
                     invoices.add(line.invoice)
             invoice_id2amount_to_pay = {}
             for invoice in invoices:
@@ -215,11 +219,13 @@ class Statement(Workflow, ModelSQL, ModelView):
                         Currency.compute(invoice.currency,
                             invoice.amount_to_pay, self.journal.currency))
 
-            for line in self.lines or []:
-                if line.invoice and line.id:
+            line_offset = 0
+            for index, line in enumerate(self.lines or []):
+                if getattr(line, 'invoice', None) and line.id:
                     amount_to_pay = invoice_id2amount_to_pay[line.invoice.id]
                     res['lines'].setdefault('update', [])
                     if (not self.journal.currency.is_zero(amount_to_pay)
+                            and getattr(line, 'amount', None)
                             and (line.amount >= 0) == (amount_to_pay <= 0)):
                         res['lines']['update'].append({
                                 'id': line.id,
@@ -238,15 +244,17 @@ class Statement(Workflow, ModelSQL, ModelView):
                                 if (value and field._type in ('many2one',
                                             'one2one')):
                                     vals[field_name] = value.id
-                                    vals[field_name + '.rec_name'] = \
-                                        value.rec_name
+                                    if value.id >= 0:
+                                        vals[field_name + '.rec_name'] = \
+                                            value.rec_name
                                 else:
                                     vals[field_name] = value
                             del vals['id']
                             vals['amount'] = line.amount + amount_to_pay
                             vals['invoice'] = None
                             del vals['invoice.rec_name']
-                            res['lines']['add'].append(vals)
+                            line_offset += 1
+                            res['lines']['add'].append((index + line_offset, vals))
                             invoice_id2amount_to_pay[line.invoice.id] = 0
                         else:
                             invoice_id2amount_to_pay[line.invoice.id] = (
@@ -277,8 +285,11 @@ class Statement(Workflow, ModelSQL, ModelView):
     @ModelView.button
     @Workflow.transition('validated')
     def validate_statement(cls, statements):
-        Lang = Pool().get('ir.lang')
+        pool = Pool()
+        Lang = pool.get('ir.lang')
+        Line = pool.get('account.statement.line')
 
+        statement_lines = []
         for statement in statements:
             computed_end_balance = statement.start_balance
             for line in statement.lines:
@@ -295,6 +306,20 @@ class Statement(Workflow, ModelSQL, ModelView):
                     error_args=(amount,))
             for line in statement.lines:
                 line.create_move()
+                statement_lines.append(line.id)
+        cls.write(statements, {
+                'state': 'validated',
+                })
+        common_lines = Line.search([
+                ('statement.state', '=', 'draft'),
+                ('invoice.state', '=', 'paid'),
+                ])
+        if common_lines:
+            warning_key = '_'.join(str(l.id) for l in common_lines)
+            cls.raise_user_warning(warning_key, 'paid_invoice_draft_statement')
+            Line.write(common_lines, {
+                    'invoice': None,
+                    })
 
     @classmethod
     @ModelView.button
@@ -322,20 +347,16 @@ class Line(ModelSQL, ModelView):
             required=True, ondelete='CASCADE')
     date = fields.Date('Date', required=True)
     amount = fields.Numeric('Amount', required=True,
-        digits=(16, Eval('_parent_statement', {}).get('currency_digits', 2)),
-        on_change=['amount', 'party', 'account', 'invoice',
-            '_parent_statement.journal'])
-    party = fields.Many2One('party.party', 'Party',
-            on_change=['amount', 'party', 'invoice'])
+        digits=(16, Eval('_parent_statement', {}).get('currency_digits', 2)))
+    party = fields.Many2One('party.party', 'Party')
     account = fields.Many2One('account.account', 'Account', required=True,
-        on_change=['account', 'invoice'], domain=[
+        domain=[
             ('company', '=', Eval('_parent_statement', {}).get('company', 0)),
             ('kind', '!=', 'view'),
             ])
     description = fields.Char('Description')
     move = fields.Many2One('account.move', 'Account Move', readonly=True)
     invoice = fields.Many2One('account.invoice', 'Invoice',
-        on_change=['party', 'account', 'invoice'],
         domain=[
             If(Bool(Eval('party')), [('party', '=', Eval('party'))], []),
             If(Bool(Eval('party')), [('account', '=', Eval('account'))], []),
@@ -366,6 +387,7 @@ class Line(ModelSQL, ModelView):
     def default_amount():
         return Decimal(0)
 
+    @fields.depends('amount', 'party', 'invoice')
     def on_change_party(self):
         res = {}
 
@@ -386,6 +408,8 @@ class Line(ModelSQL, ModelView):
                 res['invoice'] = None
         return res
 
+    @fields.depends('amount', 'party', 'account', 'invoice',
+        '_parent_statement.journal')
     def on_change_amount(self):
         Currency = Pool().get('currency.currency')
         res = {}
@@ -415,6 +439,7 @@ class Line(ModelSQL, ModelView):
                 res['invoice'] = None
         return res
 
+    @fields.depends('account', 'invoice')
     def on_change_account(self):
         res = {}
 
@@ -426,6 +451,7 @@ class Line(ModelSQL, ModelView):
                 res['invoice'] = None
         return res
 
+    @fields.depends('party', 'account', 'invoice')
     def on_change_invoice(self):
         changes = {}
         if self.invoice:
@@ -536,8 +562,9 @@ class Line(ModelSQL, ModelView):
         MoveLine = pool.get('account.move.line')
         Currency = Pool().get('currency.currency')
         zero = Decimal("0.0")
-        amount = Currency.compute(self.statement.journal.currency, self.amount,
-            self.statement.company.currency)
+        with Transaction().set_context(date=self.date):
+            amount = Currency.compute(self.statement.journal.currency,
+                self.amount, self.statement.company.currency)
         if self.statement.journal.currency != self.statement.company.currency:
             second_currency = self.statement.journal.currency.id
             amount_second_currency = abs(self.amount)
diff --git a/statement.xml b/statement.xml
index 76b7688..ffaa854 100644
--- a/statement.xml
+++ b/statement.xml
@@ -174,6 +174,11 @@ this repository contains the full copyright notices and license terms. -->
             <field name="button" ref="statement_validate_button"/>
             <field name="group" ref="account.group_account"/>
         </record>
+        <record model="ir.model.button-res.group"
+            id="statement_validate_button_group_statement">
+            <field name="button" ref="statement_validate_button"/>
+            <field name="group" ref="group_statement"/>
+        </record>
 
         <record model="ir.model.button" id="statement_post_button">
             <field name="name">post</field>
@@ -200,7 +205,7 @@ this repository contains the full copyright notices and license terms. -->
         <record model="ir.action.act_window" id="act_move_lines_form">
             <field name="name">Move Lines</field>
             <field name="res_model">account.move.line</field>
-            <field name="domain">[('origin.statement.id', '=', Eval('id'), 'account.statement.line')]</field>
+            <field name="domain">[('origin.statement.id', 'in', Eval('active_ids'), 'account.statement.line')]</field>
         </record>
         <record model="ir.action.keyword" id="act_move_lines_form_keyword1">
             <field name="keyword">form_relate</field>
diff --git a/tests/scenario_account_statement.rst b/tests/scenario_account_statement.rst
index e9dd5cd..45943f9 100644
--- a/tests/scenario_account_statement.rst
+++ b/tests/scenario_account_statement.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()
@@ -240,18 +240,18 @@ Received 180 from customer::
     >>> statement_line.account == receivable
     True
     >>> statement_line.invoice = customer_invoice1
-    >>> statement_line.amount == Decimal('100')
-    True
+    >>> statement_line.amount
+    Decimal('100.00')
     >>> statement_line = statement.lines[-1]
-    >>> statement_line.amount == Decimal('80')
-    True
+    >>> statement_line.amount
+    Decimal('80.00')
     >>> statement_line.party == customer
     True
     >>> statement_line.account == receivable
     True
     >>> statement_line.invoice = customer_invoice2
-    >>> statement_line.amount == Decimal('80')
-    True
+    >>> statement_line.amount
+    Decimal('80.00')
 
 Paid 50 to customer::
 
@@ -273,11 +273,11 @@ Paid 50 to supplier::
     >>> statement_line.account == payable
     True
     >>> statement_line.invoice = supplier_invoice
-    >>> statement_line.amount == Decimal('-50')
-    True
+    >>> statement_line.amount
+    Decimal('-50.00')
     >>> statement_line = statement.lines.pop()
-    >>> statement_line.amount == Decimal('-10')
-    True
+    >>> statement_line.amount
+    Decimal('-10.00')
 
     >>> statement.save()
 
@@ -295,8 +295,8 @@ Test invoice state::
     >>> customer_invoice2.reload()
     >>> customer_invoice2.state
     u'posted'
-    >>> customer_invoice2.amount_to_pay == Decimal('70')
-    True
+    >>> customer_invoice2.amount_to_pay
+    Decimal('70.00')
     >>> customer_credit_note.reload()
     >>> customer_credit_note.state
     u'paid'
@@ -356,9 +356,63 @@ Let's test the negative amount version of the supplier/customer invoices::
     >>> statement_line.account = payable
     >>> statement_line.amount = Decimal(50)
     >>> statement_line.invoice = supplier_invoice2
-    >>> statement_line.amount == Decimal(40)
-    True
+    >>> statement_line.amount
+    Decimal('40.00')
     >>> len(statement.lines)
     3
-    >>> statement.lines[-1].amount == Decimal(10)
+    >>> statement.lines[-1].amount
+    Decimal('10.00')
+
+Testing the use of an invoice in multiple statements::
+
+    >>> customer_invoice4 = Invoice(type='out_invoice')
+    >>> customer_invoice4.party = customer
+    >>> customer_invoice4.payment_term = payment_term
+    >>> invoice_line = InvoiceLine()
+    >>> customer_invoice4.lines.append(invoice_line)
+    >>> invoice_line.quantity = 1
+    >>> invoice_line.unit_price = Decimal('300')
+    >>> invoice_line.account = revenue
+    >>> invoice_line.description = 'Test'
+    >>> customer_invoice4.save()
+    >>> customer_invoice4.click('post')
+    >>> customer_invoice4.state
+    u'posted'
+
+    >>> statement1 = Statement(journal=statement_journal)
+    >>> statement1.end_balance = Decimal(380)
+    >>> statement_line = statement1.lines.new()
+    >>> statement_line.date = today
+    >>> statement_line.party = customer
+    >>> statement_line.account = receivable
+    >>> statement_line.amount = Decimal(300)
+    >>> statement_line.invoice = customer_invoice4
+    >>> statement1.save()
+
+    >>> statement2 = Statement(journal=statement_journal)
+    >>> statement2.end_balance = Decimal(680)
+    >>> statement_line = statement2.lines.new()
+    >>> statement_line.date = today
+    >>> statement_line.party = customer
+    >>> statement_line.account = receivable
+    >>> statement_line.amount = Decimal(300)
+    >>> statement_line.invoice = customer_invoice4
+    >>> statement2.save()
+
+    >>> statement1.click('validate_statement') # doctest: +IGNORE_EXCEPTION_DETAIL
+    Traceback (most recent call last):
+        ...
+    UserWarning: ...
+    >>> statement2.reload()
+    >>> Model.get('res.user.warning')(user=config.user,
+    ...     name=str(statement2.lines[0].id), always=True).save()
+    >>> statement1.click('validate_statement')
+    >>> statement1.state
+    u'validated'
+
+    >>> statement1.reload()
+    >>> bool(statement1.lines[0].invoice)
     True
+    >>> statement2.reload()
+    >>> bool(statement2.lines[0].invoice)
+    False
diff --git a/tests/test_account_statement.py b/tests/test_account_statement.py
index 889ebb5..674ba1a 100644
--- a/tests/test_account_statement.py
+++ b/tests/test_account_statement.py
@@ -1,55 +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 AccountStatementTestCase(unittest.TestCase):
-    '''
-    Test AccountStatement module.
-    '''
+    'Test AccountStatement module'
 
     def setUp(self):
         trytond.tests.test_tryton.install_module('account_statement')
 
     def test0005views(self):
-        '''
-        Test views.
-        '''
+        'Test views'
         test_view('account_statement')
 
     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(
@@ -58,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 c2511b4..815cef9 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.0.1
+version=3.2.0
 depends:
     account
     account_invoice
diff --git a/trytond_account_statement.egg-info/PKG-INFO b/trytond_account_statement.egg-info/PKG-INFO
index 8c8acb3..75cc4d5 100644
--- a/trytond_account_statement.egg-info/PKG-INFO
+++ b/trytond_account_statement.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond-account-statement
-Version: 3.0.1
+Version: 3.2.0
 Summary: Tryton module with account statements
 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_account_statement
         =========================
         
@@ -43,6 +43,7 @@ Description: trytond_account_statement
         
           http://www.tryton.org/
         
+Keywords: tryton account statement
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Plugins
@@ -62,7 +63,6 @@ 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
 Classifier: Topic :: Office/Business :: Financial :: Accounting
diff --git a/trytond_account_statement.egg-info/requires.txt b/trytond_account_statement.egg-info/requires.txt
index 90e3032..f01eb95 100644
--- a/trytond_account_statement.egg-info/requires.txt
+++ b/trytond_account_statement.egg-info/requires.txt
@@ -1,6 +1,6 @@
-trytond_account >= 3.0, < 3.1
-trytond_account_invoice >= 3.0, < 3.1
-trytond_company >= 3.0, < 3.1
-trytond_currency >= 3.0, < 3.1
-trytond_party >= 3.0, < 3.1
-trytond >= 3.0, < 3.1
\ No newline at end of file
+trytond_account >= 3.2, < 3.3
+trytond_account_invoice >= 3.2, < 3.3
+trytond_company >= 3.2, < 3.3
+trytond_currency >= 3.2, < 3.3
+trytond_party >= 3.2, < 3.3
+trytond >= 3.2, < 3.3
\ No newline at end of file
-- 
tryton-modules-account-statement



More information about the tryton-debian-vcs mailing list