[IMP] account_payment_order: black, isort

This commit is contained in:
Raf Ven
2020-03-12 19:46:51 +01:00
committed by Carlos Roca
parent b360637997
commit 001bd7e976
37 changed files with 2169 additions and 1719 deletions

View File

@@ -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