diff --git a/account_banking_mandate/models/account_banking_mandate.py b/account_banking_mandate/models/account_banking_mandate.py
index c67782408..4cf2f2098 100644
--- a/account_banking_mandate/models/account_banking_mandate.py
+++ b/account_banking_mandate/models/account_banking_mandate.py
@@ -64,7 +64,8 @@ class AccountBankingMandate(models.Model):
string="Unique Mandate Reference", tracking=10, copy=False
)
signature_date = fields.Date(
- string="Date of Signature of the Mandate", tracking=50,
+ string="Date of Signature of the Mandate",
+ tracking=50,
)
scan = fields.Binary(string="Scan of the Mandate")
last_debit_date = fields.Date(string="Date of the Last Debit", readonly=True)
@@ -135,10 +136,7 @@ class AccountBankingMandate(models.Model):
def _check_dates(self):
today = fields.Date.context_today(self)
for mandate in self:
- if (
- mandate.signature_date
- and mandate.signature_date > today
- ):
+ if mandate.signature_date and mandate.signature_date > today:
raise ValidationError(
_("The date of signature of mandate '%s' " "is in the future!")
% mandate.unique_mandate_reference
diff --git a/account_banking_mandate/models/account_move_line.py b/account_banking_mandate/models/account_move_line.py
index 4cbd314ac..9b8e77a91 100644
--- a/account_banking_mandate/models/account_move_line.py
+++ b/account_banking_mandate/models/account_move_line.py
@@ -10,7 +10,9 @@ class AccountMoveLine(models.Model):
_inherit = "account.move.line"
mandate_id = fields.Many2one(
- "account.banking.mandate", string="Direct Debit Mandate", ondelete="restrict",
+ "account.banking.mandate",
+ string="Direct Debit Mandate",
+ ondelete="restrict",
check_company=True,
)
diff --git a/account_banking_mandate/tests/test_invoice_mandate.py b/account_banking_mandate/tests/test_invoice_mandate.py
index 0694c663b..c24b9e91a 100644
--- a/account_banking_mandate/tests/test_invoice_mandate.py
+++ b/account_banking_mandate/tests/test_invoice_mandate.py
@@ -230,8 +230,10 @@ class TestInvoiceMandate(TransactionCase):
bank_journal = self.env["account.journal"].search(
[
("type", "=", "bank"),
- ('company_id', '=', self.company.id),
- ], limit=1)
+ ("company_id", "=", self.company.id),
+ ],
+ limit=1,
+ )
self.mode_inbound_acme.variable_journal_ids = bank_journal
self.mode_inbound_acme.payment_method_id.mandate_required = True
self.mode_inbound_acme.payment_order_ok = True
@@ -284,9 +286,10 @@ class TestInvoiceMandate(TransactionCase):
"move_type": "out_invoice",
"company_id": self.company.id,
"journal_id": self.env["account.journal"]
- .search([
- ("type", "=", "sale"),
- ('company_id', '=', self.company.id)], limit=1)
+ .search(
+ [("type", "=", "sale"), ("company_id", "=", self.company.id)],
+ limit=1,
+ )
.id,
"invoice_line_ids": invoice_vals,
}
diff --git a/account_banking_mandate/views/account_banking_mandate_view.xml b/account_banking_mandate/views/account_banking_mandate_view.xml
index 85d69305f..c31374da4 100644
--- a/account_banking_mandate/views/account_banking_mandate_view.xml
+++ b/account_banking_mandate/views/account_banking_mandate_view.xml
@@ -37,7 +37,11 @@
confirm="You should set a mandate back to draft only if you cancelled it by mistake. Do you want to continue?"
invisible="context.get('mandate_bank_partner_view')"
/>
-