Allow the sepa mandate to be set on draft payments
Also include account number on mandate rec_name issue8990 review260831007
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
* Include bank account number on mandate rec_name
|
||||
* Allow sepa_mandate to be set on draft payments
|
||||
|
||||
Version 5.4.0 - 2019-11-04
|
||||
* Bug fixes (see mercurial logs for details)
|
||||
* Add initiator identifiers on journal
|
||||
|
||||
+31
-4
@@ -264,11 +264,20 @@ class Payment(metaclass=PoolMeta):
|
||||
|
||||
sepa_mandate = fields.Many2One('account.payment.sepa.mandate', 'Mandate',
|
||||
ondelete='RESTRICT',
|
||||
states={
|
||||
'readonly': Eval('state') != 'draft',
|
||||
'invisible': ((Eval('process_method') != 'sepa')
|
||||
| (Eval('kind') != 'receivable')),
|
||||
},
|
||||
domain=[
|
||||
('party', '=', Eval('party', -1)),
|
||||
('company', '=', Eval('company', -1)),
|
||||
If(Eval('state') == 'draft',
|
||||
('state', '=', 'validated'),
|
||||
(),
|
||||
)
|
||||
],
|
||||
depends=['party', 'company'])
|
||||
depends=['party', 'company', 'state', 'process_method', 'kind'])
|
||||
sepa_mandate_sequence_type = fields.Char('Mandate Sequence Type',
|
||||
readonly=True)
|
||||
sepa_return_reason_code = fields.Char('Return Reason Code', readonly=True,
|
||||
@@ -361,6 +370,14 @@ class Payment(metaclass=PoolMeta):
|
||||
date = Transaction().context.get('date_value')
|
||||
return super(Payment, self).create_clearing_move(date=date)
|
||||
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
return super().view_attributes() + [
|
||||
('//separator[@id="sepa_return_reason"]', 'states', {
|
||||
'invisible': Eval('state') != 'failed',
|
||||
}),
|
||||
]
|
||||
|
||||
|
||||
class Mandate(Workflow, ModelSQL, ModelView):
|
||||
'SEPA Mandate'
|
||||
@@ -505,13 +522,23 @@ class Mandate(Workflow, ModelSQL, ModelView):
|
||||
return bool(self.identification)
|
||||
|
||||
def get_rec_name(self, name):
|
||||
name = '(%s)' % self.id
|
||||
if self.identification:
|
||||
return self.identification
|
||||
return '(%s)' % self.id
|
||||
name = self.identification
|
||||
if self.account_number:
|
||||
name += ' @ %s' % self.account_number.rec_name
|
||||
return name
|
||||
|
||||
@classmethod
|
||||
def search_rec_name(cls, name, clause):
|
||||
return [tuple(('identification',)) + tuple(clause[1:])]
|
||||
if clause[1].startswith('!') or clause[1].startswith('not '):
|
||||
bool_op = 'AND'
|
||||
else:
|
||||
bool_op = 'OR'
|
||||
return [bool_op,
|
||||
('identification',) + tuple(clause[1:]),
|
||||
('account_number',) + tuple(clause[1:]),
|
||||
]
|
||||
|
||||
@classmethod
|
||||
def create(cls, vlist):
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="//notebook/page[@id='info']" position="inside">
|
||||
<newline/>
|
||||
<label name="sepa_return_reason_code"/>
|
||||
<label name="sepa_mandate"/>
|
||||
<field name="sepa_mandate"/>
|
||||
<separator id="sepa_return_reason" string="Return Reason" colspan="4"/>
|
||||
<label name="sepa_return_reason_code" string="Code"/>
|
||||
<field name="sepa_return_reason_code"/>
|
||||
<newline/>
|
||||
<label name="sepa_return_reason_information"/>
|
||||
<label name="sepa_return_reason_information" string="Information"/>
|
||||
<field name="sepa_return_reason_information" yexpand="0" colspan="3"/>
|
||||
</xpath>
|
||||
</data>
|
||||
|
||||
Reference in New Issue
Block a user