Add wizard to create direct debit for configured parties
issue10772 review379071002
This commit is contained in:
@@ -14,6 +14,7 @@ def register():
|
||||
payment.Payment,
|
||||
payment.Message,
|
||||
party.Party,
|
||||
party.PartyReceptionDirectDebit,
|
||||
party.PartyIdentifier,
|
||||
account.Configuration,
|
||||
account.ConfigurationSepaMandateSequence,
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -32,5 +32,11 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="model">party.party,-1</field>
|
||||
<field name="action" ref="act_mandate_form2"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="party_reception_direct_debit_view_form">
|
||||
<field name="model">party.party.reception_direct_debit</field>
|
||||
<field name="inherit" ref="account_payment.party_reception_direct_debit_view_form"/>
|
||||
<field name="name">party_reception_direct_debit_form</field>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="//field[@name='currency']" position="after">
|
||||
<label name="sepa_mandate"/>
|
||||
<field name="sepa_mandate"/>
|
||||
<newline/>
|
||||
</xpath>
|
||||
</data>
|
||||
Reference in New Issue
Block a user