@@ -17,29 +17,13 @@ class AccountJournal(models.Model):
17
17
domain = "[('reconcile', '=', True), ('deprecated', '=', False), "
18
18
"('company_id', '=', company_id), "
19
19
"('id', 'not in', (default_account_id, suspense_account_id, "
20
- "payment_credit_account_id, payment_debit_account_id, "
21
- "donation_debit_order_account_id))]" ,
20
+ "payment_credit_account_id, payment_debit_account_id))]" ,
22
21
string = "Donation by Credit Transfer Account" ,
23
22
help = "Transfer account for donations received by credit transfer. "
24
23
"Leave empty if you don't receive donations on this bank account." ,
25
24
)
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
25
42
- @api .constrains ("donation_account_id" , "donation_debit_order_account_id" )
26
+ @api .constrains ("donation_account_id" )
43
27
def _check_donation_accounts (self ):
44
28
for journal in self :
45
29
if (
@@ -55,27 +39,3 @@ def _check_donation_accounts(self):
55
39
account = journal .donation_account_id .display_name ,
56
40
)
57
41
)
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