[tryton-debian-vcs] tryton-modules-account-payment branch debian updated. debian/3.4.1-1-3-gf34f2c3
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Thu Apr 23 16:01:55 UTC 2015
The following commit has been merged in the debian branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-account-payment.git;a=commitdiff;h=debian/3.4.1-1-3-gf34f2c3
commit f34f2c3d609293d510703c36aae694bc6785dd9b
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Thu Apr 23 17:31:41 2015 +0200
Updating Depends.
diff --git a/debian/control b/debian/control
index f486f94..9e56970 100644
--- a/debian/control
+++ b/debian/control
@@ -18,6 +18,7 @@ Package: tryton-modules-account-payment
Architecture: all
Depends:
python-pkg-resources,
+ python-sql,
tryton-modules-account (>= ${version:major}),
tryton-modules-company (>= ${version:major}),
tryton-modules-currency (>= ${version:major}),
commit 12034e66d6cc6c26869917d6c30a5e69bf9836a2
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Thu Apr 23 16:59:51 2015 +0200
Merging upstream version 3.6.0.
diff --git a/CHANGELOG b/CHANGELOG
index aa9ea1e..466bc7b 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,6 @@
-Version 3.4.1 - 2015-03-01
+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)
* Add transitions between succeeded and failed
diff --git a/PKG-INFO b/PKG-INFO
index 0683b54..f4e34f0 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond_account_payment
-Version: 3.4.1
+Version: 3.6.0
Summary: Tryton module for payment
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_payment
=======================
@@ -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 d2e3fee..8b07f5f 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 .payment import *
from .account import *
diff --git a/account.py b/account.py
index 2f0d05a..480c279 100644
--- a/account.py
+++ b/account.py
@@ -1,5 +1,6 @@
-#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 sql import Null
from sql.aggregate import Sum
from sql.conditionals import Case, Coalesce
from sql.functions import Abs
@@ -82,7 +83,7 @@ class MoveLine:
payment_amount = Sum(Coalesce(payment.amount, 0))
main_amount = Abs(table.credit - table.debit) - payment_amount
second_amount = Abs(table.amount_second_currency) - payment_amount
- amount = Case((table.second_currency == None, main_amount),
+ amount = Case((table.second_currency == Null, main_amount),
else_=second_amount)
value = cls.payment_amount.sql_format(value)
@@ -147,6 +148,7 @@ class PayLine(Wizard):
kind = 'payable'
return Payment(
+ company=line.move.company,
journal=self.start.journal,
party=line.party,
kind=kind,
@@ -164,7 +166,7 @@ class PayLine(Wizard):
payments = []
for line in lines:
payments.append(self.get_payment(line))
- payments = Payment.create([p._save_values for p in payments])
+ Payment.save(payments)
return action, {
'res_id': [p.id for p in payments],
}
diff --git a/account.xml b/account.xml
index 966949c..3db0a28 100644
--- a/account.xml
+++ b/account.xml
@@ -14,7 +14,9 @@ this repository contains the full copyright notices and license terms. -->
<record model="ir.action.act_window" id="act_move_line_form">
<field name="name">Lines to Pay</field>
<field name="res_model">account.move.line</field>
- <field name="domain">[('account.kind', 'in', ['receivable', 'payable']), ('party', '!=', None), ('reconciliation', '=', None), ('payment_amount', '!=', 0)]</field>
+ <field name="domain"
+ eval="[('account.kind', 'in', ['receivable', 'payable']), ('party', '!=', None), ('reconciliation', '=', None), ('payment_amount', '!=', 0)]"
+ pyson="1"/>
</record>
<record model="ir.action.act_window.view" id="act_move_line_form_view1">
<field name="sequence" eval="10"/>
@@ -25,14 +27,18 @@ this repository contains the full copyright notices and license terms. -->
id="act_move_line_form_domain_payable">
<field name="name">Payable</field>
<field name="sequence" eval="10"/>
- <field name="domain">['OR', ('credit', '>', 0), ('debit', '<', 0)]</field>
+ <field name="domain"
+ eval="['OR', ('credit', '>', 0), ('debit', '<', 0)]"
+ pyson="1"/>
<field name="act_window" ref="act_move_line_form"/>
</record>
<record model="ir.action.act_window.domain"
id="act_move_line_form_domain_receivable">
<field name="name">Receivable</field>
<field name="sequence" eval="20"/>
- <field name="domain">['OR', ('debit', '>', 0), ('credit', '<', 0)]</field>
+ <field name="domain"
+ eval="['OR', ('debit', '>', 0), ('credit', '<', 0)]"
+ pyson="1"/>
<field name="act_window" ref="act_move_line_form"/>
</record>
diff --git a/locale/ca_ES.po b/locale/ca_ES.po
index 4bcea35..6b6c9af 100644
--- a/locale/ca_ES.po
+++ b/locale/ca_ES.po
@@ -3,8 +3,8 @@ msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:account.payment.process:"
-msgid "The Payment \"%s\" overpays the Line \"%s\"."
-msgstr "El pagament \"%s\" és major que l'import de l'efecte \"%s\"."
+msgid "The Payment \"%(payment)s\" overpays the Line \"%(line)s\"."
+msgstr "El pagament \"%(payment)s\" paga amb excés l'apunt \"%(line)s\"."
msgctxt "error:account.payment:"
msgid "Payment \"%s\" must be in draft before deletion."
@@ -52,7 +52,7 @@ msgstr "Moneda"
msgctxt "field:account.payment,currency_digits:"
msgid "Currency Digits"
-msgstr "Decimals de moneda"
+msgstr "Decimals de la moneda"
msgctxt "field:account.payment,date:"
msgid "Date"
@@ -446,7 +446,7 @@ msgstr "Paga"
msgctxt "wizard_button:account.payment.process,start,end:"
msgid "Cancel"
-msgstr "Cancel·lat"
+msgstr "Cancel·la"
msgctxt "wizard_button:account.payment.process,start,process:"
msgid "Process"
diff --git a/locale/de_DE.po b/locale/de_DE.po
index 4136054..b4adc99 100644
--- a/locale/de_DE.po
+++ b/locale/de_DE.po
@@ -3,8 +3,8 @@ msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:account.payment.process:"
-msgid "The Payment \"%s\" overpays the Line \"%s\"."
-msgstr "Die Zahlung \"%s\" ist eine Überzahlung von Posten \"%s\"."
+msgid "The Payment \"%(payment)s\" overpays the Line \"%(line)s\"."
+msgstr "Zahlung \"%(payment)s\" überzahlt die Position \"%(line)s\""
msgctxt "error:account.payment:"
msgid "Payment \"%s\" must be in draft before deletion."
@@ -268,7 +268,7 @@ msgstr "Entwurf"
msgctxt ""
"model:ir.action.act_window.domain,name:act_payment_form_domain_failed"
msgid "Failed"
-msgstr "Fehlgeschlagen"
+msgstr "Erfolglos"
msgctxt ""
"model:ir.action.act_window.domain,name:act_payment_form_domain_processing"
@@ -346,7 +346,7 @@ msgstr "Entwurf"
msgctxt "selection:account.payment,state:"
msgid "Failed"
-msgstr "Fehlgeschlagen"
+msgstr "Erfolglos"
msgctxt "selection:account.payment,state:"
msgid "Processing"
@@ -418,7 +418,7 @@ msgstr "Entwurf"
msgctxt "view:account.payment:"
msgid "Fail"
-msgstr "Fehlschlag"
+msgstr "Erfolglos"
msgctxt "view:account.payment:"
msgid "Other Info"
diff --git a/locale/es_AR.po b/locale/es_AR.po
index deb616c..7ec6355 100644
--- a/locale/es_AR.po
+++ b/locale/es_AR.po
@@ -3,8 +3,8 @@ msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:account.payment.process:"
-msgid "The Payment \"%s\" overpays the Line \"%s\"."
-msgstr "El Pago «%s» excede el pago de la línea «%s»."
+msgid "The Payment \"%(payment)s\" overpays the Line \"%(line)s\"."
+msgstr "El Pago «%(payment)s» excede el pago de la línea «%(line)s»."
msgctxt "error:account.payment:"
msgid "Payment \"%s\" must be in draft before deletion."
@@ -52,7 +52,7 @@ msgstr "Moneda"
msgctxt "field:account.payment,currency_digits:"
msgid "Currency Digits"
-msgstr "Dígitos de moneda"
+msgstr "Decimales de moneda"
msgctxt "field:account.payment,date:"
msgid "Date"
@@ -200,7 +200,7 @@ msgstr "Pago"
msgctxt "model:account.payment.group,name:"
msgid "Payment Group"
-msgstr "Grupo de pago"
+msgstr "Grupo de pagos"
msgctxt "model:account.payment.journal,name:"
msgid "Payment Journal"
@@ -232,7 +232,7 @@ msgstr "Pagos"
msgctxt "model:ir.action,name:act_payment_group_form"
msgid "Payment Groups"
-msgstr "Grupos de pago"
+msgstr "Grupos de pagos"
msgctxt "model:ir.action,name:act_payment_journal_form"
msgid "Payment Journals"
@@ -302,7 +302,7 @@ msgstr "Pagos"
msgctxt "model:ir.ui.menu,name:menu_payment_group_form"
msgid "Payment Groups"
-msgstr "Grupos de pago"
+msgstr "Grupos de pagos"
msgctxt "model:ir.ui.menu,name:menu_payment_journal_form"
msgid "Payment Journals"
@@ -382,11 +382,11 @@ msgstr "Líneas de pago"
msgctxt "view:account.payment.group:"
msgid "Payment Group"
-msgstr "Grupo de pago"
+msgstr "Grupo de pagos"
msgctxt "view:account.payment.group:"
msgid "Payment Groups"
-msgstr "Grupos de pago"
+msgstr "Grupos de pagos"
msgctxt "view:account.payment.journal:"
msgid "Payment Journal"
diff --git a/locale/es_CO.po b/locale/es_CO.po
index 84020b0..919919c 100644
--- a/locale/es_CO.po
+++ b/locale/es_CO.po
@@ -3,8 +3,8 @@ msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:account.payment.process:"
-msgid "The Payment \"%s\" overpays the Line \"%s\"."
-msgstr "El Pago \"%s\" excede el pago de la línea \"%s\"."
+msgid "The Payment \"%(payment)s\" overpays the Line \"%(line)s\"."
+msgstr ""
msgctxt "error:account.payment:"
msgid "Payment \"%s\" must be in draft before deletion."
diff --git a/locale/es_EC.po b/locale/es_EC.po
index 7f39cb4..b4a375a 100644
--- a/locale/es_EC.po
+++ b/locale/es_EC.po
@@ -3,8 +3,8 @@ msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:account.payment.process:"
-msgid "The Payment \"%s\" overpays the Line \"%s\"."
-msgstr "El Pago \"%s\" excede el pago de la línea \"%s\"."
+msgid "The Payment \"%(payment)s\" overpays the Line \"%(line)s\"."
+msgstr "El Pago \"%(payment)s\" excede el pago de la línea \"%(line)s\"."
msgctxt "error:account.payment:"
msgid "Payment \"%s\" must be in draft before deletion."
diff --git a/locale/es_ES.po b/locale/es_ES.po
index 3647c88..ce8b4c2 100644
--- a/locale/es_ES.po
+++ b/locale/es_ES.po
@@ -3,8 +3,8 @@ msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:account.payment.process:"
-msgid "The Payment \"%s\" overpays the Line \"%s\"."
-msgstr "El pago \"%s\" excede el importe del efecto \"%s\"."
+msgid "The Payment \"%(payment)s\" overpays the Line \"%(line)s\"."
+msgstr "El pago \"%(payment)s\" paga en exceso el apunte \"%(line)s\"."
msgctxt "error:account.payment:"
msgid "Payment \"%s\" must be in draft before deletion."
@@ -52,7 +52,7 @@ msgstr "Moneda"
msgctxt "field:account.payment,currency_digits:"
msgid "Currency Digits"
-msgstr "Decimales de moneda"
+msgstr "Decimales de la moneda"
msgctxt "field:account.payment,date:"
msgid "Date"
diff --git a/locale/fr_FR.po b/locale/fr_FR.po
index ddbeb88..dc298c4 100644
--- a/locale/fr_FR.po
+++ b/locale/fr_FR.po
@@ -3,8 +3,8 @@ msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:account.payment.process:"
-msgid "The Payment \"%s\" overpays the Line \"%s\"."
-msgstr "La paiement « %s » excède le montant de la ligne « %s »."
+msgid "The Payment \"%(payment)s\" overpays the Line \"%(line)s\"."
+msgstr "Le paiement « %(payment)s » surpaye la ligne « %(line)s »."
msgctxt "error:account.payment:"
msgid "Payment \"%s\" must be in draft before deletion."
@@ -322,19 +322,19 @@ msgstr ""
msgctxt "selection:account.move.line,payment_kind:"
msgid "Payable"
-msgstr "À payer"
+msgstr "Fournisseur"
msgctxt "selection:account.move.line,payment_kind:"
msgid "Receivable"
-msgstr "À recevoir"
+msgstr "Compte client"
msgctxt "selection:account.payment,kind:"
msgid "Payable"
-msgstr "À payer"
+msgstr "Fournisseur"
msgctxt "selection:account.payment,kind:"
msgid "Receivable"
-msgstr "À recevoir"
+msgstr "Compte client"
msgctxt "selection:account.payment,state:"
msgid "Approved"
@@ -358,11 +358,11 @@ msgstr "Réussi"
msgctxt "selection:account.payment.group,kind:"
msgid "Payable"
-msgstr "À payer"
+msgstr "Fournisseur"
msgctxt "selection:account.payment.group,kind:"
msgid "Receivable"
-msgstr "À recevoir"
+msgstr "Compte client"
msgctxt "selection:account.payment.journal,process_method:"
msgid "Manual"
diff --git a/locale/sl_SI.po b/locale/sl_SI.po
index ae5c024..6da6b93 100644
--- a/locale/sl_SI.po
+++ b/locale/sl_SI.po
@@ -3,8 +3,8 @@ msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:account.payment.process:"
-msgid "The Payment \"%s\" overpays the Line \"%s\"."
-msgstr "Plačilo \"%s\" preplača postavko \"%s\"."
+msgid "The Payment \"%(payment)s\" overpays the Line \"%(line)s\"."
+msgstr "Plačilo \"%(payment)s\" je preplačalo postavko \"%(line)s\"."
msgctxt "error:account.payment:"
msgid "Payment \"%s\" must be in draft before deletion."
diff --git a/payment.py b/payment.py
index cb404fb..3fa6fe8 100644
--- a/payment.py
+++ b/payment.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 itertools import groupby
from trytond.model import Workflow, ModelView, ModelSQL, fields
@@ -118,6 +118,7 @@ class Payment(Workflow, ModelSQL, ModelView):
depends=_DEPENDS + ['currency_digits'])
line = fields.Many2One('account.move.line', 'Line', ondelete='RESTRICT',
domain=[
+ ('move.company', '=', Eval('company', -1)),
If(Eval('kind') == 'receivable',
['OR', ('debit', '>', 0), ('credit', '<', 0)],
['OR', ('credit', '>', 0), ('debit', '<', 0)],
@@ -138,7 +139,8 @@ class Payment(Workflow, ModelSQL, ModelView):
],
('move_state', '=', 'posted'),
],
- states=_STATES, depends=_DEPENDS + ['party', 'currency', 'kind'])
+ states=_STATES, depends=_DEPENDS + ['party', 'currency', 'kind',
+ 'company'])
description = fields.Char('Description', states=_STATES, depends=_DEPENDS)
group = fields.Many2One('account.payment.group', 'Group', readonly=True,
ondelete='RESTRICT',
@@ -226,24 +228,17 @@ class Payment(Workflow, ModelSQL, ModelView):
@fields.depends('kind')
def on_change_kind(self):
- return {
- 'line': None,
- }
+ self.line = None
@fields.depends('party')
def on_change_party(self):
- return {
- 'line': None,
- }
+ self.line = None
@fields.depends('line')
def on_change_line(self):
if self.line:
- return {
- 'date': self.line.maturity_date,
- 'amount': self.line.payment_amount,
- }
- return {}
+ self.date = self.line.maturity_date
+ self.amount = self.line.payment_amount
@classmethod
def delete(cls, payments):
@@ -313,7 +308,8 @@ class ProcessPayment(Wizard):
def __setup__(cls):
super(ProcessPayment, cls).__setup__()
cls._error_messages.update({
- 'overpay': 'The Payment "%s" overpays the Line "%s".',
+ 'overpay': 'The Payment "%(payment)s" overpays '
+ 'the Line "%(line)s".',
})
def _group_payment_key(self, payment):
@@ -332,7 +328,10 @@ class ProcessPayment(Wizard):
for payment in payments:
if payment.line and payment.line.payment_amount < 0:
self.raise_user_warning(str(payment),
- 'overpay', (payment.rec_name, payment.line.rec_name))
+ 'overpay', {
+ 'payment': payment.rec_name,
+ 'line': payment.line.rec_name,
+ })
groups = []
payments = sorted(payments, key=self._group_payment_key)
@@ -343,7 +342,6 @@ class ProcessPayment(Wizard):
group.save()
groups.append(group)
return group
- grouped_payments = list(grouped_payments)
Payment.process(list(grouped_payments), group)
return action, {
diff --git a/payment.xml b/payment.xml
index c66c1fe..55dcd6d 100644
--- a/payment.xml
+++ b/payment.xml
@@ -54,10 +54,19 @@ this repository contains the full copyright notices and license terms. -->
<field name="global_p" eval="True"/>
</record>
<record model="ir.rule" id="rule_payment_journal1">
- <field name="domain">[('company', '=', user.company.id if user.company else None)]</field>
+ <field name="domain"
+ eval="[('company', '=', Eval('user', {}).get('company', None))]"
+ pyson="1"/>
<field name="rule_group" ref="rule_group_payment_journal"/>
</record>
+ <record model="ir.model.access" id="access_payment_journal">
+ <field name="model" search="[('model', '=', 'account.payment.journal')]"/>
+ <field name="perm_read" eval="False"/>
+ <field name="perm_write" eval="False"/>
+ <field name="perm_create" eval="False"/>
+ <field name="perm_delete" eval="False"/>
+ </record>
<record model="ir.model.access" id="access_payment_journal_account_admin">
<field name="model" search="[('model', '=', 'account.payment.journal')]"/>
<field name="group" ref="account.group_account_admin"/>
@@ -109,10 +118,19 @@ this repository contains the full copyright notices and license terms. -->
<field name="global_p" eval="True"/>
</record>
<record model="ir.rule" id="rule_payment_group1">
- <field name="domain">[('company', '=', user.company.id if user.company else None)]</field>
+ <field name="domain"
+ eval="[('company', '=', Eval('user', {}).get('company', None))]"
+ pyson="1"/>
<field name="rule_group" ref="rule_group_payment_group"/>
</record>
+ <record model="ir.model.access" id="access_payment_group">
+ <field name="model" search="[('model', '=', 'account.payment.group')]"/>
+ <field name="perm_read" eval="False"/>
+ <field name="perm_write" eval="False"/>
+ <field name="perm_create" eval="False"/>
+ <field name="perm_delete" eval="False"/>
+ </record>
<record model="ir.model.access" id="access_payment_group_account_admin">
<field name="model" search="[('model', '=', 'account.payment.group')]"/>
<field name="group" ref="account.group_account_admin"/>
@@ -182,31 +200,31 @@ this repository contains the full copyright notices and license terms. -->
<record model="ir.action.act_window.domain" id="act_payment_form_domain_draft">
<field name="name">Draft</field>
<field name="sequence" eval="10"/>
- <field name="domain">[('state', '=', 'draft')]</field>
+ <field name="domain" eval="[('state', '=', 'draft')]" pyson="1"/>
<field name="act_window" ref="act_payment_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_payment_form_domain_approved">
<field name="name">Approved</field>
<field name="sequence" eval="20"/>
- <field name="domain">[('state', '=', 'approved')]</field>
+ <field name="domain" eval="[('state', '=', 'approved')]" pyson="1"/>
<field name="act_window" ref="act_payment_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_payment_form_domain_processing">
<field name="name">Processing</field>
<field name="sequence" eval="30"/>
- <field name="domain">[('state', '=', 'processing')]</field>
+ <field name="domain" eval="[('state', '=', 'processing')]" pyson="1"/>
<field name="act_window" ref="act_payment_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_payment_form_domain_suceeded">
<field name="name">Succeeded</field>
<field name="sequence" eval="40"/>
- <field name="domain">[('state', '=', 'succeeded')]</field>
+ <field name="domain" eval="[('state', '=', 'succeeded')]" pyson="1"/>
<field name="act_window" ref="act_payment_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_payment_form_domain_failed">
<field name="name">Failed</field>
<field name="sequence" eval="50"/>
- <field name="domain">[('state', '=', 'failed')]</field>
+ <field name="domain" eval="[('state', '=', 'failed')]" pyson="1"/>
<field name="act_window" ref="act_payment_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_payment_form_domain_all">
@@ -224,14 +242,17 @@ this repository contains the full copyright notices and license terms. -->
<field name="global_p" eval="True"/>
</record>
<record model="ir.rule" id="rule_payment1">
- <field name="domain">[('company', '=', user.company.id if user.company else None)]</field>
+ <field name="domain"
+ eval="[('company', '=', Eval('user', {}).get('company', None))]"
+ pyson="1"/>
<field name="rule_group" ref="rule_group_payment"/>
</record>
<record model="ir.action.act_window" id="act_payment_form_line_relate">
<field name="name">Payments</field>
<field name="res_model">account.payment</field>
- <field name="domain">[('line', '=', Eval('active_id'))]</field>
+ <field name="domain"
+ eval="[('line', '=', Eval('active_id'))]" pyson="1"/>
</record>
<record model="ir.action.act_window.view"
id="act_payment_form_line_relate_view1">
@@ -255,7 +276,8 @@ this repository contains the full copyright notices and license terms. -->
<record model="ir.action.act_window" id="act_payment_form_group_open">
<field name="name">Payments</field>
<field name="res_model">account.payment</field>
- <field name="domain">[('group', '=', Eval('active_id'))]</field>
+ <field name="domain"
+ eval="[('group', '=', Eval('active_id'))]" pyson="1"/>
</record>
<record model="ir.action.act_window.view"
id="act_payment_form_group_open_view1">
@@ -276,6 +298,13 @@ this repository contains the full copyright notices and license terms. -->
<field name="action" ref="act_payment_form_group_open"/>
</record>
+ <record model="ir.model.access" id="access_payment">
+ <field name="model" search="[('model', '=', 'account.payment')]"/>
+ <field name="perm_read" eval="False"/>
+ <field name="perm_write" eval="False"/>
+ <field name="perm_create" eval="False"/>
+ <field name="perm_delete" eval="False"/>
+ </record>
<record model="ir.model.access" id="access_payment_account_admin">
<field name="model" search="[('model', '=', 'account.payment')]"/>
<field name="group" ref="account.group_account_admin"/>
diff --git a/setup.py b/setup.py
index 98dc55b..2c658dd 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
@@ -41,7 +41,7 @@ if minor_version % 2:
'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % (
name[8:], name, version))
-requires = []
+requires = ['python-sql >= 0.4']
for dep in info.get('depends', []):
if not re.match(r'(ir|res|webdav)(\W|$)', dep):
requires.append(get_require_version('trytond_%s' % dep))
@@ -92,6 +92,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 9431450..6887e15 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_payment import suite
diff --git a/tests/scenario_account_payment.rst b/tests/scenario_account_payment.rst
index 9cf27a6..1a1bb0f 100644
--- a/tests/scenario_account_payment.rst
+++ b/tests/scenario_account_payment.rst
@@ -4,11 +4,12 @@ Payment Scenario
Imports::
>>> import datetime
- >>> from dateutil.relativedelta import relativedelta
>>> from decimal import Decimal
- >>> from operator import attrgetter
>>> from proteus import config, Model, Wizard
- >>> today = datetime.date.today()
+ >>> from trytond.modules.company.tests.tools import create_company, \
+ ... get_company
+ >>> from trytond.modules.account.tests.tools import create_fiscalyear, \
+ ... create_chart, get_accounts
Create database::
@@ -25,76 +26,20 @@ Install account_payment::
Create company::
- >>> Currency = Model.get('currency.currency')
- >>> CurrencyRate = Model.get('currency.currency.rate')
- >>> currencies = Currency.find([('code', '=', 'USD')])
- >>> if not currencies:
- ... currency = Currency(name='US Dollar', symbol=u'$', code='USD',
- ... rounding=Decimal('0.01'), mon_grouping='[]',
- ... mon_decimal_point='.')
- ... currency.save()
- ... CurrencyRate(date=today + relativedelta(month=1, day=1),
- ... rate=Decimal('1.0'), currency=currency).save()
- ... else:
- ... currency, = currencies
- >>> Company = Model.get('company.company')
- >>> Party = Model.get('party.party')
- >>> company_config = Wizard('company.company.config')
- >>> company_config.execute('company')
- >>> company = company_config.form
- >>> party = Party(name='Dunder Mifflin')
- >>> party.save()
- >>> company.party = party
- >>> company.currency = currency
- >>> company_config.execute('add')
- >>> company, = Company.find([])
-
-Reload the context::
-
- >>> User = Model.get('res.user')
- >>> config._context = User.get_preferences(True, config.context)
+ >>> _ = create_company()
+ >>> company = get_company()
Create fiscal year::
- >>> FiscalYear = Model.get('account.fiscalyear')
- >>> Sequence = Model.get('ir.sequence')
- >>> SequenceStrict = Model.get('ir.sequence.strict')
- >>> fiscalyear = FiscalYear(name=str(today.year))
- >>> fiscalyear.start_date = today + relativedelta(month=1, day=1)
- >>> fiscalyear.end_date = today + relativedelta(month=12, day=31)
- >>> fiscalyear.company = company
- >>> post_move_seq = Sequence(name=str(today.year), code='account.move',
- ... company=company)
- >>> post_move_seq.save()
- >>> fiscalyear.post_move_sequence = post_move_seq
- >>> fiscalyear.save()
- >>> FiscalYear.create_period([fiscalyear.id], config.context)
+ >>> fiscalyear = create_fiscalyear(company)
+ >>> fiscalyear.click('create_period')
Create chart of accounts::
- >>> AccountTemplate = Model.get('account.account.template')
- >>> Account = Model.get('account.account')
- >>> account_template, = AccountTemplate.find([('parent', '=', None)])
- >>> create_chart = Wizard('account.create_chart')
- >>> create_chart.execute('account')
- >>> create_chart.form.account_template = account_template
- >>> create_chart.form.company = company
- >>> create_chart.execute('create_account')
- >>> receivable, = Account.find([
- ... ('kind', '=', 'receivable'),
- ... ('company', '=', company.id),
- ... ])
- >>> payable, = Account.find([
- ... ('kind', '=', 'payable'),
- ... ('company', '=', company.id),
- ... ])
- >>> expense, = Account.find([
- ... ('kind', '=', 'expense'),
- ... ('company', '=', company.id),
- ... ])
- >>> create_chart.form.account_receivable = receivable
- >>> create_chart.form.account_payable = payable
- >>> create_chart.execute('create_properties')
+ >>> _ = create_chart(company)
+ >>> accounts = get_accounts(company)
+ >>> payable = accounts['payable']
+
>>> Journal = Model.get('account.journal')
>>> expense, = Journal.find([('code', '=', 'EXP')])
diff --git a/tests/test_account_payment.py b/tests/test_account_payment.py
index 0560dfb..a3b8389 100644
--- a/tests/test_account_payment.py
+++ b/tests/test_account_payment.py
@@ -1,25 +1,15 @@
-#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 AccountPaymentTestCase(unittest.TestCase):
+class AccountPaymentTestCase(ModuleTestCase):
'Test Account Payment module'
-
- def setUp(self):
- trytond.tests.test_tryton.install_module('account_payment')
-
- def test0005views(self):
- 'Test views'
- test_view('account_payment')
-
- def test0006depends(self):
- 'Test depends'
- test_depends()
+ module = 'account_payment'
def suite():
diff --git a/tryton.cfg b/tryton.cfg
index ab94b1b..cb31005 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
[tryton]
-version=3.4.1
+version=3.6.0
depends:
account
company
diff --git a/trytond_account_payment.egg-info/PKG-INFO b/trytond_account_payment.egg-info/PKG-INFO
index 8f40240..1b660e6 100644
--- a/trytond_account_payment.egg-info/PKG-INFO
+++ b/trytond_account_payment.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond-account-payment
-Version: 3.4.1
+Version: 3.6.0
Summary: Tryton module for payment
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_payment
=======================
@@ -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_payment.egg-info/requires.txt b/trytond_account_payment.egg-info/requires.txt
index b2a1ab7..3316a4a 100644
--- a/trytond_account_payment.egg-info/requires.txt
+++ b/trytond_account_payment.egg-info/requires.txt
@@ -1,5 +1,6 @@
-trytond_account >= 3.4, < 3.5
-trytond_company >= 3.4, < 3.5
-trytond_currency >= 3.4, < 3.5
-trytond_party >= 3.4, < 3.5
-trytond >= 3.4, < 3.5
\ No newline at end of file
+python-sql >= 0.4
+trytond_account >= 3.6, < 3.7
+trytond_company >= 3.6, < 3.7
+trytond_currency >= 3.6, < 3.7
+trytond_party >= 3.6, < 3.7
+trytond >= 3.6, < 3.7
\ No newline at end of file
--
tryton-modules-account-payment
More information about the tryton-debian-vcs
mailing list