22
22
##############################################################################
24
ACCOUNT_RESTRICTED_AREA = {
27
('type', '!=', 'view'),
28
('is_not_hq_correctible', '!=', True),
29
'|', ('type', '!=', 'liquidity'), ('user_type_code', '!=', 'cash'), # Do not allow Liquidity / Cash accounts
30
'|', ('type', '!=', 'other'), ('user_type_code', '!=', 'stock'), # Do not allow Regular / Stock accounts
31
'|', ('user_type_code', '!=', 'expense'), ('user_type.report_type', '!=', 'none'), # Disallow extra-accounting expenses accounts
33
# CASH RETURN - ADVANCE LINES
35
('type', '!=', 'view'),
36
('user_type_code', 'in', ['income', 'expense']),
37
('user_type_report_type', '!=', 'none'),
38
('is_not_hq_correctible', '=', False),
45
('type', '!=', 'view'),
46
# Either Payable/Payables accounts or Regular / Debt accounts
47
'|', '&', ('type', '=', 'payable'), ('user_type_code', '=', 'payables'), '&', ('type', '=', 'other'), ('user_type_code', 'in', ['debt','cash']),
48
('type_for_register', '!=', 'donation'),
51
#+ Stock Transfer Voucher
55
('type', '!=', 'view'),
56
# Either Receivable/Receivables accounts or Regular / Cash accounts
57
'|', '&', ('type', '=', 'receivable'), ('user_type_code', 'in', ['receivables','cash']), '&', ('type', '=', 'other'), ('user_type_code', '=', 'cash'),
61
('type', '!=', 'view'),
62
('user_type_code', '=', 'payables'),
63
('type', '=', 'payable'),
64
('type_for_register', '=', 'donation'),
70
#+ Stock transfer voucher
74
('type', 'not in', ['view', 'liquidity']), # Do not allow liquidity accounts
75
('is_not_hq_correctible', '!=', True),
76
'|', ('type', '!=', 'other'), ('user_type_code', '!=', 'stock'), # Do not allow Regular / Stock accounts
77
'|', ('user_type_code', '!=', 'expense'), ('user_type.report_type', '!=', 'none'), # Disallow extra-accounting expenses accounts
81
('type', '!=', 'view'),
82
('type', '=', 'other'),
83
('user_type_code', '=', 'expense'),
84
('user_type.report_type', '=', 'none'), # Only extra-accounting expenses
85
('type_for_register', '=', 'donation'),
87
# Commitment voucher lines
89
('type', '!=', 'view'),
90
('user_type_code', '=', 'expense'),
91
'|', ('user_type_code', '!=', 'expense'), ('user_type.report_type', '!=', 'none'), # To only use Expense extra-accounting accounts
93
# HEADER OF Intermission Voucher IN/OUT
94
'intermission_header': [
95
('is_intermission_counterpart', '=', True),
97
# LINES OF intermission vouchers
98
'intermission_lines': [
99
('type', '!=', 'view'),
100
('is_not_hq_correctible', '=', False),
101
('user_type_code', '=', 'expense'),
102
('user_type.report_type', '!=', 'none'), # To only use Expense extra-accounting accounts
106
('type', '!=', 'view'),
107
('is_not_hq_correctible', '=', False),
108
'|', '&', ('user_type_code', '=', 'receivables'), ('type', '=', 'receivable'), '&', ('user_type_code', '=', 'expense'), ('user_type.report_type', '!=', 'none'), # Receivable/Receivable allowed + expense accounts (without extra-accounting) allowed
110
# ACCRUALS - expense field
112
('type', '!=', 'view'),
113
('is_not_hq_correctible', '=', False),
114
('user_type_code', '=', 'expense'),
115
'|', ('user_type_code', '!=', 'expense'), ('user_type.report_type', '!=', 'none'), # Do not allow extra-expense accounts
117
# ACCRUALS - accrual field
118
'accruals_accrual': [
119
('type', '!=', 'view'),
120
('is_not_hq_correctible', '=', False),
121
('accrual_account', '=', True),
125
('type', '!=', 'view'),
126
('user_type_code', 'in', ['income', 'expense']),
127
('user_type_report_type', '!=', 'none'),
128
('is_not_hq_correctible', '=', False),
132
('type', '!=', 'view'),
133
('user_type_code', '=', 'expense'),
134
'|', ('user_type_code', '!=', 'expense'), ('user_type.report_type', '!=', 'none'), # Exclude non-extra accounting expense accounts
135
#('is_not_hq_correctible', '=', False), # UF-2312: not possibleto add this domain because WE SHOULD ALLOW "Not HQ Correctible" account during the import
137
# MANUEL JOURNAL ENTRIES
138
'account_move_lines': [
139
('type', 'not in', ['view', 'consolidation', 'closed']),
140
'|', ('type', '!=', 'liquidity'), ('user_type_code', '!=', 'cash'), # Do not allow Liquidity / Cash accounts
141
('is_not_hq_correctible', '=', False),
143
# FINANCING CONTRACT - REPORTING LINES
144
'contract_reporting_lines': [
145
('account_id.user_type_code', 'in', ['income', 'expense']),
146
('account_id.user_type_report_type', '!=', 'none'),
148
# PARTNER - DONATION DEFAULT ACCOUNT
149
'partner_donation': [
150
('type', '!=', 'view'),
151
('type', '=', 'payable'),
152
('user_type_code', '=', 'payables'),
153
('type_for_register', '=', 'donation'),
155
# PARTNER - PAYABLE DEFAULT ACCOUNT
157
('type', '!=', 'view'),
158
('type', 'in', ['payable','other']),
159
('user_type_code', 'in', ['payables', 'tax','cash']),
160
('type_for_register', '!=', 'donation'),
162
# PARTNER - RECEIVABLE DEFAULT ACCOUNT
163
'partner_receivable': [
164
('type', '!=', 'view'),
165
# Either Receivable accounts or Regular / Cash accounts
166
'|', ('type', '=', 'receivable'), '&', ('type', '=', 'other'), ('user_type_code', '=', 'cash'),
168
# PRODUCT - DONATION ACCOUNT
169
'product_donation': [
170
('type', '!=', 'view'),
171
('user_type_code', '=', 'expense'),
172
('type_for_register', '=', 'donation'),
174
# PRODUCT CATEGORY - DONATION ACCOUNT
175
'product_category_donation': [
176
('type', '!=', 'view'),
177
('user_type_code', '=', 'expense'),
178
('type_for_register', '=', 'donation'),
182
('type', '!=', 'view'),
183
('user_type_code', '=', 'cash'),
184
('type', '=', 'liquidity'),
186
# CORRECTION WIZARD LINES
187
'correction_wizard': [
188
('type', '!=', 'view'),
189
('is_not_hq_correctible', '=', False), # Do not allow user to select accounts with "Not HQ correctible" set to True
190
('code', '<', '80000'), # UTP-1187 exclude 8/9 accounts
191
('code', 'not in', ['10100', '10200', '10210']), # UTP-1187 exclude liquidity / cash (10100, 10200, 10210) accounts
192
('is_not_hq_correctible', '!=', True) # UTP-1187 exclude with the "Can not be corrected on HQ entries" attribute set to "True" accounts
203
26
import account_move_line
204
27
import account_analytic_line
205
import account_bank_statement
208
import finance_export
209
29
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: