diff --git a/__init__.py b/__init__.py
index f3223e03cc..e223ebe04e 100644
--- a/__init__.py
+++ b/__init__.py
@@ -14,6 +14,7 @@ def register():
payment.Payment,
payment.Message,
party.Party,
+ party.PartyReceptionDirectDebit,
party.PartyIdentifier,
account.Configuration,
account.ConfigurationSepaMandateSequence,
diff --git a/party.py b/party.py
index 6c24ed437b..39d9f716c2 100644
--- a/party.py
+++ b/party.py
@@ -72,6 +72,26 @@ class Party(metaclass=PoolMeta):
type=type))
+class PartyReceptionDirectDebit(metaclass=PoolMeta):
+ __name__ = 'party.party.reception_direct_debit'
+
+ sepa_mandate = fields.Many2One(
+ 'account.payment.sepa.mandate', "Mandate", ondelete='CASCADE',
+ domain=[
+ ('party', '=', Eval('party', -1)),
+ ],
+ states={
+ 'invisible': Eval('process_method') != 'sepa',
+ 'readonly': ~Eval('party') | (Eval('party', -1) < 0),
+ },
+ depends=['party', 'process_method'])
+
+ def _get_payment(self, line, date, amount):
+ payment = super()._get_payment(line, date, amount)
+ payment.sepa_mandate = self.sepa_mandate
+ return payment
+
+
class PartyIdentifier(metaclass=PoolMeta):
__name__ = 'party.identifier'
diff --git a/party.xml b/party.xml
index 7a814a2739..c70d31eded 100644
--- a/party.xml
+++ b/party.xml
@@ -32,5 +32,11 @@ this repository contains the full copyright notices and license terms. -->
party.party,-1
+
+
+ party.party.reception_direct_debit
+
+ party_reception_direct_debit_form
+
diff --git a/view/party_reception_direct_debit_form.xml b/view/party_reception_direct_debit_form.xml
new file mode 100644
index 0000000000..784e6ed023
--- /dev/null
+++ b/view/party_reception_direct_debit_form.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+