mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
flake8 W503
This commit is contained in:
committed by
Enric Tobella
parent
d94c26b696
commit
bc565493c8
@@ -80,8 +80,8 @@ class AccountBankingMandate(models.Model):
|
||||
@api.one
|
||||
@api.constrains('type', 'recurrent_sequence_type')
|
||||
def _check_recurring_type(self):
|
||||
if (self.type == 'recurrent'
|
||||
and not self.recurrent_sequence_type):
|
||||
if (self.type == 'recurrent' and
|
||||
not self.recurrent_sequence_type):
|
||||
raise exceptions.Warning(
|
||||
_("The recurrent mandate '%s' must have a sequence type.")
|
||||
% self.unique_mandate_reference)
|
||||
@@ -89,8 +89,8 @@ class AccountBankingMandate(models.Model):
|
||||
@api.one
|
||||
@api.constrains('type', 'recurrent_sequence_type', 'sepa_migrated')
|
||||
def _check_migrated_to_sepa(self):
|
||||
if (self.type == 'recurrent' and not self.sepa_migrated
|
||||
and self.recurrent_sequence_type != 'first'):
|
||||
if (self.type == 'recurrent' and not self.sepa_migrated and
|
||||
self.recurrent_sequence_type != 'first'):
|
||||
raise exceptions.Warning(
|
||||
_("The recurrent mandate '%s' which is not marked as "
|
||||
"'Migrated to SEPA' must have its recurrent sequence type "
|
||||
@@ -99,8 +99,8 @@ class AccountBankingMandate(models.Model):
|
||||
@api.one
|
||||
@api.constrains('type', 'original_mandate_identification', 'sepa_migrated')
|
||||
def _check_original_mandate_identification(self):
|
||||
if (self.type == 'recurrent' and not self.sepa_migrated
|
||||
and not self.original_mandate_identification):
|
||||
if (self.type == 'recurrent' and not self.sepa_migrated and
|
||||
not self.original_mandate_identification):
|
||||
raise exceptions.Warning(
|
||||
_("You must set the 'Original Mandate Identification' on the "
|
||||
"recurrent mandate '%s' which is not marked as 'Migrated to "
|
||||
@@ -111,9 +111,10 @@ class AccountBankingMandate(models.Model):
|
||||
def mandate_partner_bank_change(self):
|
||||
super(AccountBankingMandate, self).mandate_partner_bank_change()
|
||||
res = {}
|
||||
if (self.state == 'valid' and self.partner_bank_id
|
||||
and self.type == 'recurrent'
|
||||
and self.recurrent_sequence_type != 'first'):
|
||||
if (self.state == 'valid' and
|
||||
self.partner_bank_id and
|
||||
self.type == 'recurrent' and
|
||||
self.recurrent_sequence_type != 'first'):
|
||||
self.recurrent_sequence_type = 'first'
|
||||
res['warning'] = {
|
||||
'title': _('Mandate update'),
|
||||
|
||||
@@ -103,8 +103,8 @@ class BankingExportSddWizard(orm.TransientModel):
|
||||
previous_payline_id = False
|
||||
for older_line in older_lines:
|
||||
older_line_date_sent = older_line.order_id.date_sent
|
||||
if (older_line_date_sent
|
||||
and older_line_date_sent > previous_date):
|
||||
if (older_line_date_sent and
|
||||
older_line_date_sent > previous_date):
|
||||
previous_date = older_line_date_sent
|
||||
previous_payline_id = older_line.id
|
||||
if previous_payline_id:
|
||||
|
||||
Reference in New Issue
Block a user