mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[FIX] flake8 W503
This commit is contained in:
committed by
Enric Tobella
parent
190585984e
commit
a690d018e7
@@ -40,12 +40,12 @@ class PaymentLine(models.Model):
|
||||
vals = {}
|
||||
partner_bank_id = vals.get('bank_id')
|
||||
move_line_id = vals.get('move_line_id')
|
||||
if (self.env.context.get('search_payment_order_type') == 'debit'
|
||||
and 'mandate_id' not in vals):
|
||||
if (self.env.context.get('search_payment_order_type') == 'debit' and
|
||||
'mandate_id' not in vals):
|
||||
if move_line_id:
|
||||
line = self.env['account.move.line'].browse(move_line_id)
|
||||
if (line.invoice and line.invoice.type == 'out_invoice'
|
||||
and line.invoice.mandate_id):
|
||||
if (line.invoice and line.invoice.type == 'out_invoice' and
|
||||
line.invoice.mandate_id):
|
||||
vals.update({
|
||||
'mandate_id': line.invoice.mandate_id.id,
|
||||
'bank_id': line.invoice.mandate_id.partner_bank_id.id,
|
||||
@@ -61,8 +61,8 @@ class PaymentLine(models.Model):
|
||||
@api.one
|
||||
@api.constrains('mandate_id', 'bank_id')
|
||||
def _check_mandate_bank_link(self):
|
||||
if (self.mandate_id and self.bank_id
|
||||
and self.mandate_id.partner_bank_id.id !=
|
||||
if (self.mandate_id and self.bank_id and
|
||||
self.mandate_id.partner_bank_id.id !=
|
||||
self.bank_id.id):
|
||||
raise exceptions.Warning(
|
||||
_("The payment line with reference '%s' has the bank account "
|
||||
|
||||
Reference in New Issue
Block a user