@@ -23,23 +23,8 @@ class AccountJournal(models.Model):
23
23
help = "Transfer account for donations received by credit transfer. "
24
24
"Leave empty if you don't receive donations on this bank account." ,
25
25
)
26
- donation_debit_order_account_id = fields .Many2one (
27
- "account.account" ,
28
- check_company = True ,
29
- copy = False ,
30
- ondelete = "restrict" ,
31
- domain = "[('reconcile', '=', True), ('deprecated', '=', False), "
32
- "('company_id', '=', company_id), "
33
- "('user_type_id.type', '=', 'receivable'), "
34
- "('id', 'not in', (default_account_id, suspense_account_id, "
35
- "payment_credit_account_id, payment_debit_account_id, donation_account_id))]" ,
36
- string = "Donation by Debit Order Account" ,
37
- help = "Transfer account for donations by debit order. "
38
- "Leave empty if you don't handle donations by debit order on this bank account."
39
- "This account must be a receivable account, otherwise the debit order will not work." ,
40
- )
41
26
42
- @api .constrains ("donation_account_id" , "donation_debit_order_account_id" )
27
+ @api .constrains ("donation_account_id" )
43
28
def _check_donation_accounts (self ):
44
29
for journal in self :
45
30
if (
@@ -55,27 +40,3 @@ def _check_donation_accounts(self):
55
40
account = journal .donation_account_id .display_name ,
56
41
)
57
42
)
58
- ddo_account = journal .donation_debit_order_account_id
59
- if ddo_account :
60
- if not ddo_account .reconcile :
61
- raise ValidationError (
62
- _ (
63
- "The Donation by Debit Order Account of journal "
64
- "'%(journal)s' must be reconciliable, but the account "
65
- "'%(account)s' is not reconciliable." ,
66
- journal = journal .display_name ,
67
- account = ddo_account .display_name ,
68
- )
69
- )
70
- if ddo_account .user_type_id .type != "receivable" :
71
- raise ValidationError (
72
- _ (
73
- "The Donation by Debit Order Account of journal "
74
- "'%(journal)s' must be a receivable account, "
75
- "but the account '%(account)s' is configured with "
76
- "type '%(account_type)s'." ,
77
- journal = journal .display_name ,
78
- account = ddo_account .display_name ,
79
- account_type = ddo_account .user_type_id .display_name ,
80
- )
81
- )
0 commit comments