@waron97/prbot 1.0.0 → 1.0.1
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.
- package/index.js +13 -0
- package/package.json +2 -1
- package/dotenv +0 -85908
- package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE - Relazioni mancanti: Fasi - Workflow e Fasi - Esiti Consentiti_2026-01-23 09:21:16.xml +0 -3122
- package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE - Relazioni mancanti: Fasi - Workflow e Fasi - Esiti Consentiti_2026-01-23 09:25:03.xml +0 -3122
- package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE - Relazioni mancanti: Fasi - Workflow e Fasi - Esiti Consentiti_2026-01-23 09:28:23.xml +0 -3122
- package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE - Relazioni mancanti: Fasi - Workflow e Fasi - Esiti Consentiti_2026-01-23 09:31:30.xml +0 -3122
- package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE - Relazioni mancanti: Fasi - Workflow e Fasi - Esiti Consentiti_2026-01-26 22:53:31.xml +0 -3170
- package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE - Relazioni mancanti: Fasi - Workflow e Fasi - Esiti Consentiti_2026-01-29 09:38:23.xml +0 -3170
- package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE_2026-01-23 09:21:17.xml +0 -4160
- package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE_2026-01-23 09:25:05.xml +0 -4160
- package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE_2026-01-23 09:28:25.xml +0 -4160
- package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE_2026-01-23 09:31:31.xml +0 -4160
- package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE_2026-01-26 22:53:34.xml +0 -4208
- package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE_2026-01-29 09:38:25.xml +0 -4208
- package/out/xml_data_for_ML - Taglio Colonna Gas per Morosit/303/240 - Relazioni mancanti: Fasi - Workflow e Fasi - Esiti Consentiti_2026-01-26 22:57:38.xml" +0 -2358
- package/out/xml_data_for_ML - Taglio Colonna Gas per Morosit/303/240_2026-01-26 22:57:40.xml" +0 -3667
|
@@ -1,3122 +0,0 @@
|
|
|
1
|
-
<odoo>
|
|
2
|
-
<data>
|
|
3
|
-
<record id="symple_triplet_phase_A1001_-_Apertura_Wizard_Risoluzione_contrattuale" model="symple.triplet.phase">
|
|
4
|
-
<field name="active">True</field>
|
|
5
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C1402_-_Annullamento_Risoluzione_contrattuale_E-CC01-0001'),ref('symple_triplet_phase_result_C1401_-_Risoluzione_contrattuale_OK_E-CC01-0002')])]"/>
|
|
6
|
-
<field name="allowed_process_ids" model="symple.pb.process" eval="[(6, 0, obj().search([('name','in',('ml_cessazioni_point_selection',)),]).ids)]" />
|
|
7
|
-
<field name="child_case">False</field>
|
|
8
|
-
<field name="code"># Available variables:
|
|
9
|
-
# - case_id: the case that just reached this phase
|
|
10
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
11
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
12
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
13
|
-
# - env: Odoo Environment on which the action is triggered
|
|
14
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
15
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
16
|
-
# - ValidationError: Warning Exception to use with raise
|
|
17
|
-
# - Command: x2Many commands namespace
|
|
18
|
-
# - OrderedDict: ordered dictionaries
|
|
19
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
20
|
-
# (line = case id, func = phase name)
|
|
21
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
22
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
23
|
-
# To return a result, assign: result = {...}
|
|
24
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
25
|
-
# phase result will not be set.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</field>
|
|
30
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','Customer Care')])" />
|
|
31
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
32
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
33
|
-
<field name="is_compute_refund">False</field>
|
|
34
|
-
<field name="is_dl">False</field>
|
|
35
|
-
<field name="is_needs_child_case">False</field>
|
|
36
|
-
<field name="is_pick_refund_template">False</field>
|
|
37
|
-
<field name="is_process_managed">True</field>
|
|
38
|
-
<field name="is_quote_accepted">False</field>
|
|
39
|
-
<field name="is_quote_sent">False</field>
|
|
40
|
-
<field name="is_timeout">False</field>
|
|
41
|
-
<field name="is_voidable">False</field>
|
|
42
|
-
<field name="name">A1001 - Apertura Wizard Risoluzione contrattuale</field>
|
|
43
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
44
|
-
<field name="is_externally_integrated">False</field>
|
|
45
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
46
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
47
|
-
<field name="phase_code">F-CC01-0001</field>
|
|
48
|
-
<field name="check_closed_child_tickets">False</field>
|
|
49
|
-
</record>
|
|
50
|
-
<record id="symple_triplet_phase_A1709_-_verifica_compatibilit_" model="symple.triplet.phase">
|
|
51
|
-
<field name="active">True</field>
|
|
52
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C404_-_KO_-_Incompatibile_E-CC01-0003'),ref('symple_triplet_phase_result_C2654_-_Processo_Compatibile_E-CC01-0004'),ref('symple_triplet_phase_result_C2639_-_Incompatibilit__Non_bloccante_E-CC01-0005')])]"/>
|
|
53
|
-
<field name="child_case">False</field>
|
|
54
|
-
<field name="code">def main():
|
|
55
|
-
service_point = case_id.service_point_ids[0]
|
|
56
|
-
billing_profile = service_point.billing_profile_id
|
|
57
|
-
asset = service_point.asset(active=False)
|
|
58
|
-
|
|
59
|
-
if not asset:
|
|
60
|
-
asset_id = False
|
|
61
|
-
else:
|
|
62
|
-
asset_id = asset._id
|
|
63
|
-
|
|
64
|
-
(result, incompatible_case_ids) = ( # "OK" | "KO" | "PARTIAL_KO" # List[int]
|
|
65
|
-
case_id.check_compatibility_matrix(
|
|
66
|
-
asset_id=asset_id,
|
|
67
|
-
client_id=case_id.customer_id.user_sequence,
|
|
68
|
-
billing_id=billing_profile.name,
|
|
69
|
-
# external_id -> default a case.ticket_type_id.univocal_code
|
|
70
|
-
)
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
if incompatible_case_ids:
|
|
74
|
-
case_id.write({"incompatible_ticket_ids": incompatible_case_ids})
|
|
75
|
-
|
|
76
|
-
if result in ["OK", "PARTIAL_KO"]:
|
|
77
|
-
case_id.create_matrix_process(
|
|
78
|
-
asset_id=asset_id,
|
|
79
|
-
client_id=case_id.customer_id.user_sequence,
|
|
80
|
-
billing_id=billing_profile.name,
|
|
81
|
-
# external_id -> default a case.ticket_type_id.univocal_code
|
|
82
|
-
)
|
|
83
|
-
|
|
84
|
-
return result
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
try:
|
|
88
|
-
result = main()
|
|
89
|
-
except Exception as e:
|
|
90
|
-
log(format_exc())
|
|
91
|
-
case_id.write({"error_message": str(e)})
|
|
92
|
-
</field>
|
|
93
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
94
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
95
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
96
|
-
<field name="is_compute_refund">False</field>
|
|
97
|
-
<field name="is_dl">False</field>
|
|
98
|
-
<field name="is_needs_child_case">False</field>
|
|
99
|
-
<field name="is_pick_refund_template">False</field>
|
|
100
|
-
<field name="is_process_managed">False</field>
|
|
101
|
-
<field name="is_quote_accepted">False</field>
|
|
102
|
-
<field name="is_quote_sent">False</field>
|
|
103
|
-
<field name="is_timeout">False</field>
|
|
104
|
-
<field name="is_voidable">False</field>
|
|
105
|
-
<field name="name">A1709 - verifica compatibilità</field>
|
|
106
|
-
<field name="set_result_automatically">from_code</field>
|
|
107
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
108
|
-
<field name="is_externally_integrated">False</field>
|
|
109
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
110
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
111
|
-
<field name="phase_code">F-CC01-0002</field>
|
|
112
|
-
<field name="check_closed_child_tickets">False</field>
|
|
113
|
-
</record>
|
|
114
|
-
<record id="symple_triplet_phase_A1710_-_Verifica_compatibilit__KO" model="symple.triplet.phase">
|
|
115
|
-
<field name="active">True</field>
|
|
116
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C2409_-_KO_Confermato_E-CC01-0006'),ref('symple_triplet_phase_result_C2410_-_OK_Incompatibilit__Gestita_E-CC01-0007')])]"/>
|
|
117
|
-
<field name="child_case">False</field>
|
|
118
|
-
<field name="code"># Available variables:
|
|
119
|
-
# - case_id: the case that just reached this phase
|
|
120
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
121
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
122
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
123
|
-
# - env: Odoo Environment on which the action is triggered
|
|
124
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
125
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
126
|
-
# - ValidationError: Warning Exception to use with raise
|
|
127
|
-
# - Command: x2Many commands namespace
|
|
128
|
-
# - OrderedDict: ordered dictionaries
|
|
129
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
130
|
-
# (line = case id, func = phase name)
|
|
131
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
132
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
133
|
-
# To return a result, assign: result = {...}
|
|
134
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
135
|
-
# phase result will not be set.
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
</field>
|
|
140
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','BOT')])" />
|
|
141
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
142
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
143
|
-
<field name="is_compute_refund">False</field>
|
|
144
|
-
<field name="is_dl">False</field>
|
|
145
|
-
<field name="is_needs_child_case">False</field>
|
|
146
|
-
<field name="is_pick_refund_template">False</field>
|
|
147
|
-
<field name="is_process_managed">False</field>
|
|
148
|
-
<field name="is_quote_accepted">False</field>
|
|
149
|
-
<field name="is_quote_sent">False</field>
|
|
150
|
-
<field name="is_timeout">False</field>
|
|
151
|
-
<field name="is_voidable">False</field>
|
|
152
|
-
<field name="name">A1710 - Verifica compatibilità KO</field>
|
|
153
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
154
|
-
<field name="is_externally_integrated">False</field>
|
|
155
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
156
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
157
|
-
<field name="phase_code">F-CC01-0003</field>
|
|
158
|
-
<field name="check_closed_child_tickets">False</field>
|
|
159
|
-
</record>
|
|
160
|
-
<record id="symple_triplet_phase_A1672_-_Recupero_dati_a_CRM" model="symple.triplet.phase">
|
|
161
|
-
<field name="active">True</field>
|
|
162
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C2365_-_Recupero_Dati_OK_E-CC01-0008'),ref('symple_triplet_phase_result_C1933_-_Recupero_Dati_KO_E-CC01-0009')])]"/>
|
|
163
|
-
<field name="child_case">False</field>
|
|
164
|
-
<field name="code"><![CDATA[# Available variables:
|
|
165
|
-
# - case_id: the case that just reached this phase
|
|
166
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
167
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
168
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
169
|
-
# - env: Odoo Environment on which the action is triggered
|
|
170
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
171
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
172
|
-
# - ValidationError: Warning Exception to use with raise
|
|
173
|
-
# - Command: x2Many commands namespace
|
|
174
|
-
# - OrderedDict: ordered dictionaries
|
|
175
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
176
|
-
# (line = case id, func = phase name)
|
|
177
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
178
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
179
|
-
# To return a result, assign: result = {...}
|
|
180
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
181
|
-
# phase result will not be set.
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
logs = []
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
def fmt(date):
|
|
188
|
-
return date.strftime("%d/%m/%Y")
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
def last_day_of_this_month():
|
|
192
|
-
today = datetime.datetime.today()
|
|
193
|
-
first_of_next_month = today.replace(day=1) + dateutil.relativedelta.relativedelta(
|
|
194
|
-
months=1
|
|
195
|
-
)
|
|
196
|
-
last_day = first_of_next_month - dateutil.relativedelta.relativedelta(days=1)
|
|
197
|
-
return last_day
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
def last_day_of_next_month():
|
|
201
|
-
today = datetime.datetime.today()
|
|
202
|
-
first_of_next_month = today.replace(day=1) + dateutil.relativedelta.relativedelta(
|
|
203
|
-
months=2
|
|
204
|
-
)
|
|
205
|
-
last_day = first_of_next_month - dateutil.relativedelta.relativedelta(days=1)
|
|
206
|
-
return last_day
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
def last_day_of_next_next_month():
|
|
210
|
-
today = datetime.datetime.today()
|
|
211
|
-
first_of_next_month = today.replace(day=1) + dateutil.relativedelta.relativedelta(
|
|
212
|
-
months=3
|
|
213
|
-
)
|
|
214
|
-
last_day = first_of_next_month - dateutil.relativedelta.relativedelta(days=1)
|
|
215
|
-
return last_day
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
def ten_days_from_now():
|
|
219
|
-
today = datetime.datetime.today()
|
|
220
|
-
return today + dateutil.relativedelta.relativedelta(days=10)
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
# ------------------------------------------------
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
def get_tipologia_risoluzione():
|
|
227
|
-
table = {
|
|
228
|
-
"CC01-1": ("CAE0", None),
|
|
229
|
-
"CC01-2": ("CAE0", None),
|
|
230
|
-
"CC02": ("CAE8", "CA7"),
|
|
231
|
-
"CC03-1": ("CAE5", "CA5"),
|
|
232
|
-
"CC04-1": ("CAE8", "CA4"),
|
|
233
|
-
"CC05-1": ("CAE2", "CA6"),
|
|
234
|
-
"CC06-1": ("CAE8", "CA7"),
|
|
235
|
-
"CC12-1": ("CAE1", "CA1"),
|
|
236
|
-
"CC13-1": ("CAE8", "CA7"),
|
|
237
|
-
"CC26-1": ("CAE7", "CA3"),
|
|
238
|
-
"CC27-1": ("CAE3", "CA2"),
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
code = case_id.ticket_type_id.code
|
|
242
|
-
|
|
243
|
-
if code not in table:
|
|
244
|
-
raise ValidationError(
|
|
245
|
-
"Non è possibile determinare la tipologia di risoluzione per il dettaglio {}".format(
|
|
246
|
-
code
|
|
247
|
-
)
|
|
248
|
-
)
|
|
249
|
-
|
|
250
|
-
power, gas = table.get(code)
|
|
251
|
-
|
|
252
|
-
sp = first(case_id.service_point_ids)
|
|
253
|
-
|
|
254
|
-
if sp.pod_id and power:
|
|
255
|
-
return power
|
|
256
|
-
|
|
257
|
-
if sp.pdr_id and gas:
|
|
258
|
-
return gas
|
|
259
|
-
|
|
260
|
-
raise ValidationError(
|
|
261
|
-
"Non è possibile determinare la tipologia di risoluzione per il dettaglio {}".format(
|
|
262
|
-
code
|
|
263
|
-
)
|
|
264
|
-
)
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
def get_data_decorrenza(tipologia_risoluzione):
|
|
268
|
-
today = datetime.datetime.today()
|
|
269
|
-
code = case_id.ticket_type_id.code
|
|
270
|
-
|
|
271
|
-
# -------- Special Case --------
|
|
272
|
-
|
|
273
|
-
if tipologia_risoluzione == "CA1":
|
|
274
|
-
return fmt(ten_days_from_now())
|
|
275
|
-
|
|
276
|
-
if tipologia_risoluzione in ["CA2", "CA3"]:
|
|
277
|
-
return fmt(last_day_of_next_next_month())
|
|
278
|
-
|
|
279
|
-
if (
|
|
280
|
-
tipologia_risoluzione == "CA4"
|
|
281
|
-
and code == "CC04-1"
|
|
282
|
-
and case_id.customer_id.customer_care_category == "pmi"
|
|
283
|
-
):
|
|
284
|
-
voltura_start_date = (
|
|
285
|
-
today # TODO get real voltura_start_date, don't yet know how
|
|
286
|
-
)
|
|
287
|
-
if voltura_start_date <= today:
|
|
288
|
-
if today.day <= 10:
|
|
289
|
-
return fmt(last_day_of_this_month())
|
|
290
|
-
return fmt(last_day_of_next_month())
|
|
291
|
-
else:
|
|
292
|
-
return fmt(voltura_start_date)
|
|
293
|
-
|
|
294
|
-
# -------- Default Case --------
|
|
295
|
-
|
|
296
|
-
if today.day <= 10:
|
|
297
|
-
return fmt(last_day_of_this_month())
|
|
298
|
-
return fmt(last_day_of_next_month())
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
# ------------------------------------------------
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
def main():
|
|
305
|
-
tipologia_risoluzione = get_tipologia_risoluzione()
|
|
306
|
-
|
|
307
|
-
kv_store = case_id.sudo().kv_store()
|
|
308
|
-
data_decorrenza = get_data_decorrenza(tipologia_risoluzione)
|
|
309
|
-
ifs_data = {
|
|
310
|
-
"tipologia_risoluzione": tipologia_risoluzione,
|
|
311
|
-
"data_decorrenza": data_decorrenza,
|
|
312
|
-
}
|
|
313
|
-
kv_store.sudo().set("ifs_data", ifs_data)
|
|
314
|
-
case_id.write(
|
|
315
|
-
{
|
|
316
|
-
"disconnect_date": datetime.datetime.strptime(
|
|
317
|
-
data_decorrenza, "%d/%m/%Y"
|
|
318
|
-
).date()
|
|
319
|
-
}
|
|
320
|
-
)
|
|
321
|
-
|
|
322
|
-
sp = first(case_id.service_point_ids)
|
|
323
|
-
asset = sp.asset(active=True) # solo sm_state attivo
|
|
324
|
-
|
|
325
|
-
if not asset:
|
|
326
|
-
raise Exception("Asset attivo non trovato per il punto {}".format(sp.code))
|
|
327
|
-
|
|
328
|
-
case_id.sudo().kv_store().set("asset", asset.data)
|
|
329
|
-
|
|
330
|
-
date_fmt = datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S.%f") + "Z"
|
|
331
|
-
|
|
332
|
-
sp.sudo().write({"state": "deactivating"})
|
|
333
|
-
env["ir.config_parameter"].update_b2w_statemodel(
|
|
334
|
-
"in_cessazione",
|
|
335
|
-
sm_reason=case_id.ticket_type_id.name,
|
|
336
|
-
expected_date=date_fmt,
|
|
337
|
-
asset_id=str(asset._id),
|
|
338
|
-
)
|
|
339
|
-
|
|
340
|
-
return "OK"
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
try:
|
|
344
|
-
result = main()
|
|
345
|
-
except Exception as e:
|
|
346
|
-
logs.append({"message": str(e), "traceback": format_exc()})
|
|
347
|
-
case_id.write(
|
|
348
|
-
{"error_message": "Errore durante l'esecuzione della fase: {}".format(str(e))}
|
|
349
|
-
)
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
if logs:
|
|
353
|
-
log(json_dumps(logs))]]></field>
|
|
354
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
355
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
356
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
357
|
-
<field name="is_compute_refund">False</field>
|
|
358
|
-
<field name="is_dl">False</field>
|
|
359
|
-
<field name="is_needs_child_case">False</field>
|
|
360
|
-
<field name="is_pick_refund_template">False</field>
|
|
361
|
-
<field name="is_process_managed">False</field>
|
|
362
|
-
<field name="is_quote_accepted">False</field>
|
|
363
|
-
<field name="is_quote_sent">False</field>
|
|
364
|
-
<field name="is_timeout">False</field>
|
|
365
|
-
<field name="is_voidable">False</field>
|
|
366
|
-
<field name="name">A1672 - Recupero dati a CRM</field>
|
|
367
|
-
<field name="set_result_automatically">from_code</field>
|
|
368
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
369
|
-
<field name="is_externally_integrated">False</field>
|
|
370
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
371
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
372
|
-
<field name="phase_code">F-CC01-0004</field>
|
|
373
|
-
<field name="check_closed_child_tickets">False</field>
|
|
374
|
-
</record>
|
|
375
|
-
<record id="symple_triplet_phase_A1323_-_Errore_CRM__Recupero_dati_" model="symple.triplet.phase">
|
|
376
|
-
<field name="active">True</field>
|
|
377
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C1616_-_Risoluzione_Errore_E-CC01-0010')])]"/>
|
|
378
|
-
<field name="child_case">False</field>
|
|
379
|
-
<field name="code"># Available variables:
|
|
380
|
-
# - case_id: the case that just reached this phase
|
|
381
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
382
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
383
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
384
|
-
# - env: Odoo Environment on which the action is triggered
|
|
385
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
386
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
387
|
-
# - ValidationError: Warning Exception to use with raise
|
|
388
|
-
# - Command: x2Many commands namespace
|
|
389
|
-
# - OrderedDict: ordered dictionaries
|
|
390
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
391
|
-
# (line = case id, func = phase name)
|
|
392
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
393
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
394
|
-
# To return a result, assign: result = {...}
|
|
395
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
396
|
-
# phase result will not be set.
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
</field>
|
|
401
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','AMS')])" />
|
|
402
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
403
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
404
|
-
<field name="is_compute_refund">False</field>
|
|
405
|
-
<field name="is_dl">False</field>
|
|
406
|
-
<field name="is_needs_child_case">False</field>
|
|
407
|
-
<field name="is_pick_refund_template">False</field>
|
|
408
|
-
<field name="is_process_managed">False</field>
|
|
409
|
-
<field name="is_quote_accepted">False</field>
|
|
410
|
-
<field name="is_quote_sent">False</field>
|
|
411
|
-
<field name="is_timeout">False</field>
|
|
412
|
-
<field name="is_voidable">False</field>
|
|
413
|
-
<field name="name">A1323 - Errore CRM (Recupero dati)</field>
|
|
414
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
415
|
-
<field name="is_externally_integrated">False</field>
|
|
416
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
417
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
418
|
-
<field name="phase_code">F-CC01-0005</field>
|
|
419
|
-
<field name="check_closed_child_tickets">False</field>
|
|
420
|
-
</record>
|
|
421
|
-
<record id="symple_triplet_phase_A1559_-_Invio_alla_Market_Communication" model="symple.triplet.phase">
|
|
422
|
-
<field name="active">True</field>
|
|
423
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C1019_-_Inviata_E-CC01-0011')])]"/>
|
|
424
|
-
<field name="child_case">False</field>
|
|
425
|
-
<field name="code"># Available variables:
|
|
426
|
-
# - case_id: the case that just reached this phase
|
|
427
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
428
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
429
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
430
|
-
# - env: Odoo Environment on which the action is triggered
|
|
431
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
432
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
433
|
-
# - ValidationError: Warning Exception to use with raise
|
|
434
|
-
# - Command: x2Many commands namespace
|
|
435
|
-
# - OrderedDict: ordered dictionaries
|
|
436
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
437
|
-
# (line = case id, func = phase name)
|
|
438
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
439
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
440
|
-
# To return a result, assign: result = {...}
|
|
441
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
442
|
-
# phase result will not be set.
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
logs = []
|
|
446
|
-
|
|
447
|
-
# ------------------------------
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
def get_addizione_regionale():
|
|
451
|
-
return case_id.service_point_ids[0].regional_surcharge_value
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
# ------------------------------
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
def get_resubmit_bindings():
|
|
458
|
-
return {
|
|
459
|
-
"helpdesk_ticket": {
|
|
460
|
-
"ids": [
|
|
461
|
-
case_id.id,
|
|
462
|
-
]
|
|
463
|
-
},
|
|
464
|
-
"billing_profile": {"ids": []},
|
|
465
|
-
"service_point": {"ids": []},
|
|
466
|
-
"res_partner_pod": {"ids": []},
|
|
467
|
-
"res_partner_pdr": {"ids": []},
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
def shared_data():
|
|
472
|
-
sp = case_id.service_point_ids
|
|
473
|
-
ifs_data = case_id.sudo().kv_store().get("ifs_data")
|
|
474
|
-
tipologia_risoluzione = ifs_data.get("tipologia_risoluzione")
|
|
475
|
-
|
|
476
|
-
return {
|
|
477
|
-
"COD_FLUSSO": "0050",
|
|
478
|
-
"PIVA": case_id.customer_id.numbers_only_vat or "",
|
|
479
|
-
"CF": case_id.customer_id.fiscal_code or "",
|
|
480
|
-
"CF_STRANIERO": "0",
|
|
481
|
-
"ALIQUOTA_IVA": (
|
|
482
|
-
sp.iva_rate if tipologia_risoluzione not in ["CAE1", "CA1"] else ""
|
|
483
|
-
),
|
|
484
|
-
"ALIQUOTA_ACCISE": "0" if tipologia_risoluzione not in ["CAE1", "CA1"] else "",
|
|
485
|
-
"ADDIZ_PROVINCIALE": (
|
|
486
|
-
"0" if tipologia_risoluzione not in ["CAE1", "CA1"] else ""
|
|
487
|
-
),
|
|
488
|
-
"ADDIZ_COMUNALE": "0" if tipologia_risoluzione not in ["CAE1", "CA1"] else "",
|
|
489
|
-
"TIPOLOGIA_RISOLUZIONE": tipologia_risoluzione,
|
|
490
|
-
"DATA_DECORRENZA": ifs_data.get("data_decorrenza"),
|
|
491
|
-
"OWNER": "SORGE",
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
# ------------------------------
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
def prep_rc1():
|
|
499
|
-
message = shared_data()
|
|
500
|
-
message.update(
|
|
501
|
-
{"COD_SERVIZIO": "RC1", "COD_POD": case_id.service_point_ids[0].pod_id.code}
|
|
502
|
-
)
|
|
503
|
-
return message
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
def _not_cae1_ca1(value, tipologia_risoluzione):
|
|
507
|
-
if tipologia_risoluzione in ["CAE1", "CA1"]:
|
|
508
|
-
return ""
|
|
509
|
-
return value
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
def prep_rcg1():
|
|
513
|
-
ifs_data = case_id.sudo().kv_store().get("ifs_data")
|
|
514
|
-
tipologia_risoluzione = ifs_data.get("tipologia_risoluzione")
|
|
515
|
-
message = shared_data()
|
|
516
|
-
is_person = not case_id.customer_id.is_company
|
|
517
|
-
is_ui = message["TIPOLOGIA_RISOLUZIONE"] != "CA4"
|
|
518
|
-
service_point = case_id.service_point_ids[0]
|
|
519
|
-
invoicing_address = service_point.billing_profile_id.invoicing_address_id
|
|
520
|
-
message.update(
|
|
521
|
-
{
|
|
522
|
-
"COD_SERVIZIO": "RCG1",
|
|
523
|
-
"COD_PDR": case_id.service_point_ids[0].pdr_id.code,
|
|
524
|
-
"MOTIVAZIONE": "Scelta commerciale Sorgenia",
|
|
525
|
-
"PRIORITA": "",
|
|
526
|
-
"ALTRE_INFORMAZIONI": "",
|
|
527
|
-
"NOME": _not_cae1_ca1(
|
|
528
|
-
case_id.customer_id.firstname if is_person else "",
|
|
529
|
-
tipologia_risoluzione,
|
|
530
|
-
),
|
|
531
|
-
"COGNOME": _not_cae1_ca1(
|
|
532
|
-
case_id.customer_id.lastname if is_person else "", tipologia_risoluzione
|
|
533
|
-
),
|
|
534
|
-
"EMAIL": _not_cae1_ca1(
|
|
535
|
-
case_id.customer_id.email or "", tipologia_risoluzione
|
|
536
|
-
),
|
|
537
|
-
"TELEFONO": _not_cae1_ca1(
|
|
538
|
-
case_id.customer_id.phone or "", tipologia_risoluzione
|
|
539
|
-
),
|
|
540
|
-
"ACCESSO_FUI": _not_cae1_ca1(
|
|
541
|
-
"SI" if message["TIPOLOGIA_RISOLUZIONE"] == "CA4" else "NO",
|
|
542
|
-
tipologia_risoluzione,
|
|
543
|
-
),
|
|
544
|
-
"UI_CF": _not_cae1_ca1(
|
|
545
|
-
case_id.customer_id.fiscal_code if is_ui else "", tipologia_risoluzione
|
|
546
|
-
),
|
|
547
|
-
"UI_PIVA": _not_cae1_ca1(
|
|
548
|
-
case_id.customer_id.vat if is_ui else "", tipologia_risoluzione
|
|
549
|
-
),
|
|
550
|
-
"UI_CF_STRANIERO": _not_cae1_ca1("", tipologia_risoluzione),
|
|
551
|
-
"UI_NOME": _not_cae1_ca1(
|
|
552
|
-
case_id.customer_id.firstname if is_ui and is_person else "",
|
|
553
|
-
tipologia_risoluzione,
|
|
554
|
-
),
|
|
555
|
-
"UI_COGNOME": _not_cae1_ca1(
|
|
556
|
-
case_id.customer_id.lastname if is_ui and is_person else "",
|
|
557
|
-
tipologia_risoluzione,
|
|
558
|
-
),
|
|
559
|
-
"UI_RAGIONE_SOCIALE_DENOMINAZIONE": _not_cae1_ca1(
|
|
560
|
-
case_id.customer_id.name if is_ui and not is_person else "",
|
|
561
|
-
tipologia_risoluzione,
|
|
562
|
-
),
|
|
563
|
-
"UI_EMAIL": _not_cae1_ca1(
|
|
564
|
-
case_id.customer_id.email or "" if is_ui else "", tipologia_risoluzione
|
|
565
|
-
),
|
|
566
|
-
"UI_TELEFONO": _not_cae1_ca1(
|
|
567
|
-
case_id.customer_id.phone or "" if is_ui else "", tipologia_risoluzione
|
|
568
|
-
),
|
|
569
|
-
"UI_AF_CF": _not_cae1_ca1("", tipologia_risoluzione),
|
|
570
|
-
"UI_AF_PIVA": _not_cae1_ca1("", tipologia_risoluzione),
|
|
571
|
-
"UI_AF_CF_STRANIERO": _not_cae1_ca1("", tipologia_risoluzione),
|
|
572
|
-
"UI_AF_NOME": _not_cae1_ca1("", tipologia_risoluzione),
|
|
573
|
-
"UI_AF_COGNOME": _not_cae1_ca1("", tipologia_risoluzione),
|
|
574
|
-
"UI_AF_RAGIONE_SOCIALE_DENOMINAZIONE": _not_cae1_ca1(
|
|
575
|
-
"", tipologia_risoluzione
|
|
576
|
-
),
|
|
577
|
-
"UI_FOR_TOPONIMO": _not_cae1_ca1(
|
|
578
|
-
service_point.service_toponym_id.name or "", tipologia_risoluzione
|
|
579
|
-
),
|
|
580
|
-
"UI_FOR_VIA": _not_cae1_ca1(
|
|
581
|
-
service_point.service_street or "", tipologia_risoluzione
|
|
582
|
-
),
|
|
583
|
-
"UI_FOR_CIV": _not_cae1_ca1(
|
|
584
|
-
service_point.service_street_number or "", tipologia_risoluzione
|
|
585
|
-
),
|
|
586
|
-
"UI_FOR_CAP": _not_cae1_ca1(
|
|
587
|
-
service_point.service_zip or "40100", tipologia_risoluzione
|
|
588
|
-
),
|
|
589
|
-
"UI_FOR_ISTAT": _not_cae1_ca1(
|
|
590
|
-
service_point.service_city_id.istat_code or "", tipologia_risoluzione
|
|
591
|
-
),
|
|
592
|
-
"UI_FOR_LOCALITA": _not_cae1_ca1(
|
|
593
|
-
service_point.service_city_id.name or "", tipologia_risoluzione
|
|
594
|
-
),
|
|
595
|
-
"UI_FOR_PROV": _not_cae1_ca1(
|
|
596
|
-
service_point.service_state_code or "", tipologia_risoluzione
|
|
597
|
-
),
|
|
598
|
-
"UI_FOR_NAZIONE": (
|
|
599
|
-
_not_cae1_ca1(
|
|
600
|
-
service_point.service_country_id.with_context(
|
|
601
|
-
lang="it_IT"
|
|
602
|
-
).name.upper(),
|
|
603
|
-
tipologia_risoluzione,
|
|
604
|
-
)
|
|
605
|
-
)
|
|
606
|
-
or "",
|
|
607
|
-
"UI_FOR_ALTRO": "",
|
|
608
|
-
"UI_ES_TOPONIMO": _not_cae1_ca1(
|
|
609
|
-
invoicing_address.toponym_id.name or "", tipologia_risoluzione
|
|
610
|
-
),
|
|
611
|
-
"UI_ES_VIA": _not_cae1_ca1(
|
|
612
|
-
invoicing_address.street or "", tipologia_risoluzione
|
|
613
|
-
),
|
|
614
|
-
"UI_ES_CIV": _not_cae1_ca1(
|
|
615
|
-
invoicing_address.street_num or "", tipologia_risoluzione
|
|
616
|
-
),
|
|
617
|
-
"UI_ES_CAP": _not_cae1_ca1(
|
|
618
|
-
invoicing_address.zip or "", tipologia_risoluzione
|
|
619
|
-
),
|
|
620
|
-
"UI_ES_ISTAT": _not_cae1_ca1(
|
|
621
|
-
invoicing_address.istat_code or "", tipologia_risoluzione
|
|
622
|
-
),
|
|
623
|
-
"UI_ES_LOCALITA": _not_cae1_ca1(
|
|
624
|
-
invoicing_address.city_id.name or "", tipologia_risoluzione
|
|
625
|
-
),
|
|
626
|
-
"UI_ES_PROV": _not_cae1_ca1(
|
|
627
|
-
invoicing_address.state_code or "", tipologia_risoluzione
|
|
628
|
-
),
|
|
629
|
-
"UI_ES_NAZIONE": _not_cae1_ca1(
|
|
630
|
-
invoicing_address.country_id.with_context(lang="it_IT").name.upper()
|
|
631
|
-
or "",
|
|
632
|
-
tipologia_risoluzione,
|
|
633
|
-
),
|
|
634
|
-
"UI_ES_ALTRO": _not_cae1_ca1("", tipologia_risoluzione),
|
|
635
|
-
"UI_CODICE_UFFICIO": service_point.billing_profile_id.office_code or "",
|
|
636
|
-
"UI_PAGAMENTO_IVA": "",
|
|
637
|
-
"SETT_MERCEOLOGICO": "",
|
|
638
|
-
"COD_RICHIESTA": "",
|
|
639
|
-
"ADDIZ_REGIONALE": (
|
|
640
|
-
get_addizione_regionale()
|
|
641
|
-
if message["TIPOLOGIA_RISOLUZIONE"] != "CA1"
|
|
642
|
-
else ""
|
|
643
|
-
),
|
|
644
|
-
}
|
|
645
|
-
)
|
|
646
|
-
return message
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
# ------------------------------
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
def main():
|
|
653
|
-
ifs_data_message = None
|
|
654
|
-
is_ele = case_id.service_point_ids[0].pod_id.exists()
|
|
655
|
-
|
|
656
|
-
if is_ele:
|
|
657
|
-
ifs_data_message = prep_rc1()
|
|
658
|
-
else:
|
|
659
|
-
ifs_data_message = prep_rcg1()
|
|
660
|
-
|
|
661
|
-
ifs_dict = {
|
|
662
|
-
"ifs_code": "RC1" if is_ele else "RCG1",
|
|
663
|
-
"case_id": str(case_id.id),
|
|
664
|
-
"entity_bindings_resubmit": get_resubmit_bindings(),
|
|
665
|
-
"ifs_data_message": ifs_data_message,
|
|
666
|
-
}
|
|
667
|
-
ifs_json = json_dumps(ifs_dict)
|
|
668
|
-
tenant_id = env["ir.config_parameter"].sudo().get_param("m2c_header_tenant_id")
|
|
669
|
-
org_token = env["ir.config_parameter"].sudo().get_param("m2c_header_org_token")
|
|
670
|
-
headers = {"tenantId": tenant_id, "orgToken": org_token}
|
|
671
|
-
btw_url = "http://b2w-symphony-rest-service/api/symphony/process-instances/ml_IFS_passthrough"
|
|
672
|
-
response = request("POST", btw_url, headers=headers, data=ifs_json)
|
|
673
|
-
|
|
674
|
-
if str(response.status_code) != "200":
|
|
675
|
-
raise ValidationError(str(response.status_code) + " " + str(response.text))
|
|
676
|
-
|
|
677
|
-
return "OK"
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
try:
|
|
681
|
-
result = main()
|
|
682
|
-
except Exception as e:
|
|
683
|
-
logs.append({"message": str(e), "traceback": format_exc()})
|
|
684
|
-
prev = case_id.info_message + "\n" if case_id.info_message else ""
|
|
685
|
-
case_id.write({"info_message": prev + str(e)})
|
|
686
|
-
|
|
687
|
-
result = "KO"
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
if logs:
|
|
691
|
-
log(json_dumps(logs))</field>
|
|
692
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
693
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
694
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
695
|
-
<field name="is_compute_refund">False</field>
|
|
696
|
-
<field name="is_dl">False</field>
|
|
697
|
-
<field name="is_needs_child_case">False</field>
|
|
698
|
-
<field name="is_pick_refund_template">False</field>
|
|
699
|
-
<field name="is_process_managed">False</field>
|
|
700
|
-
<field name="is_quote_accepted">False</field>
|
|
701
|
-
<field name="is_quote_sent">False</field>
|
|
702
|
-
<field name="is_timeout">False</field>
|
|
703
|
-
<field name="is_voidable">False</field>
|
|
704
|
-
<field name="name">A1559 - Invio alla Market Communication</field>
|
|
705
|
-
<field name="set_result_automatically">from_code</field>
|
|
706
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
707
|
-
<field name="is_externally_integrated">False</field>
|
|
708
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
709
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
710
|
-
<field name="phase_code">F-CC01-0006</field>
|
|
711
|
-
<field name="check_closed_child_tickets">False</field>
|
|
712
|
-
</record>
|
|
713
|
-
<record id="symple_triplet_phase_A1715_-_In_attesa_check_IFS" model="symple.triplet.phase">
|
|
714
|
-
<field name="active">True</field>
|
|
715
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C2225_-_KO_-_Ammissibilit__Hub_E-CC01-0012'),ref('symple_triplet_phase_result_C2224_-_OK_-_Ammissibilit__Hub_E-CC01-0013')])]"/>
|
|
716
|
-
<field name="child_case">False</field>
|
|
717
|
-
<field name="code"># Available variables:
|
|
718
|
-
# - case_id: the case that just reached this phase
|
|
719
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
720
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
721
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
722
|
-
# - env: Odoo Environment on which the action is triggered
|
|
723
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
724
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
725
|
-
# - ValidationError: Warning Exception to use with raise
|
|
726
|
-
# - Command: x2Many commands namespace
|
|
727
|
-
# - OrderedDict: ordered dictionaries
|
|
728
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
729
|
-
# (line = case id, func = phase name)
|
|
730
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
731
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
732
|
-
# To return a result, assign: result = {...}
|
|
733
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
734
|
-
# phase result will not be set.
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
</field>
|
|
739
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
740
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
741
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
742
|
-
<field name="is_compute_refund">False</field>
|
|
743
|
-
<field name="is_dl">False</field>
|
|
744
|
-
<field name="is_needs_child_case">False</field>
|
|
745
|
-
<field name="is_pick_refund_template">False</field>
|
|
746
|
-
<field name="is_process_managed">False</field>
|
|
747
|
-
<field name="is_quote_accepted">False</field>
|
|
748
|
-
<field name="is_quote_sent">False</field>
|
|
749
|
-
<field name="is_timeout">False</field>
|
|
750
|
-
<field name="is_voidable">False</field>
|
|
751
|
-
<field name="name">A1715 - In attesa check IFS</field>
|
|
752
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
753
|
-
<field name="is_externally_integrated">False</field>
|
|
754
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
755
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
756
|
-
<field name="phase_code">F-CC01-0007</field>
|
|
757
|
-
<field name="check_closed_child_tickets">False</field>
|
|
758
|
-
</record>
|
|
759
|
-
<record id="symple_triplet_phase_A1717_-_Gestione_scarti_da_cruscotto" model="symple.triplet.phase">
|
|
760
|
-
<field name="active">True</field>
|
|
761
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C2416_-_risottomessa_da_cruscotto_E-CC01-0015'),ref('symple_triplet_phase_result_C1931_-_Errore_non_rilavorabile_E-CC01-0016'),ref('symple_triplet_phase_result_C1763_-_Annullamento_passivo_dal_SII_E-CC01-0017')])]"/>
|
|
762
|
-
<field name="child_case">False</field>
|
|
763
|
-
<field name="code"># Available variables:
|
|
764
|
-
# - case_id: the case that just reached this phase
|
|
765
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
766
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
767
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
768
|
-
# - env: Odoo Environment on which the action is triggered
|
|
769
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
770
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
771
|
-
# - ValidationError: Warning Exception to use with raise
|
|
772
|
-
# - Command: x2Many commands namespace
|
|
773
|
-
# - OrderedDict: ordered dictionaries
|
|
774
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
775
|
-
# (line = case id, func = phase name)
|
|
776
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
777
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
778
|
-
# To return a result, assign: result = {...}
|
|
779
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
780
|
-
# phase result will not be set.
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
</field>
|
|
785
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
786
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
787
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
788
|
-
<field name="is_compute_refund">False</field>
|
|
789
|
-
<field name="is_dl">False</field>
|
|
790
|
-
<field name="is_needs_child_case">False</field>
|
|
791
|
-
<field name="is_pick_refund_template">False</field>
|
|
792
|
-
<field name="is_process_managed">False</field>
|
|
793
|
-
<field name="is_quote_accepted">False</field>
|
|
794
|
-
<field name="is_quote_sent">False</field>
|
|
795
|
-
<field name="is_timeout">False</field>
|
|
796
|
-
<field name="is_voidable">False</field>
|
|
797
|
-
<field name="name">A1717 - Gestione scarti da cruscotto</field>
|
|
798
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
799
|
-
<field name="is_externally_integrated">False</field>
|
|
800
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
801
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
802
|
-
<field name="phase_code">F-CC01-0008</field>
|
|
803
|
-
<field name="check_closed_child_tickets">False</field>
|
|
804
|
-
</record>
|
|
805
|
-
<record id="symple_triplet_phase_A2558_-_verifica_avvio_gestione_manuale" model="symple.triplet.phase">
|
|
806
|
-
<field name="active">True</field>
|
|
807
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C2598_-_gestione_manuale_E-CC01-0018'),ref('symple_triplet_phase_result_C2509_-_Da_gestire_nuovo_invio_automatico_E-CC01-0019')])]"/>
|
|
808
|
-
<field name="child_case">False</field>
|
|
809
|
-
<field name="code"># Available variables:
|
|
810
|
-
# - case_id: the case that just reached this phase
|
|
811
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
812
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
813
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
814
|
-
# - env: Odoo Environment on which the action is triggered
|
|
815
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
816
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
817
|
-
# - ValidationError: Warning Exception to use with raise
|
|
818
|
-
# - Command: x2Many commands namespace
|
|
819
|
-
# - OrderedDict: ordered dictionaries
|
|
820
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
821
|
-
# (line = case id, func = phase name)
|
|
822
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
823
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
824
|
-
# To return a result, assign: result = {...}
|
|
825
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
826
|
-
# phase result will not be set.
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
</field>
|
|
831
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','BOT')])" />
|
|
832
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
833
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
834
|
-
<field name="is_compute_refund">False</field>
|
|
835
|
-
<field name="is_dl">False</field>
|
|
836
|
-
<field name="is_needs_child_case">False</field>
|
|
837
|
-
<field name="is_pick_refund_template">False</field>
|
|
838
|
-
<field name="is_process_managed">False</field>
|
|
839
|
-
<field name="is_quote_accepted">False</field>
|
|
840
|
-
<field name="is_quote_sent">False</field>
|
|
841
|
-
<field name="is_timeout">False</field>
|
|
842
|
-
<field name="is_voidable">False</field>
|
|
843
|
-
<field name="name">A2558 - verifica avvio gestione manuale</field>
|
|
844
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
845
|
-
<field name="is_externally_integrated">False</field>
|
|
846
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
847
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
848
|
-
<field name="phase_code">F-CC01-0009</field>
|
|
849
|
-
<field name="check_closed_child_tickets">False</field>
|
|
850
|
-
</record>
|
|
851
|
-
<record id="symple_triplet_phase_A1879_-_Invio_alla_Market_Comm_Forzato" model="symple.triplet.phase">
|
|
852
|
-
<field name="active">True</field>
|
|
853
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C1019_-_Inviata_E-CC01-0020')])]"/>
|
|
854
|
-
<field name="child_case">False</field>
|
|
855
|
-
<field name="code"># Available variables:
|
|
856
|
-
# - case_id: the case that just reached this phase
|
|
857
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
858
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
859
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
860
|
-
# - env: Odoo Environment on which the action is triggered
|
|
861
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
862
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
863
|
-
# - ValidationError: Warning Exception to use with raise
|
|
864
|
-
# - Command: x2Many commands namespace
|
|
865
|
-
# - OrderedDict: ordered dictionaries
|
|
866
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
867
|
-
# (line = case id, func = phase name)
|
|
868
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
869
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
870
|
-
# To return a result, assign: result = {...}
|
|
871
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
872
|
-
# phase result will not be set.
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
logs = []
|
|
876
|
-
|
|
877
|
-
# ------------------------------
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
def get_addizione_regionale():
|
|
881
|
-
return case_id.service_point_ids[0].regional_surcharge_value
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
# ------------------------------
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
def get_resubmit_bindings():
|
|
888
|
-
return {
|
|
889
|
-
"helpdesk_ticket": {
|
|
890
|
-
"ids": [
|
|
891
|
-
case_id.id,
|
|
892
|
-
]
|
|
893
|
-
},
|
|
894
|
-
"billing_profile": {"ids": []},
|
|
895
|
-
"service_point": {"ids": []},
|
|
896
|
-
"res_partner_pod": {"ids": []},
|
|
897
|
-
"res_partner_pdr": {"ids": []},
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
def shared_data():
|
|
902
|
-
sp = case_id.service_point_ids
|
|
903
|
-
ifs_data = case_id.sudo().kv_store().get("ifs_data")
|
|
904
|
-
tipologia_risoluzione = ifs_data.get("tipologia_risoluzione")
|
|
905
|
-
|
|
906
|
-
return {
|
|
907
|
-
"COD_FLUSSO": "0050",
|
|
908
|
-
"PIVA": case_id.customer_id.numbers_only_vat or "",
|
|
909
|
-
"CF": case_id.customer_id.fiscal_code or "",
|
|
910
|
-
"CF_STRANIERO": "0",
|
|
911
|
-
"ALIQUOTA_IVA": (
|
|
912
|
-
sp.iva_rate if tipologia_risoluzione not in ["CAE1", "CA1"] else ""
|
|
913
|
-
),
|
|
914
|
-
"ALIQUOTA_ACCISE": "0" if tipologia_risoluzione not in ["CAE1", "CA1"] else "",
|
|
915
|
-
"ADDIZ_PROVINCIALE": (
|
|
916
|
-
"0" if tipologia_risoluzione not in ["CAE1", "CA1"] else ""
|
|
917
|
-
),
|
|
918
|
-
"ADDIZ_COMUNALE": "0" if tipologia_risoluzione not in ["CAE1", "CA1"] else "",
|
|
919
|
-
"TIPOLOGIA_RISOLUZIONE": tipologia_risoluzione,
|
|
920
|
-
"DATA_DECORRENZA": ifs_data.get("data_decorrenza"),
|
|
921
|
-
"OWNER": "SORGE",
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
# ------------------------------
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
def prep_rc1():
|
|
929
|
-
message = shared_data()
|
|
930
|
-
message.update(
|
|
931
|
-
{
|
|
932
|
-
"COD_SERVIZIO": "RC1",
|
|
933
|
-
"COD_POD": case_id.service_point_ids[0].pod_id.code,
|
|
934
|
-
"bypass": True,
|
|
935
|
-
}
|
|
936
|
-
)
|
|
937
|
-
return message
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
def _not_cae1_ca1(value, tipologia_risoluzione):
|
|
941
|
-
if tipologia_risoluzione in ["CAE1", "CA1"]:
|
|
942
|
-
return ""
|
|
943
|
-
return value
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
def prep_rcg1():
|
|
947
|
-
ifs_data = case_id.sudo().kv_store().get("ifs_data")
|
|
948
|
-
tipologia_risoluzione = ifs_data.get("tipologia_risoluzione")
|
|
949
|
-
message = shared_data()
|
|
950
|
-
is_person = not case_id.customer_id.is_company
|
|
951
|
-
is_ui = message["TIPOLOGIA_RISOLUZIONE"] != "CA4"
|
|
952
|
-
service_point = case_id.service_point_ids[0]
|
|
953
|
-
invoicing_address = service_point.billing_profile_id.invoicing_address_id
|
|
954
|
-
message.update(
|
|
955
|
-
{
|
|
956
|
-
"COD_SERVIZIO": "RCG1",
|
|
957
|
-
"COD_PDR": case_id.service_point_ids[0].pdr_id.code,
|
|
958
|
-
"MOTIVAZIONE": "Scelta commerciale Sorgenia",
|
|
959
|
-
"PRIORITA": "",
|
|
960
|
-
"ALTRE_INFORMAZIONI": "",
|
|
961
|
-
"NOME": _not_cae1_ca1(
|
|
962
|
-
case_id.customer_id.firstname if is_person else "",
|
|
963
|
-
tipologia_risoluzione,
|
|
964
|
-
),
|
|
965
|
-
"COGNOME": _not_cae1_ca1(
|
|
966
|
-
case_id.customer_id.lastname if is_person else "", tipologia_risoluzione
|
|
967
|
-
),
|
|
968
|
-
"EMAIL": _not_cae1_ca1(
|
|
969
|
-
case_id.customer_id.email or "", tipologia_risoluzione
|
|
970
|
-
),
|
|
971
|
-
"TELEFONO": _not_cae1_ca1(
|
|
972
|
-
case_id.customer_id.phone or "", tipologia_risoluzione
|
|
973
|
-
),
|
|
974
|
-
"ACCESSO_FUI": _not_cae1_ca1(
|
|
975
|
-
"SI" if message["TIPOLOGIA_RISOLUZIONE"] == "CA4" else "NO",
|
|
976
|
-
tipologia_risoluzione,
|
|
977
|
-
),
|
|
978
|
-
"UI_CF": _not_cae1_ca1(
|
|
979
|
-
case_id.customer_id.fiscal_code if is_ui else "", tipologia_risoluzione
|
|
980
|
-
),
|
|
981
|
-
"UI_PIVA": _not_cae1_ca1(
|
|
982
|
-
case_id.customer_id.vat if is_ui else "", tipologia_risoluzione
|
|
983
|
-
),
|
|
984
|
-
"UI_CF_STRANIERO": _not_cae1_ca1("", tipologia_risoluzione),
|
|
985
|
-
"UI_NOME": _not_cae1_ca1(
|
|
986
|
-
case_id.customer_id.firstname if is_ui and is_person else "",
|
|
987
|
-
tipologia_risoluzione,
|
|
988
|
-
),
|
|
989
|
-
"UI_COGNOME": _not_cae1_ca1(
|
|
990
|
-
case_id.customer_id.lastname if is_ui and is_person else "",
|
|
991
|
-
tipologia_risoluzione,
|
|
992
|
-
),
|
|
993
|
-
"UI_RAGIONE_SOCIALE_DENOMINAZIONE": _not_cae1_ca1(
|
|
994
|
-
case_id.customer_id.name if is_ui and not is_person else "",
|
|
995
|
-
tipologia_risoluzione,
|
|
996
|
-
),
|
|
997
|
-
"UI_EMAIL": _not_cae1_ca1(
|
|
998
|
-
case_id.customer_id.email or "" if is_ui else "", tipologia_risoluzione
|
|
999
|
-
),
|
|
1000
|
-
"UI_TELEFONO": _not_cae1_ca1(
|
|
1001
|
-
case_id.customer_id.phone or "" if is_ui else "", tipologia_risoluzione
|
|
1002
|
-
),
|
|
1003
|
-
"UI_AF_CF": _not_cae1_ca1("", tipologia_risoluzione),
|
|
1004
|
-
"UI_AF_PIVA": _not_cae1_ca1("", tipologia_risoluzione),
|
|
1005
|
-
"UI_AF_CF_STRANIERO": _not_cae1_ca1("", tipologia_risoluzione),
|
|
1006
|
-
"UI_AF_NOME": _not_cae1_ca1("", tipologia_risoluzione),
|
|
1007
|
-
"UI_AF_COGNOME": _not_cae1_ca1("", tipologia_risoluzione),
|
|
1008
|
-
"UI_AF_RAGIONE_SOCIALE_DENOMINAZIONE": _not_cae1_ca1(
|
|
1009
|
-
"", tipologia_risoluzione
|
|
1010
|
-
),
|
|
1011
|
-
"UI_FOR_TOPONIMO": _not_cae1_ca1(
|
|
1012
|
-
service_point.service_toponym_id.name or "", tipologia_risoluzione
|
|
1013
|
-
),
|
|
1014
|
-
"UI_FOR_VIA": _not_cae1_ca1(
|
|
1015
|
-
service_point.service_street or "", tipologia_risoluzione
|
|
1016
|
-
),
|
|
1017
|
-
"UI_FOR_CIV": _not_cae1_ca1(
|
|
1018
|
-
service_point.service_street_number or "", tipologia_risoluzione
|
|
1019
|
-
),
|
|
1020
|
-
"UI_FOR_CAP": _not_cae1_ca1(
|
|
1021
|
-
service_point.service_zip or "40100", tipologia_risoluzione
|
|
1022
|
-
),
|
|
1023
|
-
"UI_FOR_ISTAT": _not_cae1_ca1(
|
|
1024
|
-
service_point.service_city_id.istat_code or "", tipologia_risoluzione
|
|
1025
|
-
),
|
|
1026
|
-
"UI_FOR_LOCALITA": _not_cae1_ca1(
|
|
1027
|
-
service_point.service_city_id.name or "", tipologia_risoluzione
|
|
1028
|
-
),
|
|
1029
|
-
"UI_FOR_PROV": _not_cae1_ca1(
|
|
1030
|
-
service_point.service_state_code or "", tipologia_risoluzione
|
|
1031
|
-
),
|
|
1032
|
-
"UI_FOR_NAZIONE": (
|
|
1033
|
-
_not_cae1_ca1(
|
|
1034
|
-
service_point.service_country_id.with_context(
|
|
1035
|
-
lang="it_IT"
|
|
1036
|
-
).name.upper(),
|
|
1037
|
-
tipologia_risoluzione,
|
|
1038
|
-
)
|
|
1039
|
-
)
|
|
1040
|
-
or "",
|
|
1041
|
-
"UI_FOR_ALTRO": "",
|
|
1042
|
-
"UI_ES_TOPONIMO": _not_cae1_ca1(
|
|
1043
|
-
invoicing_address.toponym_id.name or "", tipologia_risoluzione
|
|
1044
|
-
),
|
|
1045
|
-
"UI_ES_VIA": _not_cae1_ca1(
|
|
1046
|
-
invoicing_address.street or "", tipologia_risoluzione
|
|
1047
|
-
),
|
|
1048
|
-
"UI_ES_CIV": _not_cae1_ca1(
|
|
1049
|
-
invoicing_address.street_num or "", tipologia_risoluzione
|
|
1050
|
-
),
|
|
1051
|
-
"UI_ES_CAP": _not_cae1_ca1(
|
|
1052
|
-
invoicing_address.zip or "", tipologia_risoluzione
|
|
1053
|
-
),
|
|
1054
|
-
"UI_ES_ISTAT": _not_cae1_ca1(
|
|
1055
|
-
invoicing_address.istat_code or "", tipologia_risoluzione
|
|
1056
|
-
),
|
|
1057
|
-
"UI_ES_LOCALITA": _not_cae1_ca1(
|
|
1058
|
-
invoicing_address.city_id.name or "", tipologia_risoluzione
|
|
1059
|
-
),
|
|
1060
|
-
"UI_ES_PROV": _not_cae1_ca1(
|
|
1061
|
-
invoicing_address.state_code or "", tipologia_risoluzione
|
|
1062
|
-
),
|
|
1063
|
-
"UI_ES_NAZIONE": _not_cae1_ca1(
|
|
1064
|
-
invoicing_address.country_id.with_context(lang="it_IT").name.upper()
|
|
1065
|
-
or "",
|
|
1066
|
-
tipologia_risoluzione,
|
|
1067
|
-
),
|
|
1068
|
-
"UI_ES_ALTRO": _not_cae1_ca1("", tipologia_risoluzione),
|
|
1069
|
-
"UI_CODICE_UFFICIO": service_point.billing_profile_id.office_code or "",
|
|
1070
|
-
"UI_PAGAMENTO_IVA": "",
|
|
1071
|
-
"SETT_MERCEOLOGICO": "",
|
|
1072
|
-
"COD_RICHIESTA": "",
|
|
1073
|
-
"ADDIZ_REGIONALE": (
|
|
1074
|
-
get_addizione_regionale()
|
|
1075
|
-
if message["TIPOLOGIA_RISOLUZIONE"] != "CA1"
|
|
1076
|
-
else ""
|
|
1077
|
-
),
|
|
1078
|
-
"bypass": True,
|
|
1079
|
-
}
|
|
1080
|
-
)
|
|
1081
|
-
return message
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
# ------------------------------
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
def main():
|
|
1088
|
-
ifs_data_message = None
|
|
1089
|
-
is_ele = case_id.service_point_ids[0].pod_id.exists()
|
|
1090
|
-
|
|
1091
|
-
if is_ele:
|
|
1092
|
-
ifs_data_message = prep_rc1()
|
|
1093
|
-
else:
|
|
1094
|
-
ifs_data_message = prep_rcg1()
|
|
1095
|
-
|
|
1096
|
-
ifs_dict = {
|
|
1097
|
-
"ifs_code": "RC1" if is_ele else "RCG1",
|
|
1098
|
-
"case_id": str(case_id.id),
|
|
1099
|
-
"entity_bindings_resubmit": get_resubmit_bindings(),
|
|
1100
|
-
"ifs_data_message": ifs_data_message,
|
|
1101
|
-
}
|
|
1102
|
-
ifs_json = json_dumps(ifs_dict)
|
|
1103
|
-
tenant_id = env["ir.config_parameter"].sudo().get_param("m2c_header_tenant_id")
|
|
1104
|
-
org_token = env["ir.config_parameter"].sudo().get_param("m2c_header_org_token")
|
|
1105
|
-
headers = {"tenantId": tenant_id, "orgToken": org_token}
|
|
1106
|
-
btw_url = "http://b2w-symphony-rest-service/api/symphony/process-instances/ml_IFS_passthrough"
|
|
1107
|
-
response = request("POST", btw_url, headers=headers, data=ifs_json)
|
|
1108
|
-
|
|
1109
|
-
if str(response.status_code) != "200":
|
|
1110
|
-
raise ValidationError(str(response.status_code) + " " + str(response.text))
|
|
1111
|
-
|
|
1112
|
-
return "OK"
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
try:
|
|
1116
|
-
result = main()
|
|
1117
|
-
except Exception as e:
|
|
1118
|
-
logs.append({"message": str(e), "traceback": format_exc()})
|
|
1119
|
-
prev = case_id.info_message + "\n" if case_id.info_message else ""
|
|
1120
|
-
case_id.write({"info_message": prev + str(e)})
|
|
1121
|
-
|
|
1122
|
-
result = "KO"
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
if logs:
|
|
1126
|
-
log(json_dumps(logs))</field>
|
|
1127
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
1128
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
1129
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
1130
|
-
<field name="is_compute_refund">False</field>
|
|
1131
|
-
<field name="is_dl">False</field>
|
|
1132
|
-
<field name="is_needs_child_case">False</field>
|
|
1133
|
-
<field name="is_pick_refund_template">False</field>
|
|
1134
|
-
<field name="is_process_managed">False</field>
|
|
1135
|
-
<field name="is_quote_accepted">False</field>
|
|
1136
|
-
<field name="is_quote_sent">False</field>
|
|
1137
|
-
<field name="is_timeout">False</field>
|
|
1138
|
-
<field name="is_voidable">False</field>
|
|
1139
|
-
<field name="name">A1879 - Invio alla Market Comm Forzato</field>
|
|
1140
|
-
<field name="set_result_automatically">from_code</field>
|
|
1141
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
1142
|
-
<field name="is_externally_integrated">False</field>
|
|
1143
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
1144
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
1145
|
-
<field name="phase_code">F-CC01-0010</field>
|
|
1146
|
-
<field name="check_closed_child_tickets">False</field>
|
|
1147
|
-
</record>
|
|
1148
|
-
<record id="symple_triplet_phase_A1806_-_In_Attesa_Check_HUB_Forzato" model="symple.triplet.phase">
|
|
1149
|
-
<field name="active">True</field>
|
|
1150
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C2225_-_KO_-_Ammissibilit__Hub_E-CC01-0021'),ref('symple_triplet_phase_result_C2224_-_OK_-_Ammissibilit__Hub_E-CC01-0022')])]"/>
|
|
1151
|
-
<field name="child_case">False</field>
|
|
1152
|
-
<field name="code"># Available variables:
|
|
1153
|
-
# - case_id: the case that just reached this phase
|
|
1154
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
1155
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
1156
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
1157
|
-
# - env: Odoo Environment on which the action is triggered
|
|
1158
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
1159
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
1160
|
-
# - ValidationError: Warning Exception to use with raise
|
|
1161
|
-
# - Command: x2Many commands namespace
|
|
1162
|
-
# - OrderedDict: ordered dictionaries
|
|
1163
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
1164
|
-
# (line = case id, func = phase name)
|
|
1165
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
1166
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
1167
|
-
# To return a result, assign: result = {...}
|
|
1168
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
1169
|
-
# phase result will not be set.
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
</field>
|
|
1174
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
1175
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
1176
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
1177
|
-
<field name="is_compute_refund">False</field>
|
|
1178
|
-
<field name="is_dl">False</field>
|
|
1179
|
-
<field name="is_needs_child_case">False</field>
|
|
1180
|
-
<field name="is_pick_refund_template">False</field>
|
|
1181
|
-
<field name="is_process_managed">False</field>
|
|
1182
|
-
<field name="is_quote_accepted">False</field>
|
|
1183
|
-
<field name="is_quote_sent">False</field>
|
|
1184
|
-
<field name="is_timeout">False</field>
|
|
1185
|
-
<field name="is_voidable">False</field>
|
|
1186
|
-
<field name="name">A1806 - In Attesa Check HUB Forzato</field>
|
|
1187
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
1188
|
-
<field name="is_externally_integrated">False</field>
|
|
1189
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
1190
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
1191
|
-
<field name="phase_code">F-CC01-0011</field>
|
|
1192
|
-
<field name="check_closed_child_tickets">False</field>
|
|
1193
|
-
</record>
|
|
1194
|
-
<record id="symple_triplet_phase_A1834_-_Gestione_scarti_da_cruscotto_forzato" model="symple.triplet.phase">
|
|
1195
|
-
<field name="active">True</field>
|
|
1196
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C2416_-_risottomessa_da_cruscotto_E-CC01-0023'),ref('symple_triplet_phase_result_C1931_-_Errore_non_rilavorabile_E-CC01-0024')])]"/>
|
|
1197
|
-
<field name="child_case">False</field>
|
|
1198
|
-
<field name="code"># Available variables:
|
|
1199
|
-
# - case_id: the case that just reached this phase
|
|
1200
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
1201
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
1202
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
1203
|
-
# - env: Odoo Environment on which the action is triggered
|
|
1204
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
1205
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
1206
|
-
# - ValidationError: Warning Exception to use with raise
|
|
1207
|
-
# - Command: x2Many commands namespace
|
|
1208
|
-
# - OrderedDict: ordered dictionaries
|
|
1209
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
1210
|
-
# (line = case id, func = phase name)
|
|
1211
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
1212
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
1213
|
-
# To return a result, assign: result = {...}
|
|
1214
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
1215
|
-
# phase result will not be set.
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
</field>
|
|
1220
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
1221
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
1222
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
1223
|
-
<field name="is_compute_refund">False</field>
|
|
1224
|
-
<field name="is_dl">False</field>
|
|
1225
|
-
<field name="is_needs_child_case">False</field>
|
|
1226
|
-
<field name="is_pick_refund_template">False</field>
|
|
1227
|
-
<field name="is_process_managed">False</field>
|
|
1228
|
-
<field name="is_quote_accepted">False</field>
|
|
1229
|
-
<field name="is_quote_sent">False</field>
|
|
1230
|
-
<field name="is_timeout">False</field>
|
|
1231
|
-
<field name="is_voidable">False</field>
|
|
1232
|
-
<field name="name">A1834 - Gestione scarti da cruscotto forzato</field>
|
|
1233
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
1234
|
-
<field name="is_externally_integrated">False</field>
|
|
1235
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
1236
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
1237
|
-
<field name="phase_code">F-CC01-0012</field>
|
|
1238
|
-
<field name="check_closed_child_tickets">False</field>
|
|
1239
|
-
</record>
|
|
1240
|
-
<record id="symple_triplet_phase_A0816_-_In_attesa_esito_ammissibilit_" model="symple.triplet.phase">
|
|
1241
|
-
<field name="active">True</field>
|
|
1242
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C1037_-_Ammissibilit__OK_E-CC01-0025'),ref('symple_triplet_phase_result_C1038_-_Ammissibilit__KO_E-CC01-0026')])]"/>
|
|
1243
|
-
<field name="child_case">False</field>
|
|
1244
|
-
<field name="code"># Available variables:
|
|
1245
|
-
# - case_id: the case that just reached this phase
|
|
1246
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
1247
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
1248
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
1249
|
-
# - env: Odoo Environment on which the action is triggered
|
|
1250
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
1251
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
1252
|
-
# - ValidationError: Warning Exception to use with raise
|
|
1253
|
-
# - Command: x2Many commands namespace
|
|
1254
|
-
# - OrderedDict: ordered dictionaries
|
|
1255
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
1256
|
-
# (line = case id, func = phase name)
|
|
1257
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
1258
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
1259
|
-
# To return a result, assign: result = {...}
|
|
1260
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
1261
|
-
# phase result will not be set.
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
</field>
|
|
1266
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
1267
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
1268
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
1269
|
-
<field name="is_compute_refund">False</field>
|
|
1270
|
-
<field name="is_dl">False</field>
|
|
1271
|
-
<field name="is_needs_child_case">False</field>
|
|
1272
|
-
<field name="is_pick_refund_template">False</field>
|
|
1273
|
-
<field name="is_process_managed">False</field>
|
|
1274
|
-
<field name="is_quote_accepted">False</field>
|
|
1275
|
-
<field name="is_quote_sent">False</field>
|
|
1276
|
-
<field name="is_timeout">False</field>
|
|
1277
|
-
<field name="is_voidable">False</field>
|
|
1278
|
-
<field name="name">A0816 - In attesa esito ammissibilità</field>
|
|
1279
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
1280
|
-
<field name="is_externally_integrated">False</field>
|
|
1281
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
1282
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
1283
|
-
<field name="phase_code">F-CC01-0013</field>
|
|
1284
|
-
<field name="check_closed_child_tickets">False</field>
|
|
1285
|
-
</record>
|
|
1286
|
-
<record id="symple_triplet_phase_A1004_-_Verifica_RCU___Data_decorrenza" model="symple.triplet.phase">
|
|
1287
|
-
<field name="active">True</field>
|
|
1288
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C1448_-_OK_controlli_RCU___Data_decorrenza_E-CC01-0027'),ref('symple_triplet_phase_result_C1449_-_KO_controlli_RCU___Data_decorrenza_E-CC01-0028'),ref('symple_triplet_phase_result_C2549_-_annullamento_attivo_E-CC01-0029'),ref('symple_triplet_phase_result_C1763_-_Annullamento_passivo_dal_SII_E-CC01-0030')])]"/>
|
|
1289
|
-
<field name="allowed_process_ids" model="symple.pb.process" eval="[(6, 0, obj().search([('name','in',('ml_annullamento_cessazione',)),]).ids)]" />
|
|
1290
|
-
<field name="child_case">False</field>
|
|
1291
|
-
<field name="code"># Available variables:
|
|
1292
|
-
# - case_id: the case that just reached this phase
|
|
1293
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
1294
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
1295
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
1296
|
-
# - env: Odoo Environment on which the action is triggered
|
|
1297
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
1298
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
1299
|
-
# - ValidationError: Warning Exception to use with raise
|
|
1300
|
-
# - Command: x2Many commands namespace
|
|
1301
|
-
# - OrderedDict: ordered dictionaries
|
|
1302
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
1303
|
-
# (line = case id, func = phase name)
|
|
1304
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
1305
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
1306
|
-
# To return a result, assign: result = {...}
|
|
1307
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
1308
|
-
# phase result will not be set.
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
</field>
|
|
1313
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
1314
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
1315
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
1316
|
-
<field name="is_compute_refund">False</field>
|
|
1317
|
-
<field name="is_dl">False</field>
|
|
1318
|
-
<field name="is_needs_child_case">False</field>
|
|
1319
|
-
<field name="is_pick_refund_template">False</field>
|
|
1320
|
-
<field name="is_process_managed">False</field>
|
|
1321
|
-
<field name="is_quote_accepted">False</field>
|
|
1322
|
-
<field name="is_quote_sent">False</field>
|
|
1323
|
-
<field name="is_timeout">False</field>
|
|
1324
|
-
<field name="is_voidable">False</field>
|
|
1325
|
-
<field name="name">A1004 - Verifica RCU + Data decorrenza</field>
|
|
1326
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
1327
|
-
<field name="is_externally_integrated">False</field>
|
|
1328
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
1329
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
1330
|
-
<field name="phase_code">F-CC01-0014</field>
|
|
1331
|
-
<field name="check_closed_child_tickets">False</field>
|
|
1332
|
-
</record>
|
|
1333
|
-
<record id="symple_triplet_phase_A2397_-_OK_RCU___verifica_data_decorrenza" model="symple.triplet.phase">
|
|
1334
|
-
<field name="active">True</field>
|
|
1335
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C1936_-_Data_raggiunta_E-CC01-0031')])]"/>
|
|
1336
|
-
<field name="child_case">False</field>
|
|
1337
|
-
<field name="code"><![CDATA[# RES1 = C1936 - Data raggiunta
|
|
1338
|
-
|
|
1339
|
-
RES1 = "RES1"
|
|
1340
|
-
|
|
1341
|
-
logs = []
|
|
1342
|
-
debug_logs = []
|
|
1343
|
-
error_occurred = False
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
def make_log(message, data=None, always=False):
|
|
1347
|
-
log_entry = {"message": message}
|
|
1348
|
-
if data is not None:
|
|
1349
|
-
log_entry["data"] = data
|
|
1350
|
-
|
|
1351
|
-
if always:
|
|
1352
|
-
logs.append(log_entry)
|
|
1353
|
-
else:
|
|
1354
|
-
debug_logs.append(log_entry)
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
# --------------------------------------
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
def main():
|
|
1361
|
-
date_to_check = case_id.disconnect_date
|
|
1362
|
-
today = datetime.date.today()
|
|
1363
|
-
cutoff = today.replace(day=1) - datetime.timedelta(days=1)
|
|
1364
|
-
date_reached = date_to_check <= cutoff
|
|
1365
|
-
if date_reached:
|
|
1366
|
-
return RES1
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
try:
|
|
1370
|
-
result = main()
|
|
1371
|
-
except Exception as e:
|
|
1372
|
-
error_occurred = True
|
|
1373
|
-
make_log(
|
|
1374
|
-
"Error occurred in phase",
|
|
1375
|
-
{"error": str(e), "traceback": format_exc()},
|
|
1376
|
-
always=True,
|
|
1377
|
-
)
|
|
1378
|
-
case_id.write({"error_message": str(e)})
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
if error_occurred and debug_logs:
|
|
1382
|
-
logs.append({"message": "debug_logs", "logs": debug_logs})
|
|
1383
|
-
|
|
1384
|
-
if logs:
|
|
1385
|
-
log(json_dumps(logs, indent=2))]]></field>
|
|
1386
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
1387
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
1388
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
1389
|
-
<field name="is_compute_refund">False</field>
|
|
1390
|
-
<field name="is_dl">False</field>
|
|
1391
|
-
<field name="is_needs_child_case">False</field>
|
|
1392
|
-
<field name="is_pick_refund_template">False</field>
|
|
1393
|
-
<field name="is_process_managed">False</field>
|
|
1394
|
-
<field name="is_quote_accepted">False</field>
|
|
1395
|
-
<field name="is_quote_sent">False</field>
|
|
1396
|
-
<field name="is_timeout">False</field>
|
|
1397
|
-
<field name="is_voidable">False</field>
|
|
1398
|
-
<field name="name">A2397 - OK RCU + verifica data decorrenza</field>
|
|
1399
|
-
<field name="set_result_automatically">from_code</field>
|
|
1400
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
1401
|
-
<field name="is_externally_integrated">False</field>
|
|
1402
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
1403
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
1404
|
-
<field name="phase_code">F-CC01-0015</field>
|
|
1405
|
-
<field name="check_closed_child_tickets">False</field>
|
|
1406
|
-
</record>
|
|
1407
|
-
<record id="symple_triplet_phase_A1577_-_Chiusura_Ordine_CRM" model="symple.triplet.phase">
|
|
1408
|
-
<field name="active">True</field>
|
|
1409
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C2242_-_Chiusura_Ordine_OK_E-CC01-0032'),ref('symple_triplet_phase_result_C1899_-_Errore_CRM_durante_Chiusura_Ordine_E-CC01-0033')])]"/>
|
|
1410
|
-
<field name="child_case">False</field>
|
|
1411
|
-
<field name="code"># Available variables:
|
|
1412
|
-
# - case_id: the case that just reached this phase
|
|
1413
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
1414
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
1415
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
1416
|
-
# - env: Odoo Environment on which the action is triggered
|
|
1417
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
1418
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
1419
|
-
# - ValidationError: Warning Exception to use with raise
|
|
1420
|
-
# - Command: x2Many commands namespace
|
|
1421
|
-
# - OrderedDict: ordered dictionaries
|
|
1422
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
1423
|
-
# (line = case id, func = phase name)
|
|
1424
|
-
# To return a result, assign: result = {...}
|
|
1425
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
1426
|
-
# phase result will not be set.
|
|
1427
|
-
|
|
1428
|
-
logs = []
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
def log_and_parse_response(response, log_message):
|
|
1432
|
-
try:
|
|
1433
|
-
json_data = response.json()
|
|
1434
|
-
logs.append({"message": log_message, "data": json_data})
|
|
1435
|
-
return json_data
|
|
1436
|
-
except Exception:
|
|
1437
|
-
logs.append({"message": log_message, "response_text": response.text})
|
|
1438
|
-
return response.text
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
def create_order_disconnect(asset_id, token):
|
|
1442
|
-
url = "http://b2w-cpq-order-management-service/v1/order"
|
|
1443
|
-
headers = {
|
|
1444
|
-
"X-Auth-Request-Access-Token": "" + token,
|
|
1445
|
-
"Content-Type": "application/json",
|
|
1446
|
-
"generatesession": "true",
|
|
1447
|
-
}
|
|
1448
|
-
body = {
|
|
1449
|
-
"obj_type": "Order",
|
|
1450
|
-
"crm_accountcode": case_id.customer_id.user_sequence,
|
|
1451
|
-
"accountcode": str(case_id.customer_id.id),
|
|
1452
|
-
"type": "Disconnect",
|
|
1453
|
-
"subtype": case_id.ticket_type_id.name,
|
|
1454
|
-
"industry": "BSP Utility",
|
|
1455
|
-
"commodity": "power" if case_id.service_point_ids[0].pod_id else "gas",
|
|
1456
|
-
"order_date": case_id.disconnect_date.strftime("%Y-%m-%d"),
|
|
1457
|
-
"contract": True,
|
|
1458
|
-
"singlecontract": True,
|
|
1459
|
-
"assets": [asset_id],
|
|
1460
|
-
"options": {
|
|
1461
|
-
"userLanguage": "en-US",
|
|
1462
|
-
"remotePagination": True,
|
|
1463
|
-
"itemsForPage": 10,
|
|
1464
|
-
"cartItemsForPage": 10,
|
|
1465
|
-
},
|
|
1466
|
-
}
|
|
1467
|
-
|
|
1468
|
-
logs.append({"message": "Creating order", "data": {"body": body}})
|
|
1469
|
-
|
|
1470
|
-
response = request("POST", url, headers=headers, data=json_dumps(body))
|
|
1471
|
-
json = log_and_parse_response(
|
|
1472
|
-
response,
|
|
1473
|
-
"Order creation response",
|
|
1474
|
-
)
|
|
1475
|
-
|
|
1476
|
-
if response.status_code != 200:
|
|
1477
|
-
raise ValidationError("Failed to create order")
|
|
1478
|
-
|
|
1479
|
-
return json
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
def bind_catalog(config_id, catalog_id, token):
|
|
1483
|
-
logs.append(
|
|
1484
|
-
{
|
|
1485
|
-
"message": "Binding catalog and order",
|
|
1486
|
-
"data": {
|
|
1487
|
-
"config_id": config_id,
|
|
1488
|
-
"catalog_id": catalog_id,
|
|
1489
|
-
},
|
|
1490
|
-
}
|
|
1491
|
-
)
|
|
1492
|
-
|
|
1493
|
-
headers = {
|
|
1494
|
-
"X-Auth-Request-Access-Token": "" + token,
|
|
1495
|
-
"Content-Type": "application/json",
|
|
1496
|
-
"generatesession": "true",
|
|
1497
|
-
}
|
|
1498
|
-
url = "http://b2w-cpq-catalog-navigator-node-service/v1/configurations/{}/catalogs/{}".format(
|
|
1499
|
-
config_id, catalog_id
|
|
1500
|
-
)
|
|
1501
|
-
|
|
1502
|
-
response = request("GET", url, headers=headers)
|
|
1503
|
-
json = log_and_parse_response(
|
|
1504
|
-
response,
|
|
1505
|
-
"Catalog binding response",
|
|
1506
|
-
)
|
|
1507
|
-
|
|
1508
|
-
if response.status_code != 200:
|
|
1509
|
-
raise ValidationError("Failed to set catalog id on order")
|
|
1510
|
-
|
|
1511
|
-
return json
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
def checkout(config_id, token):
|
|
1515
|
-
logs.append(
|
|
1516
|
-
{
|
|
1517
|
-
"message": "Binding catalog and order",
|
|
1518
|
-
"data": {
|
|
1519
|
-
"config_id": config_id,
|
|
1520
|
-
},
|
|
1521
|
-
}
|
|
1522
|
-
)
|
|
1523
|
-
|
|
1524
|
-
headers = {
|
|
1525
|
-
"X-Auth-Request-Access-Token": "" + token,
|
|
1526
|
-
"Content-Type": "application/json",
|
|
1527
|
-
"generatesession": "true",
|
|
1528
|
-
}
|
|
1529
|
-
url = "http://b2w-cpq-order-management-service/v1/order/{}".format(config_id)
|
|
1530
|
-
|
|
1531
|
-
response = request("POST", url, headers=headers, data="{}")
|
|
1532
|
-
json = log_and_parse_response(
|
|
1533
|
-
response,
|
|
1534
|
-
"Checkout response",
|
|
1535
|
-
)
|
|
1536
|
-
|
|
1537
|
-
if response.status_code != 200:
|
|
1538
|
-
raise ValidationError("Failed to checkout")
|
|
1539
|
-
|
|
1540
|
-
return json
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
try:
|
|
1544
|
-
StagingArea = env["symple.pb.process.data"]
|
|
1545
|
-
IrConfigParam = env["ir.config_parameter"].sudo()
|
|
1546
|
-
token = IrConfigParam.get_b2w_access_token()
|
|
1547
|
-
|
|
1548
|
-
code = case_id.service_point_ids[0].code
|
|
1549
|
-
asset = case_id.sudo().kv_store().get("asset")
|
|
1550
|
-
catalog_id = asset["catalogid"]
|
|
1551
|
-
logs.append({"message": "Asset loaded", "data": asset})
|
|
1552
|
-
order = create_order_disconnect(asset["_id"], token)
|
|
1553
|
-
order_id = order["_id"]
|
|
1554
|
-
config_id = order["conf_id"]
|
|
1555
|
-
logs.append({"message": "Order created", "data": order})
|
|
1556
|
-
bind_catalog(config_id, catalog_id, token)
|
|
1557
|
-
checkout(config_id, token)
|
|
1558
|
-
|
|
1559
|
-
kv_store = case_id.sudo().kv_store()
|
|
1560
|
-
kv_store.set("order_id", order_id)
|
|
1561
|
-
kv_store.set("asset_id", asset["_id"])
|
|
1562
|
-
kv_store.set("config_id", order["conf_id"])
|
|
1563
|
-
kv_store.set("contract_id", asset["contract_id"])
|
|
1564
|
-
|
|
1565
|
-
result = "OK"
|
|
1566
|
-
|
|
1567
|
-
except Exception as e:
|
|
1568
|
-
logs.append({"message": str(e), "traceback": format_exc()})
|
|
1569
|
-
case_id.write(
|
|
1570
|
-
{"error_message": "Errore durante l'esecuzione della fase: {}".format(str(e))}
|
|
1571
|
-
)
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
if logs:
|
|
1575
|
-
log(json_dumps(logs))</field>
|
|
1576
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
1577
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
1578
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
1579
|
-
<field name="is_compute_refund">False</field>
|
|
1580
|
-
<field name="is_dl">False</field>
|
|
1581
|
-
<field name="is_needs_child_case">False</field>
|
|
1582
|
-
<field name="is_pick_refund_template">False</field>
|
|
1583
|
-
<field name="is_process_managed">False</field>
|
|
1584
|
-
<field name="is_quote_accepted">False</field>
|
|
1585
|
-
<field name="is_quote_sent">False</field>
|
|
1586
|
-
<field name="is_timeout">False</field>
|
|
1587
|
-
<field name="is_voidable">False</field>
|
|
1588
|
-
<field name="name">A1577 - Chiusura Ordine CRM</field>
|
|
1589
|
-
<field name="set_result_automatically">from_code</field>
|
|
1590
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
1591
|
-
<field name="is_externally_integrated">False</field>
|
|
1592
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
1593
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
1594
|
-
<field name="phase_code">F-CC01-0016</field>
|
|
1595
|
-
<field name="check_closed_child_tickets">False</field>
|
|
1596
|
-
</record>
|
|
1597
|
-
<record id="symple_triplet_phase_A1321_-_Errore_CRM__RC1_" model="symple.triplet.phase">
|
|
1598
|
-
<field name="active">True</field>
|
|
1599
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C1616_-_Risoluzione_Errore_E-CC01-0034')])]"/>
|
|
1600
|
-
<field name="child_case">False</field>
|
|
1601
|
-
<field name="code"># Available variables:
|
|
1602
|
-
# - case_id: the case that just reached this phase
|
|
1603
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
1604
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
1605
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
1606
|
-
# - env: Odoo Environment on which the action is triggered
|
|
1607
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
1608
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
1609
|
-
# - ValidationError: Warning Exception to use with raise
|
|
1610
|
-
# - Command: x2Many commands namespace
|
|
1611
|
-
# - OrderedDict: ordered dictionaries
|
|
1612
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
1613
|
-
# (line = case id, func = phase name)
|
|
1614
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
1615
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
1616
|
-
# To return a result, assign: result = {...}
|
|
1617
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
1618
|
-
# phase result will not be set.
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
</field>
|
|
1623
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','AMS')])" />
|
|
1624
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
1625
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
1626
|
-
<field name="is_compute_refund">False</field>
|
|
1627
|
-
<field name="is_dl">False</field>
|
|
1628
|
-
<field name="is_needs_child_case">False</field>
|
|
1629
|
-
<field name="is_pick_refund_template">False</field>
|
|
1630
|
-
<field name="is_process_managed">False</field>
|
|
1631
|
-
<field name="is_quote_accepted">False</field>
|
|
1632
|
-
<field name="is_quote_sent">False</field>
|
|
1633
|
-
<field name="is_timeout">False</field>
|
|
1634
|
-
<field name="is_voidable">False</field>
|
|
1635
|
-
<field name="name">A1321 - Errore CRM (RC1)</field>
|
|
1636
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
1637
|
-
<field name="is_externally_integrated">False</field>
|
|
1638
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
1639
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
1640
|
-
<field name="phase_code">F-CC01-0017</field>
|
|
1641
|
-
<field name="check_closed_child_tickets">False</field>
|
|
1642
|
-
</record>
|
|
1643
|
-
<record id="symple_triplet_phase_A2398_-_Invio_ordine_CRM" model="symple.triplet.phase">
|
|
1644
|
-
<field name="active">True</field>
|
|
1645
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C1900_-_Integrazione_M2C_E-CC01-0035')])]"/>
|
|
1646
|
-
<field name="child_case">False</field>
|
|
1647
|
-
<field name="code"># Available variables:
|
|
1648
|
-
# - case_id: the case that just reached this phase
|
|
1649
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
1650
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
1651
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
1652
|
-
# - env: Odoo Environment on which the action is triggered
|
|
1653
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
1654
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
1655
|
-
# - ValidationError: Warning Exception to use with raise
|
|
1656
|
-
# - Command: x2Many commands namespace
|
|
1657
|
-
# - OrderedDict: ordered dictionaries
|
|
1658
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
1659
|
-
# (line = case id, func = phase name)
|
|
1660
|
-
# To return a result, assign: result = {...}
|
|
1661
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
1662
|
-
# phase result will not be set.
|
|
1663
|
-
|
|
1664
|
-
logs = []
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
def log_and_parse_response(response, log_message):
|
|
1668
|
-
try:
|
|
1669
|
-
json_data = response.json()
|
|
1670
|
-
logs.append({"message": log_message, "data": json_data})
|
|
1671
|
-
return json_data
|
|
1672
|
-
except Exception:
|
|
1673
|
-
logs.append({"message": log_message, "response_text": response.text})
|
|
1674
|
-
return response.text
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
def get_contract(contract_id, token):
|
|
1678
|
-
response = request(
|
|
1679
|
-
"GET",
|
|
1680
|
-
"http://b2w-cpq-order-management-service/v1/contract/{}".format(contract_id),
|
|
1681
|
-
headers={"X-Auth-Request-Access-Token": "" + token},
|
|
1682
|
-
)
|
|
1683
|
-
|
|
1684
|
-
json = log_and_parse_response(response, "get_contract")
|
|
1685
|
-
|
|
1686
|
-
if response.status_code != 200:
|
|
1687
|
-
raise ValidationError("Failed to download contract from B2W API")
|
|
1688
|
-
|
|
1689
|
-
return json
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
def write_disconnect_date(asset_id, token):
|
|
1693
|
-
dt = "{}T00:00:00.000+00:00".format(case_id.disconnect_date.isoformat())
|
|
1694
|
-
body = {"disconnectdate": dt}
|
|
1695
|
-
|
|
1696
|
-
response = request(
|
|
1697
|
-
"PATCH",
|
|
1698
|
-
"http://b2w-cpq-order-management-service/v1/asset/{}".format(asset_id),
|
|
1699
|
-
headers={"X-Auth-Request-Access-Token": "" + token},
|
|
1700
|
-
data=json_dumps(body),
|
|
1701
|
-
)
|
|
1702
|
-
|
|
1703
|
-
log_and_parse_response(response, "patch asset")
|
|
1704
|
-
|
|
1705
|
-
if response.status_code != 200:
|
|
1706
|
-
raise ValidationError("Failed to patch asset")
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
def order2asset(order_id, token):
|
|
1710
|
-
url = "http://b2w-cpq-order-management-service/v1/order/asset/{}".format(order_id)
|
|
1711
|
-
headers = {
|
|
1712
|
-
"X-Auth-Request-Access-Token": "" + token,
|
|
1713
|
-
"Content-Type": "application/json",
|
|
1714
|
-
"generatesession": "true",
|
|
1715
|
-
}
|
|
1716
|
-
|
|
1717
|
-
response = request("POST", url, headers=headers, data=json_dumps([]))
|
|
1718
|
-
json = log_and_parse_response(
|
|
1719
|
-
response,
|
|
1720
|
-
"Order2Asset response",
|
|
1721
|
-
)
|
|
1722
|
-
|
|
1723
|
-
if response.status_code != 200:
|
|
1724
|
-
raise ValidationError("Failed to launch order2asset")
|
|
1725
|
-
|
|
1726
|
-
return json
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
try:
|
|
1730
|
-
IrConfigParam = env["ir.config_parameter"].sudo()
|
|
1731
|
-
token = IrConfigParam.get_b2w_access_token()
|
|
1732
|
-
|
|
1733
|
-
kv_store = case_id.sudo().kv_store()
|
|
1734
|
-
|
|
1735
|
-
order_id = kv_store.get("order_id")
|
|
1736
|
-
contract_id = kv_store.get("contract_id")
|
|
1737
|
-
asset_id = kv_store.get("asset_id")
|
|
1738
|
-
|
|
1739
|
-
if not order_id or not contract_id:
|
|
1740
|
-
raise ValidationError("Order ID or Contract ID not found on case")
|
|
1741
|
-
|
|
1742
|
-
order2asset(order_id, token)
|
|
1743
|
-
logs.append({"message": "order2asset done"})
|
|
1744
|
-
|
|
1745
|
-
date_fmt = (case_id.disconnect_date or datetime.datetime.now()).strftime(
|
|
1746
|
-
"%Y-%m-%dT%H:%M:%S.%f"
|
|
1747
|
-
) + "Z"
|
|
1748
|
-
|
|
1749
|
-
statemodel_result = IrConfigParam.update_b2w_statemodel(
|
|
1750
|
-
"cessato",
|
|
1751
|
-
sm_reason=case_id.ticket_type_id.name,
|
|
1752
|
-
expected_date=date_fmt,
|
|
1753
|
-
asset_id=asset_id,
|
|
1754
|
-
token=token,
|
|
1755
|
-
)
|
|
1756
|
-
logs.append({"message": "Statemodel updates on asset", "data": statemodel_result})
|
|
1757
|
-
|
|
1758
|
-
write_disconnect_date(asset_id, token)
|
|
1759
|
-
|
|
1760
|
-
case_id.service_point_ids[0].sudo().write(
|
|
1761
|
-
{
|
|
1762
|
-
"state": "inactive",
|
|
1763
|
-
"supply_end_date": datetime.datetime.today().strftime("%Y-%m-%d"),
|
|
1764
|
-
}
|
|
1765
|
-
)
|
|
1766
|
-
|
|
1767
|
-
contract = get_contract(contract_id, token)
|
|
1768
|
-
|
|
1769
|
-
if contract.get("status") == "disconnected":
|
|
1770
|
-
statemodel_result = IrConfigParam.update_b2w_statemodel(
|
|
1771
|
-
"cessato",
|
|
1772
|
-
sm_reason=case_id.ticket_type_id.name,
|
|
1773
|
-
expected_date=date_fmt,
|
|
1774
|
-
contract_id=contract_id,
|
|
1775
|
-
token=token,
|
|
1776
|
-
)
|
|
1777
|
-
logs.append(
|
|
1778
|
-
{"message": "Statemodel updates on contract", "data": statemodel_result}
|
|
1779
|
-
)
|
|
1780
|
-
kv_store.set("is_contract_disconnected", True)
|
|
1781
|
-
else:
|
|
1782
|
-
kv_store.set("is_contract_disconnected", False)
|
|
1783
|
-
|
|
1784
|
-
logs.append({"message": "service point updated"})
|
|
1785
|
-
|
|
1786
|
-
result = "OK"
|
|
1787
|
-
|
|
1788
|
-
except Exception as e:
|
|
1789
|
-
logs.append({"message": str(e), "traceback": format_exc()})
|
|
1790
|
-
case_id.write(
|
|
1791
|
-
{"error_message": "Errore durante l'esecuzione della fase: {}".format(str(e))}
|
|
1792
|
-
)
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
if logs:
|
|
1796
|
-
log(json_dumps(logs))</field>
|
|
1797
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
1798
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
1799
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
1800
|
-
<field name="is_compute_refund">False</field>
|
|
1801
|
-
<field name="is_dl">False</field>
|
|
1802
|
-
<field name="is_needs_child_case">False</field>
|
|
1803
|
-
<field name="is_pick_refund_template">False</field>
|
|
1804
|
-
<field name="is_process_managed">False</field>
|
|
1805
|
-
<field name="is_quote_accepted">False</field>
|
|
1806
|
-
<field name="is_quote_sent">False</field>
|
|
1807
|
-
<field name="is_timeout">False</field>
|
|
1808
|
-
<field name="is_voidable">False</field>
|
|
1809
|
-
<field name="name">A2398 - Invio ordine CRM</field>
|
|
1810
|
-
<field name="set_result_automatically">from_code</field>
|
|
1811
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
1812
|
-
<field name="is_externally_integrated">False</field>
|
|
1813
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
1814
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
1815
|
-
<field name="phase_code">F-CC01-0018</field>
|
|
1816
|
-
<field name="check_closed_child_tickets">False</field>
|
|
1817
|
-
</record>
|
|
1818
|
-
<record id="symple_triplet_phase_A0802_-_Integrazione_M2C" model="symple.triplet.phase">
|
|
1819
|
-
<field name="active">True</field>
|
|
1820
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C1904_-_In_attesa_esito_M2C_E-CC01-0036')])]"/>
|
|
1821
|
-
<field name="child_case">False</field>
|
|
1822
|
-
<field name="code"># Available variables:
|
|
1823
|
-
# - case_id: the case that just reached this phase
|
|
1824
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
1825
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
1826
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
1827
|
-
# - env: Odoo Environment on which the action is triggered
|
|
1828
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
1829
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
1830
|
-
# - ValidationError: Warning Exception to use with raise
|
|
1831
|
-
# - Command: x2Many commands namespace
|
|
1832
|
-
# - OrderedDict: ordered dictionaries
|
|
1833
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
1834
|
-
# (line = case id, func = phase name)
|
|
1835
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
1836
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
1837
|
-
# To return a result, assign: result = {...}
|
|
1838
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
1839
|
-
# phase result will not be set.
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
logs = []
|
|
1843
|
-
|
|
1844
|
-
ServicePoint = env["service.point"]
|
|
1845
|
-
|
|
1846
|
-
try:
|
|
1847
|
-
is_contract_done, contract_id = case_id.sudo().kv_store().get_many(
|
|
1848
|
-
"is_contract_disconnected", "contract_id"
|
|
1849
|
-
)
|
|
1850
|
-
date_fmt = case_id.disconnect_date.strftime("%d%m%Y")
|
|
1851
|
-
|
|
1852
|
-
logs.append({"date": date_fmt})
|
|
1853
|
-
|
|
1854
|
-
next_phase_result = (
|
|
1855
|
-
case_id.triplet_active_phase_id.allowed_phase_result_ids.filtered(
|
|
1856
|
-
lambda x: x.wizard_result == "SUCCESS"
|
|
1857
|
-
)[0]
|
|
1858
|
-
)
|
|
1859
|
-
ending_phase_result = (
|
|
1860
|
-
next_phase_result.next_phase_id.allowed_phase_result_ids.filtered(
|
|
1861
|
-
lambda x: x.wizard_result == "SUCCESS"
|
|
1862
|
-
)[0].state_code
|
|
1863
|
-
)
|
|
1864
|
-
|
|
1865
|
-
sp = case_id.service_point_ids[0]
|
|
1866
|
-
bp = sp.billing_profile_id
|
|
1867
|
-
podPdr = sp.pod_id if sp.pod_id else sp.pdr_id
|
|
1868
|
-
|
|
1869
|
-
json_dict = {
|
|
1870
|
-
"caseId": str(case_id.id),
|
|
1871
|
-
"flow": "m2c_passthrough",
|
|
1872
|
-
"azione": {
|
|
1873
|
-
"protocollo": str(case_id.id),
|
|
1874
|
-
"case": case_id.ticket_type_id.name,
|
|
1875
|
-
"cliente": {
|
|
1876
|
-
"cCodiceBP": case_id.customer_id.golden_key,
|
|
1877
|
-
"cCodiceCrm": case_id.customer_code,
|
|
1878
|
-
"contrattiMandato": [
|
|
1879
|
-
{
|
|
1880
|
-
"cCodiceContrattoMandato": bp.name,
|
|
1881
|
-
"contratti": {
|
|
1882
|
-
"cCodiceContratto": contract_id,
|
|
1883
|
-
"forniture": [
|
|
1884
|
-
{
|
|
1885
|
-
"cPodPdr": podPdr.code,
|
|
1886
|
-
"cCodicePR": sp.code,
|
|
1887
|
-
"cCausaleCessazione": case_id.ticket_type_id.name,
|
|
1888
|
-
"cStatoFornitura": "CESSATO",
|
|
1889
|
-
"dFineContrattoFornitura": date_fmt,
|
|
1890
|
-
}
|
|
1891
|
-
],
|
|
1892
|
-
},
|
|
1893
|
-
}
|
|
1894
|
-
],
|
|
1895
|
-
},
|
|
1896
|
-
},
|
|
1897
|
-
"m2c_callback_esito": ending_phase_result,
|
|
1898
|
-
}
|
|
1899
|
-
|
|
1900
|
-
if is_contract_done:
|
|
1901
|
-
json_dict["azione"]["cliente"]["contrattiMandato"][0]["contratti"][
|
|
1902
|
-
"dFineContratto"
|
|
1903
|
-
] = date_fmt
|
|
1904
|
-
|
|
1905
|
-
has_active_points = ServicePoint.search(
|
|
1906
|
-
[("client_id", "=", case_id.customer_id.id), ("state", "!=", "inactive")]
|
|
1907
|
-
).exists()
|
|
1908
|
-
|
|
1909
|
-
if not has_active_points:
|
|
1910
|
-
json_dict["azione"]["cliente"]["xStatoBp"] = "CESSATO"
|
|
1911
|
-
|
|
1912
|
-
tenant_id = env["ir.config_parameter"].sudo().get_param("m2c_header_tenant_id")
|
|
1913
|
-
org_token = env["ir.config_parameter"].sudo().get_param("m2c_header_org_token")
|
|
1914
|
-
token = env["symple.pb.launcher"].get_access_token()
|
|
1915
|
-
headers = {
|
|
1916
|
-
"tenantId": tenant_id,
|
|
1917
|
-
"orgToken": org_token,
|
|
1918
|
-
"Content-Type": "application/json",
|
|
1919
|
-
"X-Auth-Request-Access-Token": token,
|
|
1920
|
-
}
|
|
1921
|
-
|
|
1922
|
-
logs.append({"message": "m2c", "data": json_dict})
|
|
1923
|
-
|
|
1924
|
-
m2c_url = "http://b2w-symphony-rest-service/api/symphony/process-instances/M2C_passthrough"
|
|
1925
|
-
response = request("POST", m2c_url, headers=headers, data=json_dumps(json_dict))
|
|
1926
|
-
result = "OK"
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
except Exception as e:
|
|
1930
|
-
logs.append({"message": str(e), "traceback": format_exc()})
|
|
1931
|
-
prev = case_id.info_message + "\n" if case_id.info_message else ""
|
|
1932
|
-
case_id.write({"info_message": prev + str(e)})
|
|
1933
|
-
|
|
1934
|
-
if logs:
|
|
1935
|
-
log(json_dumps(logs))</field>
|
|
1936
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
1937
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
1938
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
1939
|
-
<field name="is_compute_refund">False</field>
|
|
1940
|
-
<field name="is_dl">False</field>
|
|
1941
|
-
<field name="is_needs_child_case">False</field>
|
|
1942
|
-
<field name="is_pick_refund_template">False</field>
|
|
1943
|
-
<field name="is_process_managed">False</field>
|
|
1944
|
-
<field name="is_quote_accepted">False</field>
|
|
1945
|
-
<field name="is_quote_sent">False</field>
|
|
1946
|
-
<field name="is_timeout">False</field>
|
|
1947
|
-
<field name="is_voidable">False</field>
|
|
1948
|
-
<field name="name">A0802 - Integrazione M2C</field>
|
|
1949
|
-
<field name="set_result_automatically">from_code</field>
|
|
1950
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
1951
|
-
<field name="is_externally_integrated">False</field>
|
|
1952
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
1953
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
1954
|
-
<field name="phase_code">F-CC01-0019</field>
|
|
1955
|
-
<field name="check_closed_child_tickets">False</field>
|
|
1956
|
-
</record>
|
|
1957
|
-
<record id="symple_triplet_phase_A0803_-_In_attesa_esito_M2C" model="symple.triplet.phase">
|
|
1958
|
-
<field name="active">True</field>
|
|
1959
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C1006_-_OK_Integrazione_M2C_E-CC01-0037'),ref('symple_triplet_phase_result_C2551_-_OK_Intregrazione_M2C_-_Fatture_di_Storno_da_emettere_E-CC01-0038'),ref('symple_triplet_phase_result_C2552_-_Elaborazione_bloccata_nel_M2C_E-CC01-0039')])]"/>
|
|
1960
|
-
<field name="child_case">False</field>
|
|
1961
|
-
<field name="code"># Available variables:
|
|
1962
|
-
# - case_id: the case that just reached this phase
|
|
1963
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
1964
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
1965
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
1966
|
-
# - env: Odoo Environment on which the action is triggered
|
|
1967
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
1968
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
1969
|
-
# - ValidationError: Warning Exception to use with raise
|
|
1970
|
-
# - Command: x2Many commands namespace
|
|
1971
|
-
# - OrderedDict: ordered dictionaries
|
|
1972
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
1973
|
-
# (line = case id, func = phase name)
|
|
1974
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
1975
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
1976
|
-
# To return a result, assign: result = {...}
|
|
1977
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
1978
|
-
# phase result will not be set.
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
</field>
|
|
1983
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
1984
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
1985
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
1986
|
-
<field name="is_compute_refund">False</field>
|
|
1987
|
-
<field name="is_dl">False</field>
|
|
1988
|
-
<field name="is_needs_child_case">False</field>
|
|
1989
|
-
<field name="is_pick_refund_template">False</field>
|
|
1990
|
-
<field name="is_process_managed">False</field>
|
|
1991
|
-
<field name="is_quote_accepted">False</field>
|
|
1992
|
-
<field name="is_quote_sent">False</field>
|
|
1993
|
-
<field name="is_timeout">False</field>
|
|
1994
|
-
<field name="is_voidable">False</field>
|
|
1995
|
-
<field name="name">A0803 - In attesa esito M2C</field>
|
|
1996
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
1997
|
-
<field name="is_externally_integrated">False</field>
|
|
1998
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
1999
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
2000
|
-
<field name="phase_code">F-CC01-0020</field>
|
|
2001
|
-
<field name="check_closed_child_tickets">False</field>
|
|
2002
|
-
</record>
|
|
2003
|
-
<record id="symple_triplet_phase_A1836_-_Apertura_case_figlio" model="symple.triplet.phase">
|
|
2004
|
-
<field name="active">True</field>
|
|
2005
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C2550_-_case_creato_E-CC01-0040')])]"/>
|
|
2006
|
-
<field name="child_case">False</field>
|
|
2007
|
-
<field name="code"># Available variables:
|
|
2008
|
-
# - case_id: the case that just reached this phase
|
|
2009
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
2010
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
2011
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
2012
|
-
# - env: Odoo Environment on which the action is triggered
|
|
2013
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
2014
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
2015
|
-
# - ValidationError: Warning Exception to use with raise
|
|
2016
|
-
# - Command: x2Many commands namespace
|
|
2017
|
-
# - OrderedDict: ordered dictionaries
|
|
2018
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
2019
|
-
# (line = case id, func = phase name)
|
|
2020
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
2021
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
2022
|
-
# To return a result, assign: result = {...}
|
|
2023
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
2024
|
-
# phase result will not be set.
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
</field>
|
|
2029
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
2030
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
2031
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
2032
|
-
<field name="is_compute_refund">False</field>
|
|
2033
|
-
<field name="is_dl">False</field>
|
|
2034
|
-
<field name="is_needs_child_case">False</field>
|
|
2035
|
-
<field name="is_pick_refund_template">False</field>
|
|
2036
|
-
<field name="is_process_managed">False</field>
|
|
2037
|
-
<field name="is_quote_accepted">False</field>
|
|
2038
|
-
<field name="is_quote_sent">False</field>
|
|
2039
|
-
<field name="is_timeout">False</field>
|
|
2040
|
-
<field name="is_voidable">False</field>
|
|
2041
|
-
<field name="name">A1836 - Apertura case figlio</field>
|
|
2042
|
-
<field name="set_result_automatically">from_code</field>
|
|
2043
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
2044
|
-
<field name="is_externally_integrated">False</field>
|
|
2045
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
2046
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
2047
|
-
<field name="phase_code">F-CC01-0021</field>
|
|
2048
|
-
<field name="check_closed_child_tickets">False</field>
|
|
2049
|
-
</record>
|
|
2050
|
-
<record id="symple_triplet_phase_A1595_-_Invio_Annullamento_alla_Market_Communication" model="symple.triplet.phase">
|
|
2051
|
-
<field name="active">True</field>
|
|
2052
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C1019_-_Inviata_E-CC01-0041')])]"/>
|
|
2053
|
-
<field name="child_case">False</field>
|
|
2054
|
-
<field name="code"># Available variables:
|
|
2055
|
-
# - case_id: the case that just reached this phase
|
|
2056
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
2057
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
2058
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
2059
|
-
# - env: Odoo Environment on which the action is triggered
|
|
2060
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
2061
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
2062
|
-
# - ValidationError: Warning Exception to use with raise
|
|
2063
|
-
# - Command: x2Many commands namespace
|
|
2064
|
-
# - OrderedDict: ordered dictionaries
|
|
2065
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
2066
|
-
# (line = case id, func = phase name)
|
|
2067
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
2068
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
2069
|
-
# To return a result, assign: result = {...}
|
|
2070
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
2071
|
-
# phase result will not be set.
|
|
2072
|
-
|
|
2073
|
-
logs = []
|
|
2074
|
-
bypass = False
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
def get_apr_reason():
|
|
2078
|
-
kv_store = case_id.sudo().kv_store()
|
|
2079
|
-
reason_code = kv_store.get("annulment_wizard_motivation")
|
|
2080
|
-
map_motivazione = {
|
|
2081
|
-
"RC01": "Annullamento RC per esecuzione di altra prestazione",
|
|
2082
|
-
"RC02": "Annullamento RC per disattivazione della fornitura",
|
|
2083
|
-
"RC04": "Revoca risoluzione per pratica errata",
|
|
2084
|
-
"RG01": "Revoca RCG per esecuzione di altra prestazione",
|
|
2085
|
-
"RG03": "Revoca risoluzione per errata trasmissione",
|
|
2086
|
-
}
|
|
2087
|
-
|
|
2088
|
-
return reason_code, map_motivazione.get(reason_code, "")
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
try:
|
|
2092
|
-
sp = case_id.service_point_ids[0]
|
|
2093
|
-
podPdr = sp.pod_id if sp.pod_id else sp.pdr_id
|
|
2094
|
-
cod_causale, motivazione = get_apr_reason()
|
|
2095
|
-
|
|
2096
|
-
tenant_id = env["ir.config_parameter"].sudo().get_param("m2c_header_tenant_id")
|
|
2097
|
-
org_token = env["ir.config_parameter"].sudo().get_param("m2c_header_org_token")
|
|
2098
|
-
headers = {"tenantId": tenant_id, "orgToken": org_token}
|
|
2099
|
-
ok_payload = {
|
|
2100
|
-
"refName": "Annulment",
|
|
2101
|
-
"refId": case_id.symphonie_process,
|
|
2102
|
-
"messageProcessVars": {
|
|
2103
|
-
"ifs_code": "APR",
|
|
2104
|
-
"bypass": bypass,
|
|
2105
|
-
"aprInfo": {
|
|
2106
|
-
"COD_CAUSALE": cod_causale,
|
|
2107
|
-
"MOTIVAZIONE": motivazione,
|
|
2108
|
-
"COD_POD_PDR": podPdr.code,
|
|
2109
|
-
},
|
|
2110
|
-
},
|
|
2111
|
-
}
|
|
2112
|
-
|
|
2113
|
-
url = env["ir.config_parameter"].sudo().get_param("b2w_wake_up_process_url")
|
|
2114
|
-
payload = json_dumps(ok_payload)
|
|
2115
|
-
response = request("POST", url, data=payload, headers=headers)
|
|
2116
|
-
|
|
2117
|
-
if response.status_code != 200:
|
|
2118
|
-
raise ValidationError("Failed to launch APR")
|
|
2119
|
-
|
|
2120
|
-
result = "OK"
|
|
2121
|
-
|
|
2122
|
-
except Exception as e:
|
|
2123
|
-
prev = case_id.info_message + "\n" if case_id.info_message else ""
|
|
2124
|
-
case_id.write({"info_message": prev + str(e)})
|
|
2125
|
-
|
|
2126
|
-
log(json_dumps(logs))</field>
|
|
2127
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
2128
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
2129
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
2130
|
-
<field name="is_compute_refund">False</field>
|
|
2131
|
-
<field name="is_dl">False</field>
|
|
2132
|
-
<field name="is_needs_child_case">False</field>
|
|
2133
|
-
<field name="is_pick_refund_template">False</field>
|
|
2134
|
-
<field name="is_process_managed">False</field>
|
|
2135
|
-
<field name="is_quote_accepted">False</field>
|
|
2136
|
-
<field name="is_quote_sent">False</field>
|
|
2137
|
-
<field name="is_timeout">False</field>
|
|
2138
|
-
<field name="is_voidable">False</field>
|
|
2139
|
-
<field name="name">A1595 - Invio Annullamento alla Market Communication</field>
|
|
2140
|
-
<field name="set_result_automatically">from_code</field>
|
|
2141
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
2142
|
-
<field name="is_externally_integrated">False</field>
|
|
2143
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
2144
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
2145
|
-
<field name="phase_code">F-CC01-0022</field>
|
|
2146
|
-
<field name="check_closed_child_tickets">False</field>
|
|
2147
|
-
</record>
|
|
2148
|
-
<record id="symple_triplet_phase_A1767_-_In_attesa_check_IFS_Annullamento" model="symple.triplet.phase">
|
|
2149
|
-
<field name="active">True</field>
|
|
2150
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C2475_-_OK_-_Ammissibilit__Annullamento_Hub_E-CC01-0042'),ref('symple_triplet_phase_result_C2476_-_KO_-_Ammissibilit__Annullamento_Hub_E-CC01-0043'),ref('symple_triplet_phase_result_C1449_-_KO_controlli_RCU___Data_decorrenza_E-CC01-0045'),ref('symple_triplet_phase_result_C1448_-_OK_controlli_RCU_E-CC01-0046'),ref('symple_triplet_phase_result_C1763_-_Annullamento_passivo_dal_SII_E-CC01-0047'),ref('symple_triplet_phase_result_C2599_-_annullamento_confermato_E-CC01-00082')])]"/>
|
|
2151
|
-
<field name="child_case">False</field>
|
|
2152
|
-
<field name="code"># Available variables:
|
|
2153
|
-
# - case_id: the case that just reached this phase
|
|
2154
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
2155
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
2156
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
2157
|
-
# - env: Odoo Environment on which the action is triggered
|
|
2158
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
2159
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
2160
|
-
# - ValidationError: Warning Exception to use with raise
|
|
2161
|
-
# - Command: x2Many commands namespace
|
|
2162
|
-
# - OrderedDict: ordered dictionaries
|
|
2163
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
2164
|
-
# (line = case id, func = phase name)
|
|
2165
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
2166
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
2167
|
-
# To return a result, assign: result = {...}
|
|
2168
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
2169
|
-
# phase result will not be set.
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
</field>
|
|
2174
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
2175
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
2176
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
2177
|
-
<field name="is_compute_refund">False</field>
|
|
2178
|
-
<field name="is_dl">False</field>
|
|
2179
|
-
<field name="is_needs_child_case">False</field>
|
|
2180
|
-
<field name="is_pick_refund_template">False</field>
|
|
2181
|
-
<field name="is_process_managed">False</field>
|
|
2182
|
-
<field name="is_quote_accepted">False</field>
|
|
2183
|
-
<field name="is_quote_sent">False</field>
|
|
2184
|
-
<field name="is_timeout">False</field>
|
|
2185
|
-
<field name="is_voidable">False</field>
|
|
2186
|
-
<field name="name">A1767 - In attesa check IFS Annullamento</field>
|
|
2187
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
2188
|
-
<field name="is_externally_integrated">False</field>
|
|
2189
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
2190
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
2191
|
-
<field name="phase_code">F-CC01-0023</field>
|
|
2192
|
-
<field name="check_closed_child_tickets">False</field>
|
|
2193
|
-
</record>
|
|
2194
|
-
<record id="symple_triplet_phase_A2562_-_verifica_avvio_gestione_manuale_annullamento" model="symple.triplet.phase">
|
|
2195
|
-
<field name="active">True</field>
|
|
2196
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C2508_-_gestione_fuori_linea_E-CC01-0048'),ref('symple_triplet_phase_result_C2509_-_Da_gestire_nuovo_invio_automatico_E-CC01-0049'),ref('symple_triplet_phase_result_C1449_-_KO_controlli_RCU___Data_decorrenza_E-CC01-0050'),ref('symple_triplet_phase_result_C1448_-_OK_controlli_RCU_E-CC01-0051'),ref('symple_triplet_phase_result_C1763_-_Annullamento_passivo_dal_SII_E-CC01-0052')])]"/>
|
|
2197
|
-
<field name="child_case">False</field>
|
|
2198
|
-
<field name="code"># Available variables:
|
|
2199
|
-
# - case_id: the case that just reached this phase
|
|
2200
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
2201
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
2202
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
2203
|
-
# - env: Odoo Environment on which the action is triggered
|
|
2204
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
2205
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
2206
|
-
# - ValidationError: Warning Exception to use with raise
|
|
2207
|
-
# - Command: x2Many commands namespace
|
|
2208
|
-
# - OrderedDict: ordered dictionaries
|
|
2209
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
2210
|
-
# (line = case id, func = phase name)
|
|
2211
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
2212
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
2213
|
-
# To return a result, assign: result = {...}
|
|
2214
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
2215
|
-
# phase result will not be set.
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
</field>
|
|
2220
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','BOT')])" />
|
|
2221
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
2222
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
2223
|
-
<field name="is_compute_refund">False</field>
|
|
2224
|
-
<field name="is_dl">False</field>
|
|
2225
|
-
<field name="is_needs_child_case">False</field>
|
|
2226
|
-
<field name="is_pick_refund_template">False</field>
|
|
2227
|
-
<field name="is_process_managed">False</field>
|
|
2228
|
-
<field name="is_quote_accepted">False</field>
|
|
2229
|
-
<field name="is_quote_sent">False</field>
|
|
2230
|
-
<field name="is_timeout">False</field>
|
|
2231
|
-
<field name="is_voidable">False</field>
|
|
2232
|
-
<field name="name">A2562 - verifica avvio gestione manuale annullamento</field>
|
|
2233
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
2234
|
-
<field name="is_externally_integrated">False</field>
|
|
2235
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
2236
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
2237
|
-
<field name="phase_code">F-CC01-0024</field>
|
|
2238
|
-
<field name="check_closed_child_tickets">False</field>
|
|
2239
|
-
</record>
|
|
2240
|
-
<record id="symple_triplet_phase_A2142_-_Invio_alla_marketcom_annullamento_forzato" model="symple.triplet.phase">
|
|
2241
|
-
<field name="active">True</field>
|
|
2242
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C1019_-_Inviata_E-CC01-0053')])]"/>
|
|
2243
|
-
<field name="child_case">False</field>
|
|
2244
|
-
<field name="code"># Available variables:
|
|
2245
|
-
# - case_id: the case that just reached this phase
|
|
2246
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
2247
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
2248
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
2249
|
-
# - env: Odoo Environment on which the action is triggered
|
|
2250
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
2251
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
2252
|
-
# - ValidationError: Warning Exception to use with raise
|
|
2253
|
-
# - Command: x2Many commands namespace
|
|
2254
|
-
# - OrderedDict: ordered dictionaries
|
|
2255
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
2256
|
-
# (line = case id, func = phase name)
|
|
2257
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
2258
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
2259
|
-
# To return a result, assign: result = {...}
|
|
2260
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
2261
|
-
# phase result will not be set.
|
|
2262
|
-
|
|
2263
|
-
logs = []
|
|
2264
|
-
bypass = True
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
def get_apr_reason():
|
|
2268
|
-
kv_store = case_id.sudo().kv_store()
|
|
2269
|
-
reason_code = kv_store.get("annulment_wizard_motivation")
|
|
2270
|
-
map_motivazione = {
|
|
2271
|
-
"RC01": "Annullamento RC per esecuzione di altra prestazione",
|
|
2272
|
-
"RC02": "Annullamento RC per disattivazione della fornitura",
|
|
2273
|
-
"RC04": "Revoca risoluzione per pratica errata",
|
|
2274
|
-
"RG01": "Revoca RCG per esecuzione di altra prestazione",
|
|
2275
|
-
"RG03": "Revoca risoluzione per errata trasmissione",
|
|
2276
|
-
}
|
|
2277
|
-
|
|
2278
|
-
return reason_code, map_motivazione.get(reason_code, "")
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
try:
|
|
2282
|
-
sp = case_id.service_point_ids[0]
|
|
2283
|
-
podPdr = sp.pod_id if sp.pod_id else sp.pdr_id
|
|
2284
|
-
cod_causale, motivazione = get_apr_reason()
|
|
2285
|
-
|
|
2286
|
-
tenant_id = env["ir.config_parameter"].sudo().get_param("m2c_header_tenant_id")
|
|
2287
|
-
org_token = env["ir.config_parameter"].sudo().get_param("m2c_header_org_token")
|
|
2288
|
-
headers = {"tenantId": tenant_id, "orgToken": org_token}
|
|
2289
|
-
ok_payload = {
|
|
2290
|
-
"refName": "Annulment",
|
|
2291
|
-
"refId": case_id.symphonie_process,
|
|
2292
|
-
"messageProcessVars": {
|
|
2293
|
-
"ifs_code": "APR",
|
|
2294
|
-
"bypass": bypass,
|
|
2295
|
-
"aprInfo": {
|
|
2296
|
-
"COD_CAUSALE": cod_causale,
|
|
2297
|
-
"MOTIVAZIONE": motivazione,
|
|
2298
|
-
"COD_POD_PDR": podPdr.code,
|
|
2299
|
-
},
|
|
2300
|
-
},
|
|
2301
|
-
}
|
|
2302
|
-
|
|
2303
|
-
url = env["ir.config_parameter"].sudo().get_param("b2w_wake_up_process_url")
|
|
2304
|
-
payload = json_dumps(ok_payload)
|
|
2305
|
-
response = request("POST", url, data=payload, headers=headers)
|
|
2306
|
-
|
|
2307
|
-
if response.status_code != 200:
|
|
2308
|
-
raise ValidationError("Failed to launch VT.0040")
|
|
2309
|
-
|
|
2310
|
-
result = "OK"
|
|
2311
|
-
|
|
2312
|
-
except Exception as e:
|
|
2313
|
-
prev = case_id.info_message + "\n" if case_id.info_message else ""
|
|
2314
|
-
case_id.write({"info_message": prev + str(e)})
|
|
2315
|
-
|
|
2316
|
-
log(json_dumps(logs))</field>
|
|
2317
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
2318
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
2319
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
2320
|
-
<field name="is_compute_refund">False</field>
|
|
2321
|
-
<field name="is_dl">False</field>
|
|
2322
|
-
<field name="is_needs_child_case">False</field>
|
|
2323
|
-
<field name="is_pick_refund_template">False</field>
|
|
2324
|
-
<field name="is_process_managed">False</field>
|
|
2325
|
-
<field name="is_quote_accepted">False</field>
|
|
2326
|
-
<field name="is_quote_sent">False</field>
|
|
2327
|
-
<field name="is_timeout">False</field>
|
|
2328
|
-
<field name="is_voidable">False</field>
|
|
2329
|
-
<field name="name">A2142 - Invio alla marketcom annullamento forzato</field>
|
|
2330
|
-
<field name="set_result_automatically">from_code</field>
|
|
2331
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
2332
|
-
<field name="is_externally_integrated">False</field>
|
|
2333
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
2334
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
2335
|
-
<field name="phase_code">F-CC01-0025</field>
|
|
2336
|
-
<field name="check_closed_child_tickets">False</field>
|
|
2337
|
-
</record>
|
|
2338
|
-
<record id="symple_triplet_phase_A2143_-_In_attesa_check_IFS_Annullamento_forzato" model="symple.triplet.phase">
|
|
2339
|
-
<field name="active">True</field>
|
|
2340
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C2225_-_KO_-_Ammissibilit__Hub_E-CC01-0054'),ref('symple_triplet_phase_result_C2224_-_OK_-_Ammissibilit__Hub_E-CC01-0055')])]"/>
|
|
2341
|
-
<field name="child_case">False</field>
|
|
2342
|
-
<field name="code"># Available variables:
|
|
2343
|
-
# - case_id: the case that just reached this phase
|
|
2344
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
2345
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
2346
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
2347
|
-
# - env: Odoo Environment on which the action is triggered
|
|
2348
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
2349
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
2350
|
-
# - ValidationError: Warning Exception to use with raise
|
|
2351
|
-
# - Command: x2Many commands namespace
|
|
2352
|
-
# - OrderedDict: ordered dictionaries
|
|
2353
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
2354
|
-
# (line = case id, func = phase name)
|
|
2355
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
2356
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
2357
|
-
# To return a result, assign: result = {...}
|
|
2358
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
2359
|
-
# phase result will not be set.
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
</field>
|
|
2364
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
2365
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
2366
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
2367
|
-
<field name="is_compute_refund">False</field>
|
|
2368
|
-
<field name="is_dl">False</field>
|
|
2369
|
-
<field name="is_needs_child_case">False</field>
|
|
2370
|
-
<field name="is_pick_refund_template">False</field>
|
|
2371
|
-
<field name="is_process_managed">False</field>
|
|
2372
|
-
<field name="is_quote_accepted">False</field>
|
|
2373
|
-
<field name="is_quote_sent">False</field>
|
|
2374
|
-
<field name="is_timeout">False</field>
|
|
2375
|
-
<field name="is_voidable">False</field>
|
|
2376
|
-
<field name="name">A2143 - In attesa check IFS Annullamento forzato</field>
|
|
2377
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
2378
|
-
<field name="is_externally_integrated">False</field>
|
|
2379
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
2380
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
2381
|
-
<field name="phase_code">F-CC01-0026</field>
|
|
2382
|
-
<field name="check_closed_child_tickets">False</field>
|
|
2383
|
-
</record>
|
|
2384
|
-
<record id="symple_triplet_phase_A1732_-_Gestione_scarti_da_cruscotto_annullamento" model="symple.triplet.phase">
|
|
2385
|
-
<field name="active">True</field>
|
|
2386
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C2416_-_risottomessa_da_cruscotto_E-CC01-0056'),ref('symple_triplet_phase_result_C1931_-_Errore_non_rilavorabile_E-CC01-0057'),ref('symple_triplet_phase_result_C1449_-_KO_controlli_RCU___Data_decorrenza_E-CC01-0058'),ref('symple_triplet_phase_result_C1448_-_OK_controlli_RCU_E-CC01-0059'),ref('symple_triplet_phase_result_C1763_-_Annullamento_passivo_dal_SII_E-CC01-0060')])]"/>
|
|
2387
|
-
<field name="child_case">False</field>
|
|
2388
|
-
<field name="code"># Available variables:
|
|
2389
|
-
# - case_id: the case that just reached this phase
|
|
2390
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
2391
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
2392
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
2393
|
-
# - env: Odoo Environment on which the action is triggered
|
|
2394
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
2395
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
2396
|
-
# - ValidationError: Warning Exception to use with raise
|
|
2397
|
-
# - Command: x2Many commands namespace
|
|
2398
|
-
# - OrderedDict: ordered dictionaries
|
|
2399
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
2400
|
-
# (line = case id, func = phase name)
|
|
2401
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
2402
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
2403
|
-
# To return a result, assign: result = {...}
|
|
2404
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
2405
|
-
# phase result will not be set.
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
</field>
|
|
2410
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
2411
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
2412
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
2413
|
-
<field name="is_compute_refund">False</field>
|
|
2414
|
-
<field name="is_dl">False</field>
|
|
2415
|
-
<field name="is_needs_child_case">False</field>
|
|
2416
|
-
<field name="is_pick_refund_template">False</field>
|
|
2417
|
-
<field name="is_process_managed">False</field>
|
|
2418
|
-
<field name="is_quote_accepted">False</field>
|
|
2419
|
-
<field name="is_quote_sent">False</field>
|
|
2420
|
-
<field name="is_timeout">False</field>
|
|
2421
|
-
<field name="is_voidable">False</field>
|
|
2422
|
-
<field name="name">A1732 - Gestione scarti da cruscotto annullamento</field>
|
|
2423
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
2424
|
-
<field name="is_externally_integrated">False</field>
|
|
2425
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
2426
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
2427
|
-
<field name="phase_code">F-CC01-0027</field>
|
|
2428
|
-
<field name="check_closed_child_tickets">False</field>
|
|
2429
|
-
</record>
|
|
2430
|
-
<record id="symple_triplet_phase_A1832_-_gestione_scarti_da_cruscotto_annullamento_forzato" model="symple.triplet.phase">
|
|
2431
|
-
<field name="active">True</field>
|
|
2432
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C2416_-_risottomessa_da_cruscotto_E-CC01-0061'),ref('symple_triplet_phase_result_C1931_-_Errore_non_rilavorabile_E-CC01-0062'),ref('symple_triplet_phase_result_C1449_-_KO_controlli_RCU___Data_decorrenza_E-CC01-0063'),ref('symple_triplet_phase_result_C1448_-_OK_controlli_RCU_E-CC01-0064')])]"/>
|
|
2433
|
-
<field name="child_case">False</field>
|
|
2434
|
-
<field name="code"># Available variables:
|
|
2435
|
-
# - case_id: the case that just reached this phase
|
|
2436
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
2437
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
2438
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
2439
|
-
# - env: Odoo Environment on which the action is triggered
|
|
2440
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
2441
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
2442
|
-
# - ValidationError: Warning Exception to use with raise
|
|
2443
|
-
# - Command: x2Many commands namespace
|
|
2444
|
-
# - OrderedDict: ordered dictionaries
|
|
2445
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
2446
|
-
# (line = case id, func = phase name)
|
|
2447
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
2448
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
2449
|
-
# To return a result, assign: result = {...}
|
|
2450
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
2451
|
-
# phase result will not be set.
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
</field>
|
|
2456
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
2457
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
2458
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
2459
|
-
<field name="is_compute_refund">False</field>
|
|
2460
|
-
<field name="is_dl">False</field>
|
|
2461
|
-
<field name="is_needs_child_case">False</field>
|
|
2462
|
-
<field name="is_pick_refund_template">False</field>
|
|
2463
|
-
<field name="is_process_managed">False</field>
|
|
2464
|
-
<field name="is_quote_accepted">False</field>
|
|
2465
|
-
<field name="is_quote_sent">False</field>
|
|
2466
|
-
<field name="is_timeout">False</field>
|
|
2467
|
-
<field name="is_voidable">False</field>
|
|
2468
|
-
<field name="name">A1832 - gestione scarti da cruscotto annullamento forzato</field>
|
|
2469
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
2470
|
-
<field name="is_externally_integrated">False</field>
|
|
2471
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
2472
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
2473
|
-
<field name="phase_code">F-CC01-0028</field>
|
|
2474
|
-
<field name="check_closed_child_tickets">False</field>
|
|
2475
|
-
</record>
|
|
2476
|
-
<record id="symple_triplet_phase_A0833_-_In_attesa_ricezione_Ammissibilit__Annullamento" model="symple.triplet.phase">
|
|
2477
|
-
<field name="active">True</field>
|
|
2478
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C1037_-_Ammissibilit__OK_E-CC01-0065'),ref('symple_triplet_phase_result_C1038_-_Ammissibilit__KO_E-CC01-0066'),ref('symple_triplet_phase_result_C1449_-_KO_controlli_RCU___Data_decorrenza_E-CC01-0067'),ref('symple_triplet_phase_result_C1448_-_OK_controlli_RCU_E-CC01-0068'),ref('symple_triplet_phase_result_C1763_-_Annullamento_passivo_dal_SII_E-CC01-0069')])]"/>
|
|
2479
|
-
<field name="child_case">False</field>
|
|
2480
|
-
<field name="code"># Available variables:
|
|
2481
|
-
# - case_id: the case that just reached this phase
|
|
2482
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
2483
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
2484
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
2485
|
-
# - env: Odoo Environment on which the action is triggered
|
|
2486
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
2487
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
2488
|
-
# - ValidationError: Warning Exception to use with raise
|
|
2489
|
-
# - Command: x2Many commands namespace
|
|
2490
|
-
# - OrderedDict: ordered dictionaries
|
|
2491
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
2492
|
-
# (line = case id, func = phase name)
|
|
2493
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
2494
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
2495
|
-
# To return a result, assign: result = {...}
|
|
2496
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
2497
|
-
# phase result will not be set.
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
</field>
|
|
2502
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
2503
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
2504
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
2505
|
-
<field name="is_compute_refund">False</field>
|
|
2506
|
-
<field name="is_dl">False</field>
|
|
2507
|
-
<field name="is_needs_child_case">False</field>
|
|
2508
|
-
<field name="is_pick_refund_template">False</field>
|
|
2509
|
-
<field name="is_process_managed">False</field>
|
|
2510
|
-
<field name="is_quote_accepted">False</field>
|
|
2511
|
-
<field name="is_quote_sent">False</field>
|
|
2512
|
-
<field name="is_timeout">False</field>
|
|
2513
|
-
<field name="is_voidable">False</field>
|
|
2514
|
-
<field name="name">A0833 - In attesa ricezione Ammissibilità Annullamento</field>
|
|
2515
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
2516
|
-
<field name="is_externally_integrated">False</field>
|
|
2517
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
2518
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
2519
|
-
<field name="phase_code">F-CC01-0029</field>
|
|
2520
|
-
<field name="check_closed_child_tickets">False</field>
|
|
2521
|
-
</record>
|
|
2522
|
-
<record id="symple_triplet_phase_A0366_-_In_attesa_Esito_finale_annullamento" model="symple.triplet.phase">
|
|
2523
|
-
<field name="active">True</field>
|
|
2524
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C1063_-_Esito_finale_Annullamento_OK_E-CC01-0070'),ref('symple_triplet_phase_result_C1064_-_Esito_finale_Annullamento_KO_E-CC01-0071'),ref('symple_triplet_phase_result_C1449_-_KO_controlli_RCU___Data_decorrenza_E-CC01-0072'),ref('symple_triplet_phase_result_C1448_-_OK_controlli_RCU_E-CC01-0073'),ref('symple_triplet_phase_result_C1763_-_Annullamento_passivo_dal_SII_E-CC01-0074')])]"/>
|
|
2525
|
-
<field name="child_case">False</field>
|
|
2526
|
-
<field name="code"># Available variables:
|
|
2527
|
-
# - case_id: the case that just reached this phase
|
|
2528
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
2529
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
2530
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
2531
|
-
# - env: Odoo Environment on which the action is triggered
|
|
2532
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
2533
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
2534
|
-
# - ValidationError: Warning Exception to use with raise
|
|
2535
|
-
# - Command: x2Many commands namespace
|
|
2536
|
-
# - OrderedDict: ordered dictionaries
|
|
2537
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
2538
|
-
# (line = case id, func = phase name)
|
|
2539
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
2540
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
2541
|
-
# To return a result, assign: result = {...}
|
|
2542
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
2543
|
-
# phase result will not be set.
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
</field>
|
|
2548
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
2549
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
2550
|
-
<field name="is_compute_refund">False</field>
|
|
2551
|
-
<field name="is_dl">False</field>
|
|
2552
|
-
<field name="is_needs_child_case">False</field>
|
|
2553
|
-
<field name="is_pick_refund_template">False</field>
|
|
2554
|
-
<field name="is_process_managed">False</field>
|
|
2555
|
-
<field name="is_quote_accepted">False</field>
|
|
2556
|
-
<field name="is_quote_sent">False</field>
|
|
2557
|
-
<field name="is_timeout">False</field>
|
|
2558
|
-
<field name="is_voidable">False</field>
|
|
2559
|
-
<field name="name">A0366 - In attesa Esito finale annullamento</field>
|
|
2560
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
2561
|
-
<field name="is_externally_integrated">False</field>
|
|
2562
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
2563
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
2564
|
-
<field name="phase_code">F-CC01-0030</field>
|
|
2565
|
-
<field name="check_closed_child_tickets">False</field>
|
|
2566
|
-
</record>
|
|
2567
|
-
<record id="symple_triplet_phase_A0809_-_Case_Annullato" model="symple.triplet.phase">
|
|
2568
|
-
<field name="active">True</field>
|
|
2569
|
-
<field name="child_case">False</field>
|
|
2570
|
-
<field name="code"># Available variables:
|
|
2571
|
-
# - case_id: the case that just reached this phase
|
|
2572
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
2573
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
2574
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
2575
|
-
# - env: Odoo Environment on which the action is triggered
|
|
2576
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
2577
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
2578
|
-
# - ValidationError: Warning Exception to use with raise
|
|
2579
|
-
# - Command: x2Many commands namespace
|
|
2580
|
-
# - OrderedDict: ordered dictionaries
|
|
2581
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
2582
|
-
# (line = case id, func = phase name)
|
|
2583
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
2584
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
2585
|
-
# To return a result, assign: result = {...}
|
|
2586
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
2587
|
-
# phase result will not be set.
|
|
2588
|
-
|
|
2589
|
-
if case_id.matrix_process_id:
|
|
2590
|
-
case_id.close_matrix_process()
|
|
2591
|
-
|
|
2592
|
-
</field>
|
|
2593
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
2594
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','Cancelled')])" />
|
|
2595
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
2596
|
-
<field name="is_compute_refund">False</field>
|
|
2597
|
-
<field name="is_dl">False</field>
|
|
2598
|
-
<field name="is_needs_child_case">False</field>
|
|
2599
|
-
<field name="is_pick_refund_template">False</field>
|
|
2600
|
-
<field name="is_process_managed">False</field>
|
|
2601
|
-
<field name="is_quote_accepted">False</field>
|
|
2602
|
-
<field name="is_quote_sent">False</field>
|
|
2603
|
-
<field name="is_timeout">False</field>
|
|
2604
|
-
<field name="is_voidable">False</field>
|
|
2605
|
-
<field name="name">A0809 - Case Annullato</field>
|
|
2606
|
-
<field name="set_result_automatically">from_code</field>
|
|
2607
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
2608
|
-
<field name="is_externally_integrated">False</field>
|
|
2609
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
2610
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
2611
|
-
<field name="phase_code">F-CC01-0031</field>
|
|
2612
|
-
<field name="check_closed_child_tickets">False</field>
|
|
2613
|
-
</record>
|
|
2614
|
-
<record id="symple_triplet_phase_A0810_-_Case_Lavorato" model="symple.triplet.phase">
|
|
2615
|
-
<field name="active">True</field>
|
|
2616
|
-
<field name="child_case">False</field>
|
|
2617
|
-
<field name="code">if case_id.matrix_process_id:
|
|
2618
|
-
case_id.close_matrix_process()</field>
|
|
2619
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
2620
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','Done')])" />
|
|
2621
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
2622
|
-
<field name="is_compute_refund">False</field>
|
|
2623
|
-
<field name="is_dl">False</field>
|
|
2624
|
-
<field name="is_needs_child_case">False</field>
|
|
2625
|
-
<field name="is_pick_refund_template">False</field>
|
|
2626
|
-
<field name="is_process_managed">False</field>
|
|
2627
|
-
<field name="is_quote_accepted">False</field>
|
|
2628
|
-
<field name="is_quote_sent">False</field>
|
|
2629
|
-
<field name="is_timeout">False</field>
|
|
2630
|
-
<field name="is_voidable">False</field>
|
|
2631
|
-
<field name="name">A0810 - Case Lavorato</field>
|
|
2632
|
-
<field name="set_result_automatically">from_code</field>
|
|
2633
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
2634
|
-
<field name="is_externally_integrated">False</field>
|
|
2635
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
2636
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
2637
|
-
<field name="phase_code">F-CC01-0032</field>
|
|
2638
|
-
<field name="check_closed_child_tickets">False</field>
|
|
2639
|
-
</record>
|
|
2640
|
-
<record id="symple_triplet_phase_A1833_-_Case_annullato_da_APR" model="symple.triplet.phase">
|
|
2641
|
-
<field name="active">True</field>
|
|
2642
|
-
<field name="child_case">False</field>
|
|
2643
|
-
<field name="code"># Available variables:
|
|
2644
|
-
# - case_id: the case that just reached this phase
|
|
2645
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
2646
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
2647
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
2648
|
-
# - env: Odoo Environment on which the action is triggered
|
|
2649
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
2650
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
2651
|
-
# - ValidationError: Warning Exception to use with raise
|
|
2652
|
-
# - Command: x2Many commands namespace
|
|
2653
|
-
# - OrderedDict: ordered dictionaries
|
|
2654
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
2655
|
-
# (line = case id, func = phase name)
|
|
2656
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
2657
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
2658
|
-
# To return a result, assign: result = {...}
|
|
2659
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
2660
|
-
# phase result will not be set.
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
</field>
|
|
2665
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
2666
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','Cancelled')])" />
|
|
2667
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
2668
|
-
<field name="is_compute_refund">False</field>
|
|
2669
|
-
<field name="is_dl">False</field>
|
|
2670
|
-
<field name="is_needs_child_case">False</field>
|
|
2671
|
-
<field name="is_pick_refund_template">False</field>
|
|
2672
|
-
<field name="is_process_managed">False</field>
|
|
2673
|
-
<field name="is_quote_accepted">False</field>
|
|
2674
|
-
<field name="is_quote_sent">False</field>
|
|
2675
|
-
<field name="is_timeout">False</field>
|
|
2676
|
-
<field name="is_voidable">False</field>
|
|
2677
|
-
<field name="name">A1833 - Case annullato da APR</field>
|
|
2678
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
2679
|
-
<field name="is_externally_integrated">False</field>
|
|
2680
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
2681
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
2682
|
-
<field name="phase_code">F-CC01-0033</field>
|
|
2683
|
-
<field name="check_closed_child_tickets">False</field>
|
|
2684
|
-
</record>
|
|
2685
|
-
<record id="symple_triplet_phase_A1835_-_Case_annullato_da_APN" model="symple.triplet.phase">
|
|
2686
|
-
<field name="active">True</field>
|
|
2687
|
-
<field name="child_case">False</field>
|
|
2688
|
-
<field name="code"># Available variables:
|
|
2689
|
-
# - case_id: the case that just reached this phase
|
|
2690
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
2691
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
2692
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
2693
|
-
# - env: Odoo Environment on which the action is triggered
|
|
2694
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
2695
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
2696
|
-
# - ValidationError: Warning Exception to use with raise
|
|
2697
|
-
# - Command: x2Many commands namespace
|
|
2698
|
-
# - OrderedDict: ordered dictionaries
|
|
2699
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
2700
|
-
# (line = case id, func = phase name)
|
|
2701
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
2702
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
2703
|
-
# To return a result, assign: result = {...}
|
|
2704
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
2705
|
-
# phase result will not be set.
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
</field>
|
|
2710
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
2711
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','Cancelled')])" />
|
|
2712
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
2713
|
-
<field name="is_compute_refund">False</field>
|
|
2714
|
-
<field name="is_dl">False</field>
|
|
2715
|
-
<field name="is_needs_child_case">False</field>
|
|
2716
|
-
<field name="is_pick_refund_template">False</field>
|
|
2717
|
-
<field name="is_process_managed">False</field>
|
|
2718
|
-
<field name="is_quote_accepted">False</field>
|
|
2719
|
-
<field name="is_quote_sent">False</field>
|
|
2720
|
-
<field name="is_timeout">False</field>
|
|
2721
|
-
<field name="is_voidable">False</field>
|
|
2722
|
-
<field name="name">A1835 - Case annullato da APN</field>
|
|
2723
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
2724
|
-
<field name="is_externally_integrated">False</field>
|
|
2725
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
2726
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
2727
|
-
<field name="phase_code">F-CC01-0034</field>
|
|
2728
|
-
<field name="check_closed_child_tickets">False</field>
|
|
2729
|
-
</record>
|
|
2730
|
-
<record id="symple_triplet_phase_A0811_-_Lavorato_KO" model="symple.triplet.phase">
|
|
2731
|
-
<field name="active">True</field>
|
|
2732
|
-
<field name="child_case">False</field>
|
|
2733
|
-
<field name="code">if case_id.matrix_process_id:
|
|
2734
|
-
case_id.close_matrix_process(status="ERROR")</field>
|
|
2735
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
2736
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','Done KO')])" />
|
|
2737
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
2738
|
-
<field name="is_compute_refund">False</field>
|
|
2739
|
-
<field name="is_dl">False</field>
|
|
2740
|
-
<field name="is_needs_child_case">False</field>
|
|
2741
|
-
<field name="is_pick_refund_template">False</field>
|
|
2742
|
-
<field name="is_process_managed">False</field>
|
|
2743
|
-
<field name="is_quote_accepted">False</field>
|
|
2744
|
-
<field name="is_quote_sent">False</field>
|
|
2745
|
-
<field name="is_timeout">False</field>
|
|
2746
|
-
<field name="is_voidable">False</field>
|
|
2747
|
-
<field name="name">A0811 - Lavorato KO</field>
|
|
2748
|
-
<field name="set_result_automatically">from_code</field>
|
|
2749
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
2750
|
-
<field name="is_externally_integrated">False</field>
|
|
2751
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
2752
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
2753
|
-
<field name="phase_code">F-CC01-0035</field>
|
|
2754
|
-
<field name="check_closed_child_tickets">False</field>
|
|
2755
|
-
</record>
|
|
2756
|
-
<record id="symple_triplet_phase_A1590_-_Verifica_Tipologia_Apertura_Case" model="symple.triplet.phase">
|
|
2757
|
-
<field name="active">True</field>
|
|
2758
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C2251_-_Apertura_Case_Manuale_E-CC01-0001-01'),ref('symple_triplet_phase_result_C2252_-_Apertura_Case_Automatica_C')])]"/>
|
|
2759
|
-
<field name="child_case">False</field>
|
|
2760
|
-
<field name="code"># Available variables:
|
|
2761
|
-
# - case_id: the case that just reached this phase
|
|
2762
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
2763
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
2764
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
2765
|
-
# - env: Odoo Environment on which the action is triggered
|
|
2766
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
2767
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
2768
|
-
# - ValidationError: Warning Exception to use with raise
|
|
2769
|
-
# - Command: x2Many commands namespace
|
|
2770
|
-
# - OrderedDict: ordered dictionaries
|
|
2771
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
2772
|
-
# (line = case id, func = phase name)
|
|
2773
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
2774
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
2775
|
-
# To return a result, assign: result = {...}
|
|
2776
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
2777
|
-
# phase result will not be set.
|
|
2778
|
-
try:
|
|
2779
|
-
is_automatic = case_id.is_automatic_case
|
|
2780
|
-
if is_automatic:
|
|
2781
|
-
result = "AUTOMATICO"
|
|
2782
|
-
else:
|
|
2783
|
-
result = "MANUALE"
|
|
2784
|
-
except Exception as e :
|
|
2785
|
-
case_id.write({
|
|
2786
|
-
'info_message':(case_id.info_message + "\n" + str(e)) if case_id.info_message else str(e)
|
|
2787
|
-
})
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
</field>
|
|
2791
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
2792
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','New')])" />
|
|
2793
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
2794
|
-
<field name="is_compute_refund">False</field>
|
|
2795
|
-
<field name="is_dl">False</field>
|
|
2796
|
-
<field name="is_needs_child_case">False</field>
|
|
2797
|
-
<field name="is_pick_refund_template">False</field>
|
|
2798
|
-
<field name="is_process_managed">False</field>
|
|
2799
|
-
<field name="is_quote_accepted">False</field>
|
|
2800
|
-
<field name="is_quote_sent">False</field>
|
|
2801
|
-
<field name="is_timeout">False</field>
|
|
2802
|
-
<field name="is_voidable">False</field>
|
|
2803
|
-
<field name="name">A1590 - Verifica Tipologia Apertura Case</field>
|
|
2804
|
-
<field name="set_result_automatically">from_code</field>
|
|
2805
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
2806
|
-
<field name="is_externally_integrated">False</field>
|
|
2807
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
2808
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
2809
|
-
<field name="check_closed_child_tickets">False</field>
|
|
2810
|
-
</record>
|
|
2811
|
-
<record id="symple_triplet_phase_A1001___Creazione_Case_di_Risoluzione_Contrattuale_Automatica" model="symple.triplet.phase">
|
|
2812
|
-
<field name="active">True</field>
|
|
2813
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C1401_-_Risoluzione_contrattuale_OK_E-CC01-0001-03')])]"/>
|
|
2814
|
-
<field name="child_case">False</field>
|
|
2815
|
-
<field name="code"># Available variables:
|
|
2816
|
-
# - case_id: the case that just reached this phase
|
|
2817
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
2818
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
2819
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
2820
|
-
# - env: Odoo Environment on which the action is triggered
|
|
2821
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
2822
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
2823
|
-
# - ValidationError: Warning Exception to use with raise
|
|
2824
|
-
# - Command: x2Many commands namespace
|
|
2825
|
-
# - OrderedDict: ordered dictionaries
|
|
2826
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
2827
|
-
# (line = case id, func = phase name)
|
|
2828
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
2829
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
2830
|
-
# To return a result, assign: result = {...}
|
|
2831
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
2832
|
-
# phase result will not be set.
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
logs = []
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
def main():
|
|
2839
|
-
if not case_id.service_point_ids:
|
|
2840
|
-
raise ValidationError(
|
|
2841
|
-
"Il case è stato aperto senza service point"
|
|
2842
|
-
)
|
|
2843
|
-
|
|
2844
|
-
sp = case_id.service_point_ids[0]
|
|
2845
|
-
|
|
2846
|
-
if sp.state != "active":
|
|
2847
|
-
raise ValidationError("Il service point non è in stato attivo.")
|
|
2848
|
-
|
|
2849
|
-
return "OK"
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
try:
|
|
2853
|
-
result = main()
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
except Exception as e:
|
|
2857
|
-
logs.append({"message": str(e), "traceback": format_exc()})
|
|
2858
|
-
case_id.write(
|
|
2859
|
-
{"error_message": "Errore durante l'esecuzione della fase: {}".format(str(e))}
|
|
2860
|
-
)
|
|
2861
|
-
|
|
2862
|
-
if logs:
|
|
2863
|
-
log(json_dumps(logs))</field>
|
|
2864
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
2865
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
2866
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
2867
|
-
<field name="is_compute_refund">False</field>
|
|
2868
|
-
<field name="is_dl">False</field>
|
|
2869
|
-
<field name="is_needs_child_case">False</field>
|
|
2870
|
-
<field name="is_pick_refund_template">False</field>
|
|
2871
|
-
<field name="is_process_managed">False</field>
|
|
2872
|
-
<field name="is_quote_accepted">False</field>
|
|
2873
|
-
<field name="is_quote_sent">False</field>
|
|
2874
|
-
<field name="is_timeout">False</field>
|
|
2875
|
-
<field name="is_voidable">False</field>
|
|
2876
|
-
<field name="name">A1001 – Creazione Case di Risoluzione Contrattuale Automatica</field>
|
|
2877
|
-
<field name="set_result_automatically">from_code</field>
|
|
2878
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
2879
|
-
<field name="is_externally_integrated">False</field>
|
|
2880
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
2881
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
2882
|
-
<field name="check_closed_child_tickets">False</field>
|
|
2883
|
-
</record>
|
|
2884
|
-
<record id="symple_triplet_phase_A1556_-_Verica_commodity" model="symple.triplet.phase">
|
|
2885
|
-
<field name="active">True</field>
|
|
2886
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C2222___Commodity_Gas_E-CC01-0001-04'),ref('symple_triplet_phase_result_C2221_-_Commodity_Elettricit__E-CC01-0001-06')])]"/>
|
|
2887
|
-
<field name="child_case">False</field>
|
|
2888
|
-
<field name="code"># Available variables:
|
|
2889
|
-
# - case_id: the case that just reached this phase
|
|
2890
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
2891
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
2892
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
2893
|
-
# - env: Odoo Environment on which the action is triggered
|
|
2894
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
2895
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
2896
|
-
# - ValidationError: Warning Exception to use with raise
|
|
2897
|
-
# - Command: x2Many commands namespace
|
|
2898
|
-
# - OrderedDict: ordered dictionaries
|
|
2899
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
2900
|
-
# (line = case id, func = phase name)
|
|
2901
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
2902
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
2903
|
-
# To return a result, assign: result = {...}
|
|
2904
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
2905
|
-
# phase result will not be set.
|
|
2906
|
-
|
|
2907
|
-
sp = case_id.service_point_ids[0]
|
|
2908
|
-
|
|
2909
|
-
if sp.pod_id:
|
|
2910
|
-
result = "ELE"
|
|
2911
|
-
elif sp.pdr_id:
|
|
2912
|
-
result= "GAS"</field>
|
|
2913
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
2914
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
2915
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
2916
|
-
<field name="is_compute_refund">False</field>
|
|
2917
|
-
<field name="is_dl">False</field>
|
|
2918
|
-
<field name="is_needs_child_case">False</field>
|
|
2919
|
-
<field name="is_pick_refund_template">False</field>
|
|
2920
|
-
<field name="is_process_managed">False</field>
|
|
2921
|
-
<field name="is_quote_accepted">False</field>
|
|
2922
|
-
<field name="is_quote_sent">False</field>
|
|
2923
|
-
<field name="is_timeout">False</field>
|
|
2924
|
-
<field name="is_voidable">False</field>
|
|
2925
|
-
<field name="name">A1556 - Verica commodity</field>
|
|
2926
|
-
<field name="set_result_automatically">from_code</field>
|
|
2927
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
2928
|
-
<field name="is_externally_integrated">False</field>
|
|
2929
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
2930
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
2931
|
-
<field name="check_closed_child_tickets">False</field>
|
|
2932
|
-
</record>
|
|
2933
|
-
<record id="symple_triplet_phase_A2598_-_Invio_Pec" model="symple.triplet.phase">
|
|
2934
|
-
<field name="active">True</field>
|
|
2935
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C1019_-_Inviata_E-CC01-0001-05')])]"/>
|
|
2936
|
-
<field name="automatic_phase_result_id" ref="symple_triplet_phase_result_C1019_-_Inviata_E-CC01-0001-05"/>
|
|
2937
|
-
<field name="automatic_template_id" model="mail.template" eval="obj().search([('name','=','TEST PEC TG (copia)')])" />
|
|
2938
|
-
<field name="child_case">False</field>
|
|
2939
|
-
<field name="code"># Available variables:
|
|
2940
|
-
# - case_id: the case that just reached this phase
|
|
2941
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
2942
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
2943
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
2944
|
-
# - env: Odoo Environment on which the action is triggered
|
|
2945
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
2946
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
2947
|
-
# - ValidationError: Warning Exception to use with raise
|
|
2948
|
-
# - Command: x2Many commands namespace
|
|
2949
|
-
# - OrderedDict: ordered dictionaries
|
|
2950
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
2951
|
-
# (line = case id, func = phase name)
|
|
2952
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
2953
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
2954
|
-
# To return a result, assign: result = {...}
|
|
2955
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
2956
|
-
# phase result will not be set.
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
</field>
|
|
2961
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','Customer Care')])" />
|
|
2962
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
2963
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
2964
|
-
<field name="is_compute_refund">False</field>
|
|
2965
|
-
<field name="is_dl">False</field>
|
|
2966
|
-
<field name="is_mail_managed">manually</field>
|
|
2967
|
-
<field name="is_needs_child_case">False</field>
|
|
2968
|
-
<field name="is_pick_refund_template">False</field>
|
|
2969
|
-
<field name="is_process_managed">True</field>
|
|
2970
|
-
<field name="is_quote_accepted">False</field>
|
|
2971
|
-
<field name="is_quote_sent">False</field>
|
|
2972
|
-
<field name="is_timeout">False</field>
|
|
2973
|
-
<field name="is_voidable">False</field>
|
|
2974
|
-
<field name="name">A2598 - Invio Pec</field>
|
|
2975
|
-
<field name="set_result_automatically">from_email</field>
|
|
2976
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
2977
|
-
<field name="is_externally_integrated">False</field>
|
|
2978
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
2979
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
2980
|
-
<field name="check_closed_child_tickets">False</field>
|
|
2981
|
-
</record>
|
|
2982
|
-
<record id="symple_triplet_phase_A2338_-_Inserimento_Pratica" model="symple.triplet.phase">
|
|
2983
|
-
<field name="active">True</field>
|
|
2984
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C3118_-_KO_AtoA_pdc_E-CC01-0014'),ref('symple_triplet_phase_result_C3117_-_OK_pratica_inserita_E-CC01-00081')])]"/>
|
|
2985
|
-
<field name="child_case">False</field>
|
|
2986
|
-
<field name="code"># Available variables:
|
|
2987
|
-
# - case_id: the case that just reached this phase
|
|
2988
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
2989
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
2990
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
2991
|
-
# - env: Odoo Environment on which the action is triggered
|
|
2992
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
2993
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
2994
|
-
# - ValidationError: Warning Exception to use with raise
|
|
2995
|
-
# - Command: x2Many commands namespace
|
|
2996
|
-
# - OrderedDict: ordered dictionaries
|
|
2997
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
2998
|
-
# (line = case id, func = phase name)
|
|
2999
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
3000
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
3001
|
-
# To return a result, assign: result = {...}
|
|
3002
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
3003
|
-
# phase result will not be set.
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
</field>
|
|
3008
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
3009
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
3010
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
3011
|
-
<field name="is_compute_refund">False</field>
|
|
3012
|
-
<field name="is_dl">False</field>
|
|
3013
|
-
<field name="is_needs_child_case">False</field>
|
|
3014
|
-
<field name="is_pick_refund_template">False</field>
|
|
3015
|
-
<field name="is_process_managed">False</field>
|
|
3016
|
-
<field name="is_quote_accepted">False</field>
|
|
3017
|
-
<field name="is_quote_sent">False</field>
|
|
3018
|
-
<field name="is_timeout">False</field>
|
|
3019
|
-
<field name="is_voidable">False</field>
|
|
3020
|
-
<field name="name">A2338 - Inserimento Pratica</field>
|
|
3021
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
3022
|
-
<field name="is_externally_integrated">False</field>
|
|
3023
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
3024
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
3025
|
-
<field name="check_closed_child_tickets">False</field>
|
|
3026
|
-
</record>
|
|
3027
|
-
<record id="symple_triplet_phase_A2561_-_verifica_stato_invio_pratica_da_annullare" model="symple.triplet.phase">
|
|
3028
|
-
<field name="active">True</field>
|
|
3029
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C3120_-_annullamento_da_gestire_E-CC01-00083'),ref('symple_triplet_phase_result_C2599_-_annullamento_confermato_E-CC01-00084')])]"/>
|
|
3030
|
-
<field name="child_case">False</field>
|
|
3031
|
-
<field name="code"># Available variables:
|
|
3032
|
-
# - case_id: the case that just reached this phase
|
|
3033
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
3034
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
3035
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
3036
|
-
# - env: Odoo Environment on which the action is triggered
|
|
3037
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
3038
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
3039
|
-
# - ValidationError: Warning Exception to use with raise
|
|
3040
|
-
# - Command: x2Many commands namespace
|
|
3041
|
-
# - OrderedDict: ordered dictionaries
|
|
3042
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
3043
|
-
# (line = case id, func = phase name)
|
|
3044
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
3045
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
3046
|
-
# To return a result, assign: result = {...}
|
|
3047
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
3048
|
-
# phase result will not be set.
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
</field>
|
|
3053
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
3054
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
3055
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
3056
|
-
<field name="is_compute_refund">False</field>
|
|
3057
|
-
<field name="is_dl">False</field>
|
|
3058
|
-
<field name="is_needs_child_case">False</field>
|
|
3059
|
-
<field name="is_pick_refund_template">False</field>
|
|
3060
|
-
<field name="is_process_managed">False</field>
|
|
3061
|
-
<field name="is_quote_accepted">False</field>
|
|
3062
|
-
<field name="is_quote_sent">False</field>
|
|
3063
|
-
<field name="is_timeout">False</field>
|
|
3064
|
-
<field name="is_voidable">False</field>
|
|
3065
|
-
<field name="name">A2561 - verifica stato invio pratica da annullare</field>
|
|
3066
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
3067
|
-
<field name="is_externally_integrated">False</field>
|
|
3068
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
3069
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
3070
|
-
<field name="check_closed_child_tickets">False</field>
|
|
3071
|
-
</record>
|
|
3072
|
-
<record id="symple_triplet_phase_A0832_-_Invio_Richiesta_Annullamento" model="symple.triplet.phase">
|
|
3073
|
-
<field name="active">True</field>
|
|
3074
|
-
<field name="allowed_phase_result_ids" model="symple.triplet.phase.result" eval="[(6, 0, [ref('symple_triplet_phase_result_C3118_-_KO_AtoA_pdc_E-CC01-0044'),ref('symple_triplet_phase_result_C2875_-_OK_-_Inviato_Annullamento_al_SII_E-CC01-00085')])]"/>
|
|
3075
|
-
<field name="child_case">False</field>
|
|
3076
|
-
<field name="code"># Available variables:
|
|
3077
|
-
# - case_id: the case that just reached this phase
|
|
3078
|
-
# - request: allows you to make HTTP requests (method, url, headers, data)
|
|
3079
|
-
# - json_dumps: allows you to use JSON.dumps to convert an object into a json
|
|
3080
|
-
# - json_load: allows you to use JSON.load to convert a json into an object
|
|
3081
|
-
# - env: Odoo Environment on which the action is triggered
|
|
3082
|
-
# - time, datetime, dateutil, timezone: useful Python libraries
|
|
3083
|
-
# - float_compare: Odoo function to compare floats based on specific precisions
|
|
3084
|
-
# - ValidationError: Warning Exception to use with raise
|
|
3085
|
-
# - Command: x2Many commands namespace
|
|
3086
|
-
# - OrderedDict: ordered dictionaries
|
|
3087
|
-
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
|
|
3088
|
-
# (line = case id, func = phase name)
|
|
3089
|
-
# - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
|
|
3090
|
-
# - first: forwarded from odoo.fields.first - safely gets first element of recordset
|
|
3091
|
-
# To return a result, assign: result = {...}
|
|
3092
|
-
# WARNING: if return = False or return value is not in the result table or no result is returned at all,
|
|
3093
|
-
# phase result will not be set.
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
</field>
|
|
3098
|
-
<field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
|
|
3099
|
-
<field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
|
|
3100
|
-
<field name="is_a_postalizer_phase">False</field>
|
|
3101
|
-
<field name="is_compute_refund">False</field>
|
|
3102
|
-
<field name="is_dl">False</field>
|
|
3103
|
-
<field name="is_needs_child_case">False</field>
|
|
3104
|
-
<field name="is_pick_refund_template">False</field>
|
|
3105
|
-
<field name="is_process_managed">False</field>
|
|
3106
|
-
<field name="is_quote_accepted">False</field>
|
|
3107
|
-
<field name="is_quote_sent">False</field>
|
|
3108
|
-
<field name="is_timeout">False</field>
|
|
3109
|
-
<field name="is_voidable">False</field>
|
|
3110
|
-
<field name="name">A0832 - Invio Richiesta Annullamento</field>
|
|
3111
|
-
<field name="workflow_id" ref="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE"/>
|
|
3112
|
-
<field name="is_externally_integrated">False</field>
|
|
3113
|
-
<field name="is_process_cancellable_relaunchable">False</field>
|
|
3114
|
-
<field name="wizard_info">{"key":"value"}</field>
|
|
3115
|
-
<field name="check_closed_child_tickets">False</field>
|
|
3116
|
-
</record>
|
|
3117
|
-
|
|
3118
|
-
</data>
|
|
3119
|
-
</odoo>
|
|
3120
|
-
|
|
3121
|
-
Processed_records: 42
|
|
3122
|
-
Managed records: 42
|