mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[IMP] account_payment_order: black, isort
This commit is contained in:
@@ -5,26 +5,25 @@ from odoo import api, models
|
||||
|
||||
|
||||
class AccountPayment(models.Model):
|
||||
_inherit = 'account.payment'
|
||||
_inherit = "account.payment"
|
||||
|
||||
def _compute_journal_domain_and_types(self):
|
||||
res = super(AccountPayment, self)._compute_journal_domain_and_types()
|
||||
journal_domain = res.get('domain', [])
|
||||
if self.payment_type == 'inbound':
|
||||
journal_domain.append(('inbound_payment_order_only', '=', False))
|
||||
journal_domain = res.get("domain", [])
|
||||
if self.payment_type == "inbound":
|
||||
journal_domain.append(("inbound_payment_order_only", "=", False))
|
||||
else:
|
||||
journal_domain.append(('outbound_payment_order_only', '=', False))
|
||||
res['domain'] = journal_domain
|
||||
journal_domain.append(("outbound_payment_order_only", "=", False))
|
||||
res["domain"] = journal_domain
|
||||
return res
|
||||
|
||||
@api.multi
|
||||
@api.onchange('journal_id')
|
||||
@api.onchange("journal_id")
|
||||
def _onchange_journal(self):
|
||||
res = super(AccountPayment, self)._onchange_journal()
|
||||
domains = res.get('domain')
|
||||
domains = res.get("domain")
|
||||
if not domains:
|
||||
return res
|
||||
if domains.get('payment_method_id'):
|
||||
domains['payment_method_id'].append(
|
||||
('payment_order_only', '!=', True))
|
||||
if domains.get("payment_method_id"):
|
||||
domains["payment_method_id"].append(("payment_order_only", "!=", True))
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user