odoo-addon-contract 17.0.1.4.3.2__py3-none-any.whl → 18.0.2.0.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- odoo/addons/contract/README.rst +14 -10
- odoo/addons/contract/__manifest__.py +3 -10
- odoo/addons/contract/controllers/main.py +1 -8
- odoo/addons/contract/data/contract_cron.xml +0 -2
- odoo/addons/contract/data/mail_template.xml +18 -17
- odoo/addons/contract/data/template_mail_notification.xml +1 -1
- odoo/addons/contract/i18n/am.po +146 -821
- odoo/addons/contract/i18n/ar.po +146 -821
- odoo/addons/contract/i18n/bg.po +146 -821
- odoo/addons/contract/i18n/bs.po +146 -821
- odoo/addons/contract/i18n/ca.po +835 -900
- odoo/addons/contract/i18n/ca_ES.po +146 -821
- odoo/addons/contract/i18n/contract.pot +145 -818
- odoo/addons/contract/i18n/cs.po +146 -821
- odoo/addons/contract/i18n/da.po +146 -821
- odoo/addons/contract/i18n/de.po +712 -953
- odoo/addons/contract/i18n/el_GR.po +146 -821
- odoo/addons/contract/i18n/en_GB.po +146 -821
- odoo/addons/contract/i18n/es.po +714 -947
- odoo/addons/contract/i18n/es_AR.po +550 -877
- odoo/addons/contract/i18n/es_CL.po +146 -821
- odoo/addons/contract/i18n/es_CO.po +146 -821
- odoo/addons/contract/i18n/es_CR.po +146 -821
- odoo/addons/contract/i18n/es_DO.po +146 -821
- odoo/addons/contract/i18n/es_EC.po +146 -821
- odoo/addons/contract/i18n/es_MX.po +146 -821
- odoo/addons/contract/i18n/es_PY.po +146 -821
- odoo/addons/contract/i18n/es_VE.po +146 -821
- odoo/addons/contract/i18n/et.po +146 -821
- odoo/addons/contract/i18n/eu.po +146 -821
- odoo/addons/contract/i18n/fa.po +146 -821
- odoo/addons/contract/i18n/fi.po +422 -848
- odoo/addons/contract/i18n/fr.po +713 -953
- odoo/addons/contract/i18n/fr_CA.po +146 -821
- odoo/addons/contract/i18n/fr_CH.po +146 -821
- odoo/addons/contract/i18n/fr_FR.po +454 -850
- odoo/addons/contract/i18n/gl.po +257 -846
- odoo/addons/contract/i18n/gl_ES.po +146 -821
- odoo/addons/contract/i18n/he.po +146 -821
- odoo/addons/contract/i18n/hi_IN.po +191 -831
- odoo/addons/contract/i18n/hr.po +211 -837
- odoo/addons/contract/i18n/hr_HR.po +223 -839
- odoo/addons/contract/i18n/hu.po +146 -821
- odoo/addons/contract/i18n/id.po +146 -821
- odoo/addons/contract/i18n/it.po +753 -902
- odoo/addons/contract/i18n/ja.po +146 -821
- odoo/addons/contract/i18n/ko.po +146 -821
- odoo/addons/contract/i18n/lt.po +146 -821
- odoo/addons/contract/i18n/lt_LT.po +146 -821
- odoo/addons/contract/i18n/lv.po +146 -821
- odoo/addons/contract/i18n/mk.po +146 -821
- odoo/addons/contract/i18n/mn.po +146 -821
- odoo/addons/contract/i18n/nb.po +146 -821
- odoo/addons/contract/i18n/nb_NO.po +146 -821
- odoo/addons/contract/i18n/nl.po +699 -953
- odoo/addons/contract/i18n/nl_BE.po +146 -821
- odoo/addons/contract/i18n/nl_NL.po +191 -831
- odoo/addons/contract/i18n/pl.po +146 -821
- odoo/addons/contract/i18n/pt.po +415 -839
- odoo/addons/contract/i18n/pt_BR.po +704 -947
- odoo/addons/contract/i18n/pt_PT.po +146 -821
- odoo/addons/contract/i18n/ro.po +146 -821
- odoo/addons/contract/i18n/ru.po +191 -831
- odoo/addons/contract/i18n/sk.po +146 -821
- odoo/addons/contract/i18n/sk_SK.po +146 -821
- odoo/addons/contract/i18n/sl.po +146 -821
- odoo/addons/contract/i18n/sr.po +146 -821
- odoo/addons/contract/i18n/sr@latin.po +146 -821
- odoo/addons/contract/i18n/sv.po +784 -933
- odoo/addons/contract/i18n/th.po +146 -821
- odoo/addons/contract/i18n/tr.po +611 -879
- odoo/addons/contract/i18n/tr_TR.po +221 -838
- odoo/addons/contract/i18n/uk.po +146 -821
- odoo/addons/contract/i18n/vi.po +146 -821
- odoo/addons/contract/i18n/vi_VN.po +146 -821
- odoo/addons/contract/i18n/zh_CN.po +407 -840
- odoo/addons/contract/i18n/zh_TW.po +150 -822
- odoo/addons/contract/migrations/18.0.2.0.0/end-migrate.py +27 -0
- odoo/addons/contract/migrations/18.0.2.0.0/pre-migrate.py +94 -0
- odoo/addons/contract/models/__init__.py +2 -6
- odoo/addons/contract/models/account_move.py +0 -8
- odoo/addons/contract/models/account_move_line.py +14 -0
- odoo/addons/contract/models/contract.py +272 -308
- odoo/addons/contract/models/contract_line.py +37 -859
- odoo/addons/contract/models/{contract_recurrency_mixin.py → contract_recurring_mixin.py} +101 -82
- odoo/addons/contract/models/contract_tag.py +1 -3
- odoo/addons/contract/models/contract_template.py +81 -2
- odoo/addons/contract/models/contract_template_line.py +250 -3
- odoo/addons/contract/report/contract_views.xml +0 -2
- odoo/addons/contract/report/report_contract.xml +13 -13
- odoo/addons/contract/security/contract_security.xml +6 -15
- odoo/addons/contract/security/contract_tag.xml +1 -3
- odoo/addons/contract/security/ir.model.access.csv +0 -2
- odoo/addons/contract/static/description/index.html +24 -18
- odoo/addons/contract/static/src/img/contract_icon.svg +4 -0
- odoo/addons/contract/static/src/js/contract_portal_tour.esm.js +6 -4
- odoo/addons/contract/tests/test_contract.py +82 -928
- odoo/addons/contract/tests/test_multicompany.py +5 -4
- odoo/addons/contract/tests/test_portal.py +6 -3
- odoo/addons/contract/views/contract.xml +92 -235
- odoo/addons/contract/views/contract_line.xml +48 -117
- odoo/addons/contract/views/contract_portal_templates.xml +187 -224
- odoo/addons/contract/views/contract_tag.xml +3 -3
- odoo/addons/contract/views/contract_template.xml +100 -72
- odoo/addons/contract/views/contract_template_line.xml +76 -5
- odoo/addons/contract/views/res_config_settings.xml +5 -6
- odoo/addons/contract/views/res_partner_view.xml +0 -5
- odoo/addons/contract/wizards/__init__.py +0 -2
- odoo/addons/contract/wizards/contract_manually_create_invoice.py +6 -6
- odoo/addons/contract/wizards/contract_manually_create_invoice.xml +2 -3
- {odoo_addon_contract-17.0.1.4.3.2.dist-info → odoo_addon_contract-18.0.2.0.8.dist-info}/METADATA +18 -13
- odoo_addon_contract-18.0.2.0.8.dist-info/RECORD +132 -0
- {odoo_addon_contract-17.0.1.4.3.2.dist-info → odoo_addon_contract-18.0.2.0.8.dist-info}/WHEEL +1 -1
- odoo/addons/contract/data/contract_renew_cron.xml +0 -14
- odoo/addons/contract/models/abstract_contract.py +0 -82
- odoo/addons/contract/models/abstract_contract_line.py +0 -271
- odoo/addons/contract/models/contract_line_constraints.py +0 -429
- odoo/addons/contract/models/contract_terminate_reason.py +0 -14
- odoo/addons/contract/models/res_company.py +0 -15
- odoo/addons/contract/models/res_config_settings.py +0 -18
- odoo/addons/contract/security/contract_terminate_reason.xml +0 -23
- odoo/addons/contract/security/groups.xml +0 -9
- odoo/addons/contract/views/abstract_contract_line.xml +0 -117
- odoo/addons/contract/views/contract_terminate_reason.xml +0 -38
- odoo/addons/contract/wizards/contract_contract_terminate.py +0 -42
- odoo/addons/contract/wizards/contract_contract_terminate.xml +0 -33
- odoo/addons/contract/wizards/contract_line_wizard.py +0 -53
- odoo/addons/contract/wizards/contract_line_wizard.xml +0 -111
- odoo_addon_contract-17.0.1.4.3.2.dist-info/RECORD +0 -143
- {odoo_addon_contract-17.0.1.4.3.2.dist-info → odoo_addon_contract-18.0.2.0.8.dist-info}/top_level.txt +0 -0
|
@@ -1,429 +0,0 @@
|
|
|
1
|
-
# Copyright 2018 ACSONE SA/NV.
|
|
2
|
-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
3
|
-
|
|
4
|
-
import itertools
|
|
5
|
-
from collections import namedtuple
|
|
6
|
-
|
|
7
|
-
from odoo.fields import Date
|
|
8
|
-
|
|
9
|
-
Criteria = namedtuple(
|
|
10
|
-
"Criteria",
|
|
11
|
-
[
|
|
12
|
-
"when", # Contract line relatively to today (BEFORE, IN, AFTER)
|
|
13
|
-
"has_date_end", # Is date_end set on contract line (bool)
|
|
14
|
-
"has_last_date_invoiced", # Is last_date_invoiced set on contract line
|
|
15
|
-
"is_auto_renew", # Is is_auto_renew set on contract line (bool)
|
|
16
|
-
"has_successor", # Is contract line has_successor (bool)
|
|
17
|
-
"predecessor_has_successor",
|
|
18
|
-
# Is contract line predecessor has successor (bool)
|
|
19
|
-
# In almost of the cases
|
|
20
|
-
# contract_line.predecessor.successor == contract_line
|
|
21
|
-
# But at cancel action,
|
|
22
|
-
# contract_line.predecessor.successor == False
|
|
23
|
-
# This is to permit plan_successor on predecessor
|
|
24
|
-
# If contract_line.predecessor.successor != False
|
|
25
|
-
# and contract_line is canceled, we don't allow uncancel
|
|
26
|
-
# else we re-link contract_line and its predecessor
|
|
27
|
-
"canceled", # Is contract line canceled (bool)
|
|
28
|
-
],
|
|
29
|
-
)
|
|
30
|
-
Allowed = namedtuple(
|
|
31
|
-
"Allowed",
|
|
32
|
-
["plan_successor", "stop_plan_successor", "stop", "cancel", "uncancel"],
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def _expand_none(criteria):
|
|
37
|
-
variations = []
|
|
38
|
-
for attribute, value in criteria._asdict().items():
|
|
39
|
-
if value is None:
|
|
40
|
-
if attribute == "when":
|
|
41
|
-
variations.append(["BEFORE", "IN", "AFTER"])
|
|
42
|
-
else:
|
|
43
|
-
variations.append([True, False])
|
|
44
|
-
else:
|
|
45
|
-
variations.append([value])
|
|
46
|
-
return itertools.product(*variations)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
def _add(matrix, criteria, allowed):
|
|
50
|
-
"""Expand None values to True/False combination"""
|
|
51
|
-
for c in _expand_none(criteria):
|
|
52
|
-
matrix[c] = allowed
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
CRITERIA_ALLOWED_DICT = {
|
|
56
|
-
Criteria(
|
|
57
|
-
when="BEFORE",
|
|
58
|
-
has_date_end=True,
|
|
59
|
-
has_last_date_invoiced=False,
|
|
60
|
-
is_auto_renew=True,
|
|
61
|
-
has_successor=False,
|
|
62
|
-
predecessor_has_successor=None,
|
|
63
|
-
canceled=False,
|
|
64
|
-
): Allowed(
|
|
65
|
-
plan_successor=False,
|
|
66
|
-
stop_plan_successor=True,
|
|
67
|
-
stop=True,
|
|
68
|
-
cancel=True,
|
|
69
|
-
uncancel=False,
|
|
70
|
-
),
|
|
71
|
-
Criteria(
|
|
72
|
-
when="BEFORE",
|
|
73
|
-
has_date_end=True,
|
|
74
|
-
has_last_date_invoiced=False,
|
|
75
|
-
is_auto_renew=False,
|
|
76
|
-
has_successor=True,
|
|
77
|
-
predecessor_has_successor=None,
|
|
78
|
-
canceled=False,
|
|
79
|
-
): Allowed(
|
|
80
|
-
plan_successor=False,
|
|
81
|
-
stop_plan_successor=False,
|
|
82
|
-
stop=True,
|
|
83
|
-
cancel=True,
|
|
84
|
-
uncancel=False,
|
|
85
|
-
),
|
|
86
|
-
Criteria(
|
|
87
|
-
when="BEFORE",
|
|
88
|
-
has_date_end=True,
|
|
89
|
-
has_last_date_invoiced=False,
|
|
90
|
-
is_auto_renew=False,
|
|
91
|
-
has_successor=False,
|
|
92
|
-
predecessor_has_successor=None,
|
|
93
|
-
canceled=False,
|
|
94
|
-
): Allowed(
|
|
95
|
-
plan_successor=True,
|
|
96
|
-
stop_plan_successor=True,
|
|
97
|
-
stop=True,
|
|
98
|
-
cancel=True,
|
|
99
|
-
uncancel=False,
|
|
100
|
-
),
|
|
101
|
-
Criteria(
|
|
102
|
-
when="BEFORE",
|
|
103
|
-
has_date_end=False,
|
|
104
|
-
has_last_date_invoiced=False,
|
|
105
|
-
is_auto_renew=False,
|
|
106
|
-
has_successor=False,
|
|
107
|
-
predecessor_has_successor=None,
|
|
108
|
-
canceled=False,
|
|
109
|
-
): Allowed(
|
|
110
|
-
plan_successor=False,
|
|
111
|
-
stop_plan_successor=True,
|
|
112
|
-
stop=True,
|
|
113
|
-
cancel=True,
|
|
114
|
-
uncancel=False,
|
|
115
|
-
),
|
|
116
|
-
Criteria(
|
|
117
|
-
when="IN",
|
|
118
|
-
has_date_end=True,
|
|
119
|
-
has_last_date_invoiced=False,
|
|
120
|
-
is_auto_renew=True,
|
|
121
|
-
has_successor=False,
|
|
122
|
-
predecessor_has_successor=None,
|
|
123
|
-
canceled=False,
|
|
124
|
-
): Allowed(
|
|
125
|
-
plan_successor=False,
|
|
126
|
-
stop_plan_successor=True,
|
|
127
|
-
stop=True,
|
|
128
|
-
cancel=True,
|
|
129
|
-
uncancel=False,
|
|
130
|
-
),
|
|
131
|
-
Criteria(
|
|
132
|
-
when="IN",
|
|
133
|
-
has_date_end=True,
|
|
134
|
-
has_last_date_invoiced=False,
|
|
135
|
-
is_auto_renew=False,
|
|
136
|
-
has_successor=True,
|
|
137
|
-
predecessor_has_successor=None,
|
|
138
|
-
canceled=False,
|
|
139
|
-
): Allowed(
|
|
140
|
-
plan_successor=False,
|
|
141
|
-
stop_plan_successor=False,
|
|
142
|
-
stop=True,
|
|
143
|
-
cancel=True,
|
|
144
|
-
uncancel=False,
|
|
145
|
-
),
|
|
146
|
-
Criteria(
|
|
147
|
-
when="IN",
|
|
148
|
-
has_date_end=True,
|
|
149
|
-
has_last_date_invoiced=False,
|
|
150
|
-
is_auto_renew=False,
|
|
151
|
-
has_successor=False,
|
|
152
|
-
predecessor_has_successor=None,
|
|
153
|
-
canceled=False,
|
|
154
|
-
): Allowed(
|
|
155
|
-
plan_successor=True,
|
|
156
|
-
stop_plan_successor=True,
|
|
157
|
-
stop=True,
|
|
158
|
-
cancel=True,
|
|
159
|
-
uncancel=False,
|
|
160
|
-
),
|
|
161
|
-
Criteria(
|
|
162
|
-
when="IN",
|
|
163
|
-
has_date_end=False,
|
|
164
|
-
has_last_date_invoiced=False,
|
|
165
|
-
is_auto_renew=False,
|
|
166
|
-
has_successor=False,
|
|
167
|
-
predecessor_has_successor=None,
|
|
168
|
-
canceled=False,
|
|
169
|
-
): Allowed(
|
|
170
|
-
plan_successor=False,
|
|
171
|
-
stop_plan_successor=True,
|
|
172
|
-
stop=True,
|
|
173
|
-
cancel=True,
|
|
174
|
-
uncancel=False,
|
|
175
|
-
),
|
|
176
|
-
Criteria(
|
|
177
|
-
when="BEFORE",
|
|
178
|
-
has_date_end=True,
|
|
179
|
-
has_last_date_invoiced=True,
|
|
180
|
-
is_auto_renew=True,
|
|
181
|
-
has_successor=False,
|
|
182
|
-
predecessor_has_successor=None,
|
|
183
|
-
canceled=False,
|
|
184
|
-
): Allowed(
|
|
185
|
-
plan_successor=False,
|
|
186
|
-
stop_plan_successor=True,
|
|
187
|
-
stop=True,
|
|
188
|
-
cancel=False,
|
|
189
|
-
uncancel=False,
|
|
190
|
-
),
|
|
191
|
-
Criteria(
|
|
192
|
-
when="BEFORE",
|
|
193
|
-
has_date_end=True,
|
|
194
|
-
has_last_date_invoiced=True,
|
|
195
|
-
is_auto_renew=False,
|
|
196
|
-
has_successor=True,
|
|
197
|
-
predecessor_has_successor=None,
|
|
198
|
-
canceled=False,
|
|
199
|
-
): Allowed(
|
|
200
|
-
plan_successor=False,
|
|
201
|
-
stop_plan_successor=False,
|
|
202
|
-
stop=True,
|
|
203
|
-
cancel=False,
|
|
204
|
-
uncancel=False,
|
|
205
|
-
),
|
|
206
|
-
Criteria(
|
|
207
|
-
when="BEFORE",
|
|
208
|
-
has_date_end=True,
|
|
209
|
-
has_last_date_invoiced=True,
|
|
210
|
-
is_auto_renew=False,
|
|
211
|
-
has_successor=False,
|
|
212
|
-
predecessor_has_successor=None,
|
|
213
|
-
canceled=False,
|
|
214
|
-
): Allowed(
|
|
215
|
-
plan_successor=True,
|
|
216
|
-
stop_plan_successor=True,
|
|
217
|
-
stop=True,
|
|
218
|
-
cancel=False,
|
|
219
|
-
uncancel=False,
|
|
220
|
-
),
|
|
221
|
-
Criteria(
|
|
222
|
-
when="BEFORE",
|
|
223
|
-
has_date_end=False,
|
|
224
|
-
has_last_date_invoiced=True,
|
|
225
|
-
is_auto_renew=False,
|
|
226
|
-
has_successor=False,
|
|
227
|
-
predecessor_has_successor=None,
|
|
228
|
-
canceled=False,
|
|
229
|
-
): Allowed(
|
|
230
|
-
plan_successor=False,
|
|
231
|
-
stop_plan_successor=True,
|
|
232
|
-
stop=True,
|
|
233
|
-
cancel=False,
|
|
234
|
-
uncancel=False,
|
|
235
|
-
),
|
|
236
|
-
Criteria(
|
|
237
|
-
when="IN",
|
|
238
|
-
has_date_end=True,
|
|
239
|
-
has_last_date_invoiced=True,
|
|
240
|
-
is_auto_renew=True,
|
|
241
|
-
has_successor=False,
|
|
242
|
-
predecessor_has_successor=None,
|
|
243
|
-
canceled=False,
|
|
244
|
-
): Allowed(
|
|
245
|
-
plan_successor=False,
|
|
246
|
-
stop_plan_successor=True,
|
|
247
|
-
stop=True,
|
|
248
|
-
cancel=False,
|
|
249
|
-
uncancel=False,
|
|
250
|
-
),
|
|
251
|
-
Criteria(
|
|
252
|
-
when="IN",
|
|
253
|
-
has_date_end=True,
|
|
254
|
-
has_last_date_invoiced=True,
|
|
255
|
-
is_auto_renew=False,
|
|
256
|
-
has_successor=True,
|
|
257
|
-
predecessor_has_successor=None,
|
|
258
|
-
canceled=False,
|
|
259
|
-
): Allowed(
|
|
260
|
-
plan_successor=False,
|
|
261
|
-
stop_plan_successor=False,
|
|
262
|
-
stop=True,
|
|
263
|
-
cancel=False,
|
|
264
|
-
uncancel=False,
|
|
265
|
-
),
|
|
266
|
-
Criteria(
|
|
267
|
-
when="IN",
|
|
268
|
-
has_date_end=True,
|
|
269
|
-
has_last_date_invoiced=True,
|
|
270
|
-
is_auto_renew=False,
|
|
271
|
-
has_successor=False,
|
|
272
|
-
predecessor_has_successor=None,
|
|
273
|
-
canceled=False,
|
|
274
|
-
): Allowed(
|
|
275
|
-
plan_successor=True,
|
|
276
|
-
stop_plan_successor=True,
|
|
277
|
-
stop=True,
|
|
278
|
-
cancel=False,
|
|
279
|
-
uncancel=False,
|
|
280
|
-
),
|
|
281
|
-
Criteria(
|
|
282
|
-
when="IN",
|
|
283
|
-
has_date_end=False,
|
|
284
|
-
has_last_date_invoiced=True,
|
|
285
|
-
is_auto_renew=False,
|
|
286
|
-
has_successor=False,
|
|
287
|
-
predecessor_has_successor=None,
|
|
288
|
-
canceled=False,
|
|
289
|
-
): Allowed(
|
|
290
|
-
plan_successor=False,
|
|
291
|
-
stop_plan_successor=True,
|
|
292
|
-
stop=True,
|
|
293
|
-
cancel=False,
|
|
294
|
-
uncancel=False,
|
|
295
|
-
),
|
|
296
|
-
Criteria(
|
|
297
|
-
when="AFTER",
|
|
298
|
-
has_date_end=True,
|
|
299
|
-
has_last_date_invoiced=None,
|
|
300
|
-
is_auto_renew=True,
|
|
301
|
-
has_successor=False,
|
|
302
|
-
predecessor_has_successor=None,
|
|
303
|
-
canceled=False,
|
|
304
|
-
): Allowed(
|
|
305
|
-
plan_successor=False,
|
|
306
|
-
stop_plan_successor=False,
|
|
307
|
-
stop=True,
|
|
308
|
-
cancel=False,
|
|
309
|
-
uncancel=False,
|
|
310
|
-
),
|
|
311
|
-
Criteria(
|
|
312
|
-
when="AFTER",
|
|
313
|
-
has_date_end=True,
|
|
314
|
-
has_last_date_invoiced=None,
|
|
315
|
-
is_auto_renew=False,
|
|
316
|
-
has_successor=True,
|
|
317
|
-
predecessor_has_successor=None,
|
|
318
|
-
canceled=False,
|
|
319
|
-
): Allowed(
|
|
320
|
-
plan_successor=False,
|
|
321
|
-
stop_plan_successor=False,
|
|
322
|
-
stop=False,
|
|
323
|
-
cancel=False,
|
|
324
|
-
uncancel=False,
|
|
325
|
-
),
|
|
326
|
-
Criteria(
|
|
327
|
-
when="AFTER",
|
|
328
|
-
has_date_end=True,
|
|
329
|
-
has_last_date_invoiced=None,
|
|
330
|
-
is_auto_renew=False,
|
|
331
|
-
has_successor=False,
|
|
332
|
-
predecessor_has_successor=None,
|
|
333
|
-
canceled=False,
|
|
334
|
-
): Allowed(
|
|
335
|
-
plan_successor=True,
|
|
336
|
-
stop_plan_successor=False,
|
|
337
|
-
stop=True,
|
|
338
|
-
cancel=False,
|
|
339
|
-
uncancel=False,
|
|
340
|
-
),
|
|
341
|
-
Criteria(
|
|
342
|
-
when=None,
|
|
343
|
-
has_date_end=None,
|
|
344
|
-
has_last_date_invoiced=None,
|
|
345
|
-
is_auto_renew=None,
|
|
346
|
-
has_successor=None,
|
|
347
|
-
predecessor_has_successor=False,
|
|
348
|
-
canceled=True,
|
|
349
|
-
): Allowed(
|
|
350
|
-
plan_successor=False,
|
|
351
|
-
stop_plan_successor=False,
|
|
352
|
-
stop=False,
|
|
353
|
-
cancel=False,
|
|
354
|
-
uncancel=True,
|
|
355
|
-
),
|
|
356
|
-
Criteria(
|
|
357
|
-
when=None,
|
|
358
|
-
has_date_end=None,
|
|
359
|
-
has_last_date_invoiced=None,
|
|
360
|
-
is_auto_renew=None,
|
|
361
|
-
has_successor=None,
|
|
362
|
-
predecessor_has_successor=True,
|
|
363
|
-
canceled=True,
|
|
364
|
-
): Allowed(
|
|
365
|
-
plan_successor=False,
|
|
366
|
-
stop_plan_successor=False,
|
|
367
|
-
stop=False,
|
|
368
|
-
cancel=False,
|
|
369
|
-
uncancel=False,
|
|
370
|
-
),
|
|
371
|
-
}
|
|
372
|
-
criteria_allowed_dict = {}
|
|
373
|
-
|
|
374
|
-
for c in CRITERIA_ALLOWED_DICT:
|
|
375
|
-
_add(criteria_allowed_dict, c, CRITERIA_ALLOWED_DICT[c])
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
def compute_when(date_start, date_end):
|
|
379
|
-
today = Date.today()
|
|
380
|
-
if today < date_start:
|
|
381
|
-
return "BEFORE"
|
|
382
|
-
if date_end and today > date_end:
|
|
383
|
-
return "AFTER"
|
|
384
|
-
return "IN"
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
def compute_criteria(
|
|
388
|
-
date_start,
|
|
389
|
-
date_end,
|
|
390
|
-
has_last_date_invoiced,
|
|
391
|
-
is_auto_renew,
|
|
392
|
-
successor_contract_line_id,
|
|
393
|
-
predecessor_contract_line_id,
|
|
394
|
-
is_canceled,
|
|
395
|
-
):
|
|
396
|
-
return Criteria(
|
|
397
|
-
when=compute_when(date_start, date_end),
|
|
398
|
-
has_date_end=bool(date_end),
|
|
399
|
-
has_last_date_invoiced=bool(has_last_date_invoiced),
|
|
400
|
-
is_auto_renew=is_auto_renew,
|
|
401
|
-
has_successor=bool(successor_contract_line_id),
|
|
402
|
-
predecessor_has_successor=bool(
|
|
403
|
-
predecessor_contract_line_id.successor_contract_line_id
|
|
404
|
-
),
|
|
405
|
-
canceled=is_canceled,
|
|
406
|
-
)
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
def get_allowed(
|
|
410
|
-
date_start,
|
|
411
|
-
date_end,
|
|
412
|
-
has_last_date_invoiced,
|
|
413
|
-
is_auto_renew,
|
|
414
|
-
successor_contract_line_id,
|
|
415
|
-
predecessor_contract_line_id,
|
|
416
|
-
is_canceled,
|
|
417
|
-
):
|
|
418
|
-
criteria = compute_criteria(
|
|
419
|
-
date_start,
|
|
420
|
-
date_end,
|
|
421
|
-
has_last_date_invoiced,
|
|
422
|
-
is_auto_renew,
|
|
423
|
-
successor_contract_line_id,
|
|
424
|
-
predecessor_contract_line_id,
|
|
425
|
-
is_canceled,
|
|
426
|
-
)
|
|
427
|
-
if criteria in criteria_allowed_dict:
|
|
428
|
-
return criteria_allowed_dict[criteria]
|
|
429
|
-
return False
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Copyright 2020 ACSONE SA/NV
|
|
2
|
-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
3
|
-
|
|
4
|
-
from odoo import fields, models
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class ContractTerminateReason(models.Model):
|
|
8
|
-
_name = "contract.terminate.reason"
|
|
9
|
-
_description = "Contract Termination Reason"
|
|
10
|
-
|
|
11
|
-
name = fields.Char(required=True)
|
|
12
|
-
terminate_comment_required = fields.Boolean(
|
|
13
|
-
string="Require a termination comment", default=True
|
|
14
|
-
)
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# Copyright 2019 ACSONE SA/NV
|
|
2
|
-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
3
|
-
|
|
4
|
-
from odoo import fields, models
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class ResCompany(models.Model):
|
|
8
|
-
_inherit = "res.company"
|
|
9
|
-
|
|
10
|
-
create_new_line_at_contract_line_renew = fields.Boolean(
|
|
11
|
-
help="If checked, a new line will be generated at contract line renew "
|
|
12
|
-
"and linked to the original one as successor. The default "
|
|
13
|
-
"behavior is to extend the end date of the contract by a new "
|
|
14
|
-
"subscription period",
|
|
15
|
-
)
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# Copyright 2019 ACSONE SA/NV
|
|
2
|
-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
3
|
-
|
|
4
|
-
from odoo import fields, models
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class ResConfigSettings(models.TransientModel):
|
|
8
|
-
_inherit = "res.config.settings"
|
|
9
|
-
|
|
10
|
-
create_new_line_at_contract_line_renew = fields.Boolean(
|
|
11
|
-
related="company_id.create_new_line_at_contract_line_renew",
|
|
12
|
-
readonly=False,
|
|
13
|
-
string="Create New Line At Contract Line Renew",
|
|
14
|
-
help="If checked, a new line will be generated at contract line renew "
|
|
15
|
-
"and linked to the original one as successor. The default "
|
|
16
|
-
"behavior is to extend the end date of the contract by a new "
|
|
17
|
-
"subscription period",
|
|
18
|
-
)
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
|
-
<!-- Copyright 2020 ACSONE SA/NV
|
|
3
|
-
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
|
4
|
-
<odoo>
|
|
5
|
-
<record model="ir.model.access" id="contract_terminate_reason_access_manager">
|
|
6
|
-
<field name="name">contract.terminate.reason access manager</field>
|
|
7
|
-
<field name="model_id" ref="model_contract_terminate_reason" />
|
|
8
|
-
<field name="group_id" ref="account.group_account_manager" />
|
|
9
|
-
<field name="perm_read" eval="1" />
|
|
10
|
-
<field name="perm_create" eval="1" />
|
|
11
|
-
<field name="perm_write" eval="1" />
|
|
12
|
-
<field name="perm_unlink" eval="1" />
|
|
13
|
-
</record>
|
|
14
|
-
<record model="ir.model.access" id="contract_terminate_reason_access_user">
|
|
15
|
-
<field name="name">contract.terminate.reason access user</field>
|
|
16
|
-
<field name="model_id" ref="model_contract_terminate_reason" />
|
|
17
|
-
<field name="group_id" ref="account.group_account_invoice" />
|
|
18
|
-
<field name="perm_read" eval="1" />
|
|
19
|
-
<field name="perm_create" eval="1" />
|
|
20
|
-
<field name="perm_write" eval="1" />
|
|
21
|
-
<field name="perm_unlink" eval="1" />
|
|
22
|
-
</record>
|
|
23
|
-
</odoo>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
|
-
<!-- Copyright 2020 ACSONE SA/NV
|
|
3
|
-
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
|
4
|
-
<odoo>
|
|
5
|
-
<record id="can_terminate_contract" model="res.groups">
|
|
6
|
-
<field name="name">Contract: Can Terminate Contracts</field>
|
|
7
|
-
<field name="implied_ids" eval="[(4, ref('account.group_account_invoice'))]" />
|
|
8
|
-
</record>
|
|
9
|
-
</odoo>
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
|
-
<odoo>
|
|
3
|
-
<!--FORM view-->
|
|
4
|
-
<record id="contract_abstract_contract_line_form_view" model="ir.ui.view">
|
|
5
|
-
<field
|
|
6
|
-
name="name"
|
|
7
|
-
>contract.abstract.contract.line form view (in contract)</field>
|
|
8
|
-
<field name="model">contract.abstract.contract.line</field>
|
|
9
|
-
<field name="arch" type="xml">
|
|
10
|
-
<form>
|
|
11
|
-
<field name="display_type" invisible="1" />
|
|
12
|
-
<header invisible="display_type" />
|
|
13
|
-
<sheet>
|
|
14
|
-
<field name="specific_price" invisible="1" />
|
|
15
|
-
<field name="currency_id" invisible="1" />
|
|
16
|
-
<field colspan="1" name="product_uom_category_id" invisible="1" />
|
|
17
|
-
<group>
|
|
18
|
-
<field
|
|
19
|
-
name="product_id"
|
|
20
|
-
required="display_type == 'product'"
|
|
21
|
-
invisible="display_type"
|
|
22
|
-
/>
|
|
23
|
-
</group>
|
|
24
|
-
<group invisible="display_type">
|
|
25
|
-
<group>
|
|
26
|
-
<field name="automatic_price" />
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<field name="price_unit" readonly="automatic_price" />
|
|
30
|
-
<field name="quantity" />
|
|
31
|
-
</group>
|
|
32
|
-
<group>
|
|
33
|
-
<field
|
|
34
|
-
name="uom_id"
|
|
35
|
-
groups="uom.group_uom"
|
|
36
|
-
required="not display_type"
|
|
37
|
-
/>
|
|
38
|
-
<field
|
|
39
|
-
name="discount"
|
|
40
|
-
groups="product.group_discount_per_so_line"
|
|
41
|
-
/>
|
|
42
|
-
<field name="price_subtotal" readonly="1" />
|
|
43
|
-
</group>
|
|
44
|
-
</group>
|
|
45
|
-
<label for="name" string="Description" invisible="display_type" />
|
|
46
|
-
<label
|
|
47
|
-
for="name"
|
|
48
|
-
string="Section"
|
|
49
|
-
invisible="display_type != 'line_section'"
|
|
50
|
-
/>
|
|
51
|
-
<label
|
|
52
|
-
for="name"
|
|
53
|
-
string="Note"
|
|
54
|
-
invisible="display_type != 'line_note'"
|
|
55
|
-
/>
|
|
56
|
-
<field name="name" nolabel="1" />
|
|
57
|
-
<group
|
|
58
|
-
name="note_invoicing_mode"
|
|
59
|
-
invisible="display_type != 'line_note'"
|
|
60
|
-
>
|
|
61
|
-
<field name="note_invoicing_mode" widget="radio" />
|
|
62
|
-
</group>
|
|
63
|
-
<group invisible="display_type">
|
|
64
|
-
<field name="is_auto_renew" />
|
|
65
|
-
<field name="is_canceled" invisible="1" />
|
|
66
|
-
</group>
|
|
67
|
-
<group invisible="not is_auto_renew or display_type">
|
|
68
|
-
<group>
|
|
69
|
-
<label for="auto_renew_interval" />
|
|
70
|
-
<div class="o_row">
|
|
71
|
-
<field
|
|
72
|
-
name="auto_renew_interval"
|
|
73
|
-
class="oe_inline"
|
|
74
|
-
required="is_auto_renew"
|
|
75
|
-
/>
|
|
76
|
-
<field
|
|
77
|
-
name="auto_renew_rule_type"
|
|
78
|
-
class="oe_inline"
|
|
79
|
-
required="is_auto_renew"
|
|
80
|
-
/>
|
|
81
|
-
</div>
|
|
82
|
-
</group>
|
|
83
|
-
<group>
|
|
84
|
-
<label for="termination_notice_interval" />
|
|
85
|
-
<div class="o_row">
|
|
86
|
-
<field
|
|
87
|
-
name="termination_notice_interval"
|
|
88
|
-
class="oe_inline"
|
|
89
|
-
required="is_auto_renew"
|
|
90
|
-
/>
|
|
91
|
-
<field
|
|
92
|
-
name="termination_notice_rule_type"
|
|
93
|
-
class="oe_inline"
|
|
94
|
-
required="is_auto_renew"
|
|
95
|
-
/>
|
|
96
|
-
</div>
|
|
97
|
-
</group>
|
|
98
|
-
</group>
|
|
99
|
-
<group
|
|
100
|
-
name="recurrence_info"
|
|
101
|
-
invisible="display_type == 'line_section' or (display_type == 'line_note' and note_invoicing_mode != 'custom')"
|
|
102
|
-
>
|
|
103
|
-
<group>
|
|
104
|
-
<label for="recurring_interval" />
|
|
105
|
-
<div class="o_row">
|
|
106
|
-
<field name="recurring_interval" />
|
|
107
|
-
<field name="recurring_rule_type" />
|
|
108
|
-
</div>
|
|
109
|
-
<field name="recurring_invoicing_type" />
|
|
110
|
-
<field name="recurring_invoicing_offset" />
|
|
111
|
-
</group>
|
|
112
|
-
</group>
|
|
113
|
-
</sheet>
|
|
114
|
-
</form>
|
|
115
|
-
</field>
|
|
116
|
-
</record>
|
|
117
|
-
</odoo>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
|
-
<!-- Copyright 2020 ACSONE SA/NV
|
|
3
|
-
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
|
4
|
-
<odoo>
|
|
5
|
-
<record model="ir.ui.view" id="contract_terminate_reason_form_view">
|
|
6
|
-
<field name="model">contract.terminate.reason</field>
|
|
7
|
-
<field name="arch" type="xml">
|
|
8
|
-
<form>
|
|
9
|
-
<sheet>
|
|
10
|
-
<group>
|
|
11
|
-
<field name="name" />
|
|
12
|
-
<field name="terminate_comment_required" />
|
|
13
|
-
</group>
|
|
14
|
-
</sheet>
|
|
15
|
-
</form>
|
|
16
|
-
</field>
|
|
17
|
-
</record>
|
|
18
|
-
<record model="ir.ui.view" id="contract_terminate_reason_tree_view">
|
|
19
|
-
<field name="model">contract.terminate.reason</field>
|
|
20
|
-
<field name="arch" type="xml">
|
|
21
|
-
<tree>
|
|
22
|
-
<field name="name" />
|
|
23
|
-
<field name="terminate_comment_required" />
|
|
24
|
-
</tree>
|
|
25
|
-
</field>
|
|
26
|
-
</record>
|
|
27
|
-
<record model="ir.actions.act_window" id="contract_terminate_reason_act_window">
|
|
28
|
-
<field name="name">Contract Termination Reason</field>
|
|
29
|
-
<field name="res_model">contract.terminate.reason</field>
|
|
30
|
-
<field name="view_mode">tree,form</field>
|
|
31
|
-
</record>
|
|
32
|
-
<record model="ir.ui.menu" id="contract_terminate_reason_menu">
|
|
33
|
-
<field name="name">Contract Termination Reason</field>
|
|
34
|
-
<field name="parent_id" ref="menu_config_contract" />
|
|
35
|
-
<field name="action" ref="contract_terminate_reason_act_window" />
|
|
36
|
-
<field name="sequence" eval="16" />
|
|
37
|
-
</record>
|
|
38
|
-
</odoo>
|