@waron97/prbot 1.0.0

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.
Files changed (18) hide show
  1. package/dotenv +85908 -0
  2. package/example.xml +3903 -0
  3. package/index.js +247 -0
  4. package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE - Relazioni mancanti: Fasi - Workflow e Fasi - Esiti Consentiti_2026-01-23 09:21:16.xml +3122 -0
  5. package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE - Relazioni mancanti: Fasi - Workflow e Fasi - Esiti Consentiti_2026-01-23 09:25:03.xml +3122 -0
  6. package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE - Relazioni mancanti: Fasi - Workflow e Fasi - Esiti Consentiti_2026-01-23 09:28:23.xml +3122 -0
  7. package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE - Relazioni mancanti: Fasi - Workflow e Fasi - Esiti Consentiti_2026-01-23 09:31:30.xml +3122 -0
  8. package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE - Relazioni mancanti: Fasi - Workflow e Fasi - Esiti Consentiti_2026-01-26 22:53:31.xml +3170 -0
  9. package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE - Relazioni mancanti: Fasi - Workflow e Fasi - Esiti Consentiti_2026-01-29 09:38:23.xml +3170 -0
  10. package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE_2026-01-23 09:21:17.xml +4160 -0
  11. package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE_2026-01-23 09:25:05.xml +4160 -0
  12. package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE_2026-01-23 09:28:25.xml +4160 -0
  13. package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE_2026-01-23 09:31:31.xml +4160 -0
  14. package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE_2026-01-26 22:53:34.xml +4208 -0
  15. package/out/xml_data_for_ML - RISOLUZIONE CONTRATTUALE_2026-01-29 09:38:25.xml +4208 -0
  16. 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" +2358 -0
  17. package/out/xml_data_for_ML - Taglio Colonna Gas per Morosit/303/240_2026-01-26 22:57:40.xml" +3667 -0
  18. package/package.json +31 -0
@@ -0,0 +1,4208 @@
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_process_ids" model="symple.pb.process" eval="[(6, 0, obj().search([('name','in',('ml_cessazioni_point_selection',)),]).ids)]" />
6
+ <field name="child_case">False</field>
7
+ <field name="code"># Available variables:
8
+ # - case_id: the case that just reached this phase
9
+ # - request: allows you to make HTTP requests (method, url, headers, data)
10
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
11
+ # - json_load: allows you to use JSON.load to convert a json into an object
12
+ # - env: Odoo Environment on which the action is triggered
13
+ # - time, datetime, dateutil, timezone: useful Python libraries
14
+ # - float_compare: Odoo function to compare floats based on specific precisions
15
+ # - ValidationError: Warning Exception to use with raise
16
+ # - Command: x2Many commands namespace
17
+ # - OrderedDict: ordered dictionaries
18
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
19
+ # (line = case id, func = phase name)
20
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
21
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
22
+ # To return a result, assign: result = {...}
23
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
24
+ # phase result will not be set.
25
+
26
+
27
+
28
+ </field>
29
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','Customer Care')])" />
30
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
31
+ <field name="is_a_postalizer_phase">False</field>
32
+ <field name="is_compute_refund">False</field>
33
+ <field name="is_dl">False</field>
34
+ <field name="is_needs_child_case">False</field>
35
+ <field name="is_pick_refund_template">False</field>
36
+ <field name="is_process_managed">True</field>
37
+ <field name="is_quote_accepted">False</field>
38
+ <field name="is_quote_sent">False</field>
39
+ <field name="is_timeout">False</field>
40
+ <field name="is_voidable">False</field>
41
+ <field name="name">A1001 - Apertura Wizard Risoluzione contrattuale</field>
42
+ </record>
43
+ <record id="symple_triplet_phase_A1709_-_verifica_compatibilit_" model="symple.triplet.phase">
44
+ <field name="active">True</field>
45
+ <field name="child_case">False</field>
46
+ <field name="code">def main():
47
+ service_point = case_id.service_point_ids[0]
48
+ billing_profile = service_point.billing_profile_id
49
+ asset = service_point.asset(active=False)
50
+
51
+ if not asset:
52
+ asset_id = False
53
+ else:
54
+ asset_id = asset._id
55
+
56
+ (result, incompatible_case_ids) = ( # "OK" | "KO" | "PARTIAL_KO" # List[int]
57
+ case_id.check_compatibility_matrix(
58
+ asset_id=asset_id,
59
+ client_id=case_id.customer_id.user_sequence,
60
+ billing_id=billing_profile.name,
61
+ # external_id -> default a case.ticket_type_id.univocal_code
62
+ )
63
+ )
64
+
65
+ if incompatible_case_ids:
66
+ case_id.write({"incompatible_ticket_ids": incompatible_case_ids})
67
+
68
+ if result in ["OK", "PARTIAL_KO"]:
69
+ case_id.create_matrix_process(
70
+ asset_id=asset_id,
71
+ client_id=case_id.customer_id.user_sequence,
72
+ billing_id=billing_profile.name,
73
+ # external_id -> default a case.ticket_type_id.univocal_code
74
+ )
75
+
76
+ return result
77
+
78
+
79
+ try:
80
+ result = main()
81
+ except Exception as e:
82
+ log(format_exc())
83
+ case_id.write({"error_message": str(e)})
84
+ </field>
85
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
86
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
87
+ <field name="is_a_postalizer_phase">False</field>
88
+ <field name="is_compute_refund">False</field>
89
+ <field name="is_dl">False</field>
90
+ <field name="is_needs_child_case">False</field>
91
+ <field name="is_pick_refund_template">False</field>
92
+ <field name="is_process_managed">False</field>
93
+ <field name="is_quote_accepted">False</field>
94
+ <field name="is_quote_sent">False</field>
95
+ <field name="is_timeout">False</field>
96
+ <field name="is_voidable">False</field>
97
+ <field name="name">A1709 - verifica compatibilità</field>
98
+ <field name="set_result_automatically">from_code</field>
99
+ </record>
100
+ <record id="symple_triplet_phase_result_C1401_-_Risoluzione_contrattuale_OK_E-CC01-0002" model="symple.triplet.phase.result">
101
+ <field name="active">True</field>
102
+ <field name="has_message">False</field>
103
+ <field name="is_annulment">False</field>
104
+ <field name="is_dl_solicitation_result">False</field>
105
+ <field name="is_hidden">False</field>
106
+ <field name="is_quote_expired">False</field>
107
+ <field name="name">C1401 - Risoluzione contrattuale OK</field>
108
+ <field name="next_phase_id" ref="symple_triplet_phase_A1709_-_verifica_compatibilit_"/>
109
+ <field name="state_code">E-CC01-0002</field>
110
+ <field name="wizard_result">SUCCESS</field>
111
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1001_-_Apertura_Wizard_Risoluzione_contrattuale')])]"/>
112
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
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="child_case">False</field>
117
+ <field name="code"># Available variables:
118
+ # - case_id: the case that just reached this phase
119
+ # - request: allows you to make HTTP requests (method, url, headers, data)
120
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
121
+ # - json_load: allows you to use JSON.load to convert a json into an object
122
+ # - env: Odoo Environment on which the action is triggered
123
+ # - time, datetime, dateutil, timezone: useful Python libraries
124
+ # - float_compare: Odoo function to compare floats based on specific precisions
125
+ # - ValidationError: Warning Exception to use with raise
126
+ # - Command: x2Many commands namespace
127
+ # - OrderedDict: ordered dictionaries
128
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
129
+ # (line = case id, func = phase name)
130
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
131
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
132
+ # To return a result, assign: result = {...}
133
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
134
+ # phase result will not be set.
135
+
136
+
137
+
138
+ </field>
139
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','BOT')])" />
140
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
141
+ <field name="is_a_postalizer_phase">False</field>
142
+ <field name="is_compute_refund">False</field>
143
+ <field name="is_dl">False</field>
144
+ <field name="is_needs_child_case">False</field>
145
+ <field name="is_pick_refund_template">False</field>
146
+ <field name="is_process_managed">False</field>
147
+ <field name="is_quote_accepted">False</field>
148
+ <field name="is_quote_sent">False</field>
149
+ <field name="is_timeout">False</field>
150
+ <field name="is_voidable">False</field>
151
+ <field name="name">A1710 - Verifica compatibilità KO</field>
152
+ </record>
153
+ <record id="symple_triplet_phase_result_C404_-_KO_-_Incompatibile_E-CC01-0003" model="symple.triplet.phase.result">
154
+ <field name="active">True</field>
155
+ <field name="has_message">False</field>
156
+ <field name="is_annulment">False</field>
157
+ <field name="is_dl_solicitation_result">False</field>
158
+ <field name="is_hidden">False</field>
159
+ <field name="is_quote_expired">False</field>
160
+ <field name="name">C404 - KO - Incompatibile</field>
161
+ <field name="next_phase_id" ref="symple_triplet_phase_A1710_-_Verifica_compatibilit__KO"/>
162
+ <field name="state_code">E-CC01-0003</field>
163
+ <field name="wizard_result">KO</field>
164
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1709_-_verifica_compatibilit_')])]"/>
165
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','KO')])" />
166
+ </record>
167
+ <record id="symple_triplet_phase_result_C2410_-_OK_Incompatibilit__Gestita_E-CC01-0007" model="symple.triplet.phase.result">
168
+ <field name="active">True</field>
169
+ <field name="has_message">False</field>
170
+ <field name="is_annulment">False</field>
171
+ <field name="is_dl_solicitation_result">False</field>
172
+ <field name="is_hidden">False</field>
173
+ <field name="is_quote_expired">False</field>
174
+ <field name="name">C2410 - OK Incompatibilità Gestita</field>
175
+ <field name="next_phase_id" ref="symple_triplet_phase_A1709_-_verifica_compatibilit_"/>
176
+ <field name="state_code">E-CC01-0007</field>
177
+ <field name="wizard_result">SUCCESS</field>
178
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1710_-_Verifica_compatibilit__KO')])]"/>
179
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
180
+ </record>
181
+ <record id="symple_triplet_phase_A1672_-_Recupero_dati_a_CRM" model="symple.triplet.phase">
182
+ <field name="active">True</field>
183
+ <field name="child_case">False</field>
184
+ <field name="code"><![CDATA[# Available variables:
185
+ # - case_id: the case that just reached this phase
186
+ # - request: allows you to make HTTP requests (method, url, headers, data)
187
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
188
+ # - json_load: allows you to use JSON.load to convert a json into an object
189
+ # - env: Odoo Environment on which the action is triggered
190
+ # - time, datetime, dateutil, timezone: useful Python libraries
191
+ # - float_compare: Odoo function to compare floats based on specific precisions
192
+ # - ValidationError: Warning Exception to use with raise
193
+ # - Command: x2Many commands namespace
194
+ # - OrderedDict: ordered dictionaries
195
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
196
+ # (line = case id, func = phase name)
197
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
198
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
199
+ # To return a result, assign: result = {...}
200
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
201
+ # phase result will not be set.
202
+
203
+
204
+ logs = []
205
+
206
+
207
+ def fmt(date):
208
+ return date.strftime("%d/%m/%Y")
209
+
210
+
211
+ def last_day_of_this_month():
212
+ today = datetime.datetime.today()
213
+ first_of_next_month = today.replace(day=1) + dateutil.relativedelta.relativedelta(
214
+ months=1
215
+ )
216
+ last_day = first_of_next_month - dateutil.relativedelta.relativedelta(days=1)
217
+ return last_day
218
+
219
+
220
+ def last_day_of_next_month():
221
+ today = datetime.datetime.today()
222
+ first_of_next_month = today.replace(day=1) + dateutil.relativedelta.relativedelta(
223
+ months=2
224
+ )
225
+ last_day = first_of_next_month - dateutil.relativedelta.relativedelta(days=1)
226
+ return last_day
227
+
228
+
229
+ def last_day_of_next_next_month():
230
+ today = datetime.datetime.today()
231
+ first_of_next_month = today.replace(day=1) + dateutil.relativedelta.relativedelta(
232
+ months=3
233
+ )
234
+ last_day = first_of_next_month - dateutil.relativedelta.relativedelta(days=1)
235
+ return last_day
236
+
237
+
238
+ def ten_days_from_now():
239
+ today = datetime.datetime.today()
240
+ return today + dateutil.relativedelta.relativedelta(days=10)
241
+
242
+
243
+ # ------------------------------------------------
244
+
245
+
246
+ def get_tipologia_risoluzione():
247
+ table = {
248
+ "CC01-1": ("CAE0", None),
249
+ "CC01-2": ("CAE0", None),
250
+ "CC02": ("CAE8", "CA7"),
251
+ "CC03-1": ("CAE5", "CA5"),
252
+ "CC04-1": ("CAE8", "CA4"),
253
+ "CC05-1": ("CAE2", "CA6"),
254
+ "CC06-1": ("CAE8", "CA7"),
255
+ "CC12-1": ("CAE1", "CA1"),
256
+ "CC13-1": ("CAE8", "CA7"),
257
+ "CC26-1": ("CAE7", "CA3"),
258
+ "CC27-1": ("CAE3", "CA2"),
259
+ }
260
+
261
+ code = case_id.ticket_type_id.code
262
+
263
+ if code not in table:
264
+ raise ValidationError(
265
+ "Non è possibile determinare la tipologia di risoluzione per il dettaglio {}".format(
266
+ code
267
+ )
268
+ )
269
+
270
+ power, gas = table.get(code)
271
+
272
+ sp = first(case_id.service_point_ids)
273
+
274
+ if sp.pod_id and power:
275
+ return power
276
+
277
+ if sp.pdr_id and gas:
278
+ return gas
279
+
280
+ raise ValidationError(
281
+ "Non è possibile determinare la tipologia di risoluzione per il dettaglio {}".format(
282
+ code
283
+ )
284
+ )
285
+
286
+
287
+ def get_data_decorrenza(tipologia_risoluzione):
288
+ today = datetime.datetime.today()
289
+ code = case_id.ticket_type_id.code
290
+
291
+ # -------- Special Case --------
292
+
293
+ if tipologia_risoluzione == "CA1":
294
+ return fmt(ten_days_from_now())
295
+
296
+ if tipologia_risoluzione in ["CA2", "CA3"]:
297
+ return fmt(last_day_of_next_next_month())
298
+
299
+ if (
300
+ tipologia_risoluzione == "CA4"
301
+ and code == "CC04-1"
302
+ and case_id.customer_id.customer_care_category == "pmi"
303
+ ):
304
+ voltura_start_date = (
305
+ today # TODO get real voltura_start_date, don't yet know how
306
+ )
307
+ if voltura_start_date <= today:
308
+ if today.day <= 10:
309
+ return fmt(last_day_of_this_month())
310
+ return fmt(last_day_of_next_month())
311
+ else:
312
+ return fmt(voltura_start_date)
313
+
314
+ # -------- Default Case --------
315
+
316
+ if today.day <= 10:
317
+ return fmt(last_day_of_this_month())
318
+ return fmt(last_day_of_next_month())
319
+
320
+
321
+ # ------------------------------------------------
322
+
323
+
324
+ def main():
325
+ tipologia_risoluzione = get_tipologia_risoluzione()
326
+
327
+ kv_store = case_id.sudo().kv_store()
328
+ data_decorrenza = get_data_decorrenza(tipologia_risoluzione)
329
+ ifs_data = {
330
+ "tipologia_risoluzione": tipologia_risoluzione,
331
+ "data_decorrenza": data_decorrenza,
332
+ }
333
+ kv_store.sudo().set("ifs_data", ifs_data)
334
+ case_id.write(
335
+ {
336
+ "disconnect_date": datetime.datetime.strptime(
337
+ data_decorrenza, "%d/%m/%Y"
338
+ ).date()
339
+ }
340
+ )
341
+
342
+ sp = first(case_id.service_point_ids)
343
+ asset = sp.asset(active=True) # solo sm_state attivo
344
+
345
+ if not asset:
346
+ raise Exception("Asset attivo non trovato per il punto {}".format(sp.code))
347
+
348
+ case_id.sudo().kv_store().set("asset", asset.data)
349
+
350
+ date_fmt = datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S.%f") + "Z"
351
+
352
+ sp.sudo().write({"state": "deactivating"})
353
+ env["ir.config_parameter"].update_b2w_statemodel(
354
+ "in_cessazione",
355
+ sm_reason=case_id.ticket_type_id.name,
356
+ expected_date=date_fmt,
357
+ asset_id=str(asset._id),
358
+ )
359
+
360
+ return "OK"
361
+
362
+
363
+ try:
364
+ result = main()
365
+ except Exception as e:
366
+ logs.append({"message": str(e), "traceback": format_exc()})
367
+ case_id.write(
368
+ {"error_message": "Errore durante l'esecuzione della fase: {}".format(str(e))}
369
+ )
370
+
371
+
372
+ if logs:
373
+ log(json_dumps(logs))]]></field>
374
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
375
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
376
+ <field name="is_a_postalizer_phase">False</field>
377
+ <field name="is_compute_refund">False</field>
378
+ <field name="is_dl">False</field>
379
+ <field name="is_needs_child_case">False</field>
380
+ <field name="is_pick_refund_template">False</field>
381
+ <field name="is_process_managed">False</field>
382
+ <field name="is_quote_accepted">False</field>
383
+ <field name="is_quote_sent">False</field>
384
+ <field name="is_timeout">False</field>
385
+ <field name="is_voidable">False</field>
386
+ <field name="name">A1672 - Recupero dati a CRM</field>
387
+ <field name="set_result_automatically">from_code</field>
388
+ </record>
389
+ <record id="symple_triplet_phase_result_C2654_-_Processo_Compatibile_E-CC01-0004" model="symple.triplet.phase.result">
390
+ <field name="active">True</field>
391
+ <field name="has_message">False</field>
392
+ <field name="is_annulment">False</field>
393
+ <field name="is_dl_solicitation_result">False</field>
394
+ <field name="is_hidden">False</field>
395
+ <field name="is_quote_expired">False</field>
396
+ <field name="name">C2654 - Processo Compatibile</field>
397
+ <field name="next_phase_id" ref="symple_triplet_phase_A1672_-_Recupero_dati_a_CRM"/>
398
+ <field name="state_code">E-CC01-0004</field>
399
+ <field name="wizard_result">SUCCESS</field>
400
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1709_-_verifica_compatibilit_')])]"/>
401
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
402
+ </record>
403
+ <record id="symple_triplet_phase_result_C2639_-_Incompatibilit__Non_bloccante_E-CC01-0005" model="symple.triplet.phase.result">
404
+ <field name="active">True</field>
405
+ <field name="has_message">False</field>
406
+ <field name="is_annulment">False</field>
407
+ <field name="is_dl_solicitation_result">False</field>
408
+ <field name="is_hidden">False</field>
409
+ <field name="is_quote_expired">False</field>
410
+ <field name="name">C2639 - Incompatibilità Non bloccante</field>
411
+ <field name="next_phase_id" ref="symple_triplet_phase_A1672_-_Recupero_dati_a_CRM"/>
412
+ <field name="state_code">E-CC01-0005</field>
413
+ <field name="wizard_result">PARTIAL_KO</field>
414
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1709_-_verifica_compatibilit_')])]"/>
415
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Partial KO')])" />
416
+ </record>
417
+ <record id="symple_triplet_phase_A1323_-_Errore_CRM__Recupero_dati_" model="symple.triplet.phase">
418
+ <field name="active">True</field>
419
+ <field name="child_case">False</field>
420
+ <field name="code"># Available variables:
421
+ # - case_id: the case that just reached this phase
422
+ # - request: allows you to make HTTP requests (method, url, headers, data)
423
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
424
+ # - json_load: allows you to use JSON.load to convert a json into an object
425
+ # - env: Odoo Environment on which the action is triggered
426
+ # - time, datetime, dateutil, timezone: useful Python libraries
427
+ # - float_compare: Odoo function to compare floats based on specific precisions
428
+ # - ValidationError: Warning Exception to use with raise
429
+ # - Command: x2Many commands namespace
430
+ # - OrderedDict: ordered dictionaries
431
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
432
+ # (line = case id, func = phase name)
433
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
434
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
435
+ # To return a result, assign: result = {...}
436
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
437
+ # phase result will not be set.
438
+
439
+
440
+
441
+ </field>
442
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','AMS')])" />
443
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
444
+ <field name="is_a_postalizer_phase">False</field>
445
+ <field name="is_compute_refund">False</field>
446
+ <field name="is_dl">False</field>
447
+ <field name="is_needs_child_case">False</field>
448
+ <field name="is_pick_refund_template">False</field>
449
+ <field name="is_process_managed">False</field>
450
+ <field name="is_quote_accepted">False</field>
451
+ <field name="is_quote_sent">False</field>
452
+ <field name="is_timeout">False</field>
453
+ <field name="is_voidable">False</field>
454
+ <field name="name">A1323 - Errore CRM (Recupero dati)</field>
455
+ </record>
456
+ <record id="symple_triplet_phase_result_C1933_-_Recupero_Dati_KO_E-CC01-0009" model="symple.triplet.phase.result">
457
+ <field name="active">True</field>
458
+ <field name="has_message">False</field>
459
+ <field name="is_annulment">False</field>
460
+ <field name="is_dl_solicitation_result">False</field>
461
+ <field name="is_hidden">False</field>
462
+ <field name="is_quote_expired">False</field>
463
+ <field name="name">C1933 - Recupero Dati KO</field>
464
+ <field name="next_phase_id" ref="symple_triplet_phase_A1323_-_Errore_CRM__Recupero_dati_"/>
465
+ <field name="state_code">E-CC01-0009</field>
466
+ <field name="wizard_result">KO</field>
467
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1672_-_Recupero_dati_a_CRM')])]"/>
468
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','KO')])" />
469
+ </record>
470
+ <record id="symple_triplet_phase_result_C1616_-_Risoluzione_Errore_E-CC01-0010" model="symple.triplet.phase.result">
471
+ <field name="active">True</field>
472
+ <field name="has_message">False</field>
473
+ <field name="is_annulment">False</field>
474
+ <field name="is_dl_solicitation_result">False</field>
475
+ <field name="is_hidden">False</field>
476
+ <field name="is_quote_expired">False</field>
477
+ <field name="name">C1616 - Risoluzione Errore</field>
478
+ <field name="next_phase_id" ref="symple_triplet_phase_A1672_-_Recupero_dati_a_CRM"/>
479
+ <field name="state_code">E-CC01-0010</field>
480
+ <field name="wizard_result">SUCCESS</field>
481
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1323_-_Errore_CRM__Recupero_dati_')])]"/>
482
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
483
+ </record>
484
+ <record id="symple_triplet_phase_A1559_-_Invio_alla_Market_Communication" model="symple.triplet.phase">
485
+ <field name="active">True</field>
486
+ <field name="child_case">False</field>
487
+ <field name="code"># Available variables:
488
+ # - case_id: the case that just reached this phase
489
+ # - request: allows you to make HTTP requests (method, url, headers, data)
490
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
491
+ # - json_load: allows you to use JSON.load to convert a json into an object
492
+ # - env: Odoo Environment on which the action is triggered
493
+ # - time, datetime, dateutil, timezone: useful Python libraries
494
+ # - float_compare: Odoo function to compare floats based on specific precisions
495
+ # - ValidationError: Warning Exception to use with raise
496
+ # - Command: x2Many commands namespace
497
+ # - OrderedDict: ordered dictionaries
498
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
499
+ # (line = case id, func = phase name)
500
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
501
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
502
+ # To return a result, assign: result = {...}
503
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
504
+ # phase result will not be set.
505
+
506
+
507
+ logs = []
508
+
509
+ # ------------------------------
510
+
511
+
512
+ def get_addizione_regionale():
513
+ return case_id.service_point_ids[0].regional_surcharge_value
514
+
515
+
516
+ # ------------------------------
517
+
518
+
519
+ def get_resubmit_bindings():
520
+ return {
521
+ "helpdesk_ticket": {
522
+ "ids": [
523
+ case_id.id,
524
+ ]
525
+ },
526
+ "billing_profile": {"ids": []},
527
+ "service_point": {"ids": []},
528
+ "res_partner_pod": {"ids": []},
529
+ "res_partner_pdr": {"ids": []},
530
+ }
531
+
532
+
533
+ def shared_data():
534
+ sp = case_id.service_point_ids
535
+ ifs_data = case_id.sudo().kv_store().get("ifs_data")
536
+ tipologia_risoluzione = ifs_data.get("tipologia_risoluzione")
537
+
538
+ return {
539
+ "COD_FLUSSO": "0050",
540
+ "PIVA": case_id.customer_id.numbers_only_vat or "",
541
+ "CF": case_id.customer_id.fiscal_code or "",
542
+ "CF_STRANIERO": "0",
543
+ "ALIQUOTA_IVA": (
544
+ sp.iva_rate if tipologia_risoluzione not in ["CAE1", "CA1"] else ""
545
+ ),
546
+ "ALIQUOTA_ACCISE": "0" if tipologia_risoluzione not in ["CAE1", "CA1"] else "",
547
+ "ADDIZ_PROVINCIALE": (
548
+ "0" if tipologia_risoluzione not in ["CAE1", "CA1"] else ""
549
+ ),
550
+ "ADDIZ_COMUNALE": "0" if tipologia_risoluzione not in ["CAE1", "CA1"] else "",
551
+ "TIPOLOGIA_RISOLUZIONE": tipologia_risoluzione,
552
+ "DATA_DECORRENZA": ifs_data.get("data_decorrenza"),
553
+ "OWNER": "SORGE",
554
+ }
555
+
556
+
557
+ # ------------------------------
558
+
559
+
560
+ def prep_rc1():
561
+ message = shared_data()
562
+ message.update(
563
+ {"COD_SERVIZIO": "RC1", "COD_POD": case_id.service_point_ids[0].pod_id.code}
564
+ )
565
+ return message
566
+
567
+
568
+ def _not_cae1_ca1(value, tipologia_risoluzione):
569
+ if tipologia_risoluzione in ["CAE1", "CA1"]:
570
+ return ""
571
+ return value
572
+
573
+
574
+ def prep_rcg1():
575
+ ifs_data = case_id.sudo().kv_store().get("ifs_data")
576
+ tipologia_risoluzione = ifs_data.get("tipologia_risoluzione")
577
+ message = shared_data()
578
+ is_person = not case_id.customer_id.is_company
579
+ is_ui = message["TIPOLOGIA_RISOLUZIONE"] != "CA4"
580
+ service_point = case_id.service_point_ids[0]
581
+ invoicing_address = service_point.billing_profile_id.invoicing_address_id
582
+ message.update(
583
+ {
584
+ "COD_SERVIZIO": "RCG1",
585
+ "COD_PDR": case_id.service_point_ids[0].pdr_id.code,
586
+ "MOTIVAZIONE": "Scelta commerciale Sorgenia",
587
+ "PRIORITA": "",
588
+ "ALTRE_INFORMAZIONI": "",
589
+ "NOME": _not_cae1_ca1(
590
+ case_id.customer_id.firstname if is_person else "",
591
+ tipologia_risoluzione,
592
+ ),
593
+ "COGNOME": _not_cae1_ca1(
594
+ case_id.customer_id.lastname if is_person else "", tipologia_risoluzione
595
+ ),
596
+ "EMAIL": _not_cae1_ca1(
597
+ case_id.customer_id.email or "", tipologia_risoluzione
598
+ ),
599
+ "TELEFONO": _not_cae1_ca1(
600
+ case_id.customer_id.phone or "", tipologia_risoluzione
601
+ ),
602
+ "ACCESSO_FUI": _not_cae1_ca1(
603
+ "SI" if message["TIPOLOGIA_RISOLUZIONE"] == "CA4" else "NO",
604
+ tipologia_risoluzione,
605
+ ),
606
+ "UI_CF": _not_cae1_ca1(
607
+ case_id.customer_id.fiscal_code if is_ui else "", tipologia_risoluzione
608
+ ),
609
+ "UI_PIVA": _not_cae1_ca1(
610
+ case_id.customer_id.vat if is_ui else "", tipologia_risoluzione
611
+ ),
612
+ "UI_CF_STRANIERO": _not_cae1_ca1("", tipologia_risoluzione),
613
+ "UI_NOME": _not_cae1_ca1(
614
+ case_id.customer_id.firstname if is_ui and is_person else "",
615
+ tipologia_risoluzione,
616
+ ),
617
+ "UI_COGNOME": _not_cae1_ca1(
618
+ case_id.customer_id.lastname if is_ui and is_person else "",
619
+ tipologia_risoluzione,
620
+ ),
621
+ "UI_RAGIONE_SOCIALE_DENOMINAZIONE": _not_cae1_ca1(
622
+ case_id.customer_id.name if is_ui and not is_person else "",
623
+ tipologia_risoluzione,
624
+ ),
625
+ "UI_EMAIL": _not_cae1_ca1(
626
+ case_id.customer_id.email or "" if is_ui else "", tipologia_risoluzione
627
+ ),
628
+ "UI_TELEFONO": _not_cae1_ca1(
629
+ case_id.customer_id.phone or "" if is_ui else "", tipologia_risoluzione
630
+ ),
631
+ "UI_AF_CF": _not_cae1_ca1("", tipologia_risoluzione),
632
+ "UI_AF_PIVA": _not_cae1_ca1("", tipologia_risoluzione),
633
+ "UI_AF_CF_STRANIERO": _not_cae1_ca1("", tipologia_risoluzione),
634
+ "UI_AF_NOME": _not_cae1_ca1("", tipologia_risoluzione),
635
+ "UI_AF_COGNOME": _not_cae1_ca1("", tipologia_risoluzione),
636
+ "UI_AF_RAGIONE_SOCIALE_DENOMINAZIONE": _not_cae1_ca1(
637
+ "", tipologia_risoluzione
638
+ ),
639
+ "UI_FOR_TOPONIMO": _not_cae1_ca1(
640
+ service_point.service_toponym_id.name or "", tipologia_risoluzione
641
+ ),
642
+ "UI_FOR_VIA": _not_cae1_ca1(
643
+ service_point.service_street or "", tipologia_risoluzione
644
+ ),
645
+ "UI_FOR_CIV": _not_cae1_ca1(
646
+ service_point.service_street_number or "", tipologia_risoluzione
647
+ ),
648
+ "UI_FOR_CAP": _not_cae1_ca1(
649
+ service_point.service_zip or "40100", tipologia_risoluzione
650
+ ),
651
+ "UI_FOR_ISTAT": _not_cae1_ca1(
652
+ service_point.service_city_id.istat_code or "", tipologia_risoluzione
653
+ ),
654
+ "UI_FOR_LOCALITA": _not_cae1_ca1(
655
+ service_point.service_city_id.name or "", tipologia_risoluzione
656
+ ),
657
+ "UI_FOR_PROV": _not_cae1_ca1(
658
+ service_point.service_state_code or "", tipologia_risoluzione
659
+ ),
660
+ "UI_FOR_NAZIONE": (
661
+ _not_cae1_ca1(
662
+ service_point.service_country_id.with_context(
663
+ lang="it_IT"
664
+ ).name.upper(),
665
+ tipologia_risoluzione,
666
+ )
667
+ )
668
+ or "",
669
+ "UI_FOR_ALTRO": "",
670
+ "UI_ES_TOPONIMO": _not_cae1_ca1(
671
+ invoicing_address.toponym_id.name or "", tipologia_risoluzione
672
+ ),
673
+ "UI_ES_VIA": _not_cae1_ca1(
674
+ invoicing_address.street or "", tipologia_risoluzione
675
+ ),
676
+ "UI_ES_CIV": _not_cae1_ca1(
677
+ invoicing_address.street_num or "", tipologia_risoluzione
678
+ ),
679
+ "UI_ES_CAP": _not_cae1_ca1(
680
+ invoicing_address.zip or "", tipologia_risoluzione
681
+ ),
682
+ "UI_ES_ISTAT": _not_cae1_ca1(
683
+ invoicing_address.istat_code or "", tipologia_risoluzione
684
+ ),
685
+ "UI_ES_LOCALITA": _not_cae1_ca1(
686
+ invoicing_address.city_id.name or "", tipologia_risoluzione
687
+ ),
688
+ "UI_ES_PROV": _not_cae1_ca1(
689
+ invoicing_address.state_code or "", tipologia_risoluzione
690
+ ),
691
+ "UI_ES_NAZIONE": _not_cae1_ca1(
692
+ invoicing_address.country_id.with_context(lang="it_IT").name.upper()
693
+ or "",
694
+ tipologia_risoluzione,
695
+ ),
696
+ "UI_ES_ALTRO": _not_cae1_ca1("", tipologia_risoluzione),
697
+ "UI_CODICE_UFFICIO": service_point.billing_profile_id.office_code or "",
698
+ "UI_PAGAMENTO_IVA": "",
699
+ "SETT_MERCEOLOGICO": "",
700
+ "COD_RICHIESTA": "",
701
+ "ADDIZ_REGIONALE": (
702
+ get_addizione_regionale()
703
+ if message["TIPOLOGIA_RISOLUZIONE"] != "CA1"
704
+ else ""
705
+ ),
706
+ }
707
+ )
708
+ return message
709
+
710
+
711
+ # ------------------------------
712
+
713
+
714
+ def main():
715
+ ifs_data_message = None
716
+ is_ele = case_id.service_point_ids[0].pod_id.exists()
717
+
718
+ if is_ele:
719
+ ifs_data_message = prep_rc1()
720
+ else:
721
+ ifs_data_message = prep_rcg1()
722
+
723
+ ifs_dict = {
724
+ "ifs_code": "RC1" if is_ele else "RCG1",
725
+ "case_id": str(case_id.id),
726
+ "entity_bindings_resubmit": get_resubmit_bindings(),
727
+ "ifs_data_message": ifs_data_message,
728
+ }
729
+ ifs_json = json_dumps(ifs_dict)
730
+ tenant_id = env["ir.config_parameter"].sudo().get_param("m2c_header_tenant_id")
731
+ org_token = env["ir.config_parameter"].sudo().get_param("m2c_header_org_token")
732
+ headers = {"tenantId": tenant_id, "orgToken": org_token}
733
+ btw_url = "http://b2w-symphony-rest-service/api/symphony/process-instances/ml_IFS_passthrough"
734
+ response = request("POST", btw_url, headers=headers, data=ifs_json)
735
+
736
+ if str(response.status_code) != "200":
737
+ raise ValidationError(str(response.status_code) + " " + str(response.text))
738
+
739
+ return "OK"
740
+
741
+
742
+ try:
743
+ result = main()
744
+ except Exception as e:
745
+ logs.append({"message": str(e), "traceback": format_exc()})
746
+ prev = case_id.info_message + "\n" if case_id.info_message else ""
747
+ case_id.write({"info_message": prev + str(e)})
748
+
749
+ result = "KO"
750
+
751
+
752
+ if logs:
753
+ log(json_dumps(logs))</field>
754
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
755
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
756
+ <field name="is_a_postalizer_phase">False</field>
757
+ <field name="is_compute_refund">False</field>
758
+ <field name="is_dl">False</field>
759
+ <field name="is_needs_child_case">False</field>
760
+ <field name="is_pick_refund_template">False</field>
761
+ <field name="is_process_managed">False</field>
762
+ <field name="is_quote_accepted">False</field>
763
+ <field name="is_quote_sent">False</field>
764
+ <field name="is_timeout">False</field>
765
+ <field name="is_voidable">False</field>
766
+ <field name="name">A1559 - Invio alla Market Communication</field>
767
+ <field name="set_result_automatically">from_code</field>
768
+ </record>
769
+ <record id="symple_triplet_phase_result_C2365_-_Recupero_Dati_OK_E-CC01-0008" model="symple.triplet.phase.result">
770
+ <field name="active">True</field>
771
+ <field name="has_message">False</field>
772
+ <field name="is_annulment">False</field>
773
+ <field name="is_dl_solicitation_result">False</field>
774
+ <field name="is_hidden">False</field>
775
+ <field name="is_quote_expired">False</field>
776
+ <field name="name">C2365 - Recupero Dati OK</field>
777
+ <field name="next_phase_id" ref="symple_triplet_phase_A1559_-_Invio_alla_Market_Communication"/>
778
+ <field name="state_code">E-CC01-0008</field>
779
+ <field name="wizard_result">SUCCESS</field>
780
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1672_-_Recupero_dati_a_CRM')])]"/>
781
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
782
+ </record>
783
+ <record id="symple_triplet_phase_A1715_-_In_attesa_check_IFS" model="symple.triplet.phase">
784
+ <field name="active">True</field>
785
+ <field name="child_case">False</field>
786
+ <field name="code"># Available variables:
787
+ # - case_id: the case that just reached this phase
788
+ # - request: allows you to make HTTP requests (method, url, headers, data)
789
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
790
+ # - json_load: allows you to use JSON.load to convert a json into an object
791
+ # - env: Odoo Environment on which the action is triggered
792
+ # - time, datetime, dateutil, timezone: useful Python libraries
793
+ # - float_compare: Odoo function to compare floats based on specific precisions
794
+ # - ValidationError: Warning Exception to use with raise
795
+ # - Command: x2Many commands namespace
796
+ # - OrderedDict: ordered dictionaries
797
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
798
+ # (line = case id, func = phase name)
799
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
800
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
801
+ # To return a result, assign: result = {...}
802
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
803
+ # phase result will not be set.
804
+
805
+
806
+
807
+ </field>
808
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
809
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
810
+ <field name="is_a_postalizer_phase">False</field>
811
+ <field name="is_compute_refund">False</field>
812
+ <field name="is_dl">False</field>
813
+ <field name="is_needs_child_case">False</field>
814
+ <field name="is_pick_refund_template">False</field>
815
+ <field name="is_process_managed">False</field>
816
+ <field name="is_quote_accepted">False</field>
817
+ <field name="is_quote_sent">False</field>
818
+ <field name="is_timeout">False</field>
819
+ <field name="is_voidable">False</field>
820
+ <field name="name">A1715 - In attesa check IFS</field>
821
+ </record>
822
+ <record id="symple_triplet_phase_result_C1019_-_Inviata_E-CC01-0011" model="symple.triplet.phase.result">
823
+ <field name="active">True</field>
824
+ <field name="has_message">False</field>
825
+ <field name="is_annulment">False</field>
826
+ <field name="is_dl_solicitation_result">False</field>
827
+ <field name="is_hidden">False</field>
828
+ <field name="is_quote_expired">False</field>
829
+ <field name="name">C1019 - Inviata</field>
830
+ <field name="next_phase_id" ref="symple_triplet_phase_A1715_-_In_attesa_check_IFS"/>
831
+ <field name="state_code">E-CC01-0011</field>
832
+ <field name="wizard_result">SUCCESS</field>
833
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1559_-_Invio_alla_Market_Communication')])]"/>
834
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
835
+ </record>
836
+ <record id="symple_triplet_phase_A1717_-_Gestione_scarti_da_cruscotto" model="symple.triplet.phase">
837
+ <field name="active">True</field>
838
+ <field name="child_case">False</field>
839
+ <field name="code"># Available variables:
840
+ # - case_id: the case that just reached this phase
841
+ # - request: allows you to make HTTP requests (method, url, headers, data)
842
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
843
+ # - json_load: allows you to use JSON.load to convert a json into an object
844
+ # - env: Odoo Environment on which the action is triggered
845
+ # - time, datetime, dateutil, timezone: useful Python libraries
846
+ # - float_compare: Odoo function to compare floats based on specific precisions
847
+ # - ValidationError: Warning Exception to use with raise
848
+ # - Command: x2Many commands namespace
849
+ # - OrderedDict: ordered dictionaries
850
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
851
+ # (line = case id, func = phase name)
852
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
853
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
854
+ # To return a result, assign: result = {...}
855
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
856
+ # phase result will not be set.
857
+
858
+
859
+
860
+ </field>
861
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
862
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
863
+ <field name="is_a_postalizer_phase">False</field>
864
+ <field name="is_compute_refund">False</field>
865
+ <field name="is_dl">False</field>
866
+ <field name="is_needs_child_case">False</field>
867
+ <field name="is_pick_refund_template">False</field>
868
+ <field name="is_process_managed">False</field>
869
+ <field name="is_quote_accepted">False</field>
870
+ <field name="is_quote_sent">False</field>
871
+ <field name="is_timeout">False</field>
872
+ <field name="is_voidable">False</field>
873
+ <field name="name">A1717 - Gestione scarti da cruscotto</field>
874
+ </record>
875
+ <record id="symple_triplet_phase_result_C2225_-_KO_-_Ammissibilit__Hub_E-CC01-0012" model="symple.triplet.phase.result">
876
+ <field name="active">True</field>
877
+ <field name="has_message">False</field>
878
+ <field name="is_annulment">False</field>
879
+ <field name="is_dl_solicitation_result">False</field>
880
+ <field name="is_hidden">False</field>
881
+ <field name="is_quote_expired">False</field>
882
+ <field name="name">C2225 - KO - Ammissibilità Hub</field>
883
+ <field name="next_phase_id" ref="symple_triplet_phase_A1717_-_Gestione_scarti_da_cruscotto"/>
884
+ <field name="state_code">E-CC01-0012</field>
885
+ <field name="wizard_result">KO-HUB</field>
886
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1715_-_In_attesa_check_IFS')])]"/>
887
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','KO-HUB')])" />
888
+ </record>
889
+ <record id="symple_triplet_phase_result_C2416_-_risottomessa_da_cruscotto_E-CC01-0015" model="symple.triplet.phase.result">
890
+ <field name="active">True</field>
891
+ <field name="has_message">False</field>
892
+ <field name="is_annulment">False</field>
893
+ <field name="is_dl_solicitation_result">False</field>
894
+ <field name="is_hidden">False</field>
895
+ <field name="is_quote_expired">False</field>
896
+ <field name="name">C2416 - risottomessa da cruscotto</field>
897
+ <field name="next_phase_id" ref="symple_triplet_phase_A1715_-_In_attesa_check_IFS"/>
898
+ <field name="state_code">E-CC01-0015</field>
899
+ <field name="wizard_result">RESUBMIT</field>
900
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1717_-_Gestione_scarti_da_cruscotto')])]"/>
901
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Resubmit')])" />
902
+ </record>
903
+ <record id="symple_triplet_phase_A2558_-_verifica_avvio_gestione_manuale" model="symple.triplet.phase">
904
+ <field name="active">True</field>
905
+ <field name="child_case">False</field>
906
+ <field name="code"># Available variables:
907
+ # - case_id: the case that just reached this phase
908
+ # - request: allows you to make HTTP requests (method, url, headers, data)
909
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
910
+ # - json_load: allows you to use JSON.load to convert a json into an object
911
+ # - env: Odoo Environment on which the action is triggered
912
+ # - time, datetime, dateutil, timezone: useful Python libraries
913
+ # - float_compare: Odoo function to compare floats based on specific precisions
914
+ # - ValidationError: Warning Exception to use with raise
915
+ # - Command: x2Many commands namespace
916
+ # - OrderedDict: ordered dictionaries
917
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
918
+ # (line = case id, func = phase name)
919
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
920
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
921
+ # To return a result, assign: result = {...}
922
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
923
+ # phase result will not be set.
924
+
925
+
926
+
927
+ </field>
928
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','BOT')])" />
929
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
930
+ <field name="is_a_postalizer_phase">False</field>
931
+ <field name="is_compute_refund">False</field>
932
+ <field name="is_dl">False</field>
933
+ <field name="is_needs_child_case">False</field>
934
+ <field name="is_pick_refund_template">False</field>
935
+ <field name="is_process_managed">False</field>
936
+ <field name="is_quote_accepted">False</field>
937
+ <field name="is_quote_sent">False</field>
938
+ <field name="is_timeout">False</field>
939
+ <field name="is_voidable">False</field>
940
+ <field name="name">A2558 - verifica avvio gestione manuale</field>
941
+ </record>
942
+ <record id="symple_triplet_phase_result_C2509_-_Da_gestire_nuovo_invio_automatico_E-CC01-0019" model="symple.triplet.phase.result">
943
+ <field name="active">True</field>
944
+ <field name="has_message">False</field>
945
+ <field name="is_annulment">False</field>
946
+ <field name="is_dl_solicitation_result">False</field>
947
+ <field name="is_hidden">False</field>
948
+ <field name="is_quote_expired">False</field>
949
+ <field name="name">C2509 - Da gestire nuovo invio automatico</field>
950
+ <field name="next_phase_id" ref="symple_triplet_phase_A1559_-_Invio_alla_Market_Communication"/>
951
+ <field name="state_code">E-CC01-0019</field>
952
+ <field name="wizard_result">KO</field>
953
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A2558_-_verifica_avvio_gestione_manuale')])]"/>
954
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','KO')])" />
955
+ </record>
956
+ <record id="symple_triplet_phase_A1879_-_Invio_alla_Market_Comm_Forzato" model="symple.triplet.phase">
957
+ <field name="active">True</field>
958
+ <field name="child_case">False</field>
959
+ <field name="code"># Available variables:
960
+ # - case_id: the case that just reached this phase
961
+ # - request: allows you to make HTTP requests (method, url, headers, data)
962
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
963
+ # - json_load: allows you to use JSON.load to convert a json into an object
964
+ # - env: Odoo Environment on which the action is triggered
965
+ # - time, datetime, dateutil, timezone: useful Python libraries
966
+ # - float_compare: Odoo function to compare floats based on specific precisions
967
+ # - ValidationError: Warning Exception to use with raise
968
+ # - Command: x2Many commands namespace
969
+ # - OrderedDict: ordered dictionaries
970
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
971
+ # (line = case id, func = phase name)
972
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
973
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
974
+ # To return a result, assign: result = {...}
975
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
976
+ # phase result will not be set.
977
+
978
+
979
+ logs = []
980
+
981
+ # ------------------------------
982
+
983
+
984
+ def get_addizione_regionale():
985
+ return case_id.service_point_ids[0].regional_surcharge_value
986
+
987
+
988
+ # ------------------------------
989
+
990
+
991
+ def get_resubmit_bindings():
992
+ return {
993
+ "helpdesk_ticket": {
994
+ "ids": [
995
+ case_id.id,
996
+ ]
997
+ },
998
+ "billing_profile": {"ids": []},
999
+ "service_point": {"ids": []},
1000
+ "res_partner_pod": {"ids": []},
1001
+ "res_partner_pdr": {"ids": []},
1002
+ }
1003
+
1004
+
1005
+ def shared_data():
1006
+ sp = case_id.service_point_ids
1007
+ ifs_data = case_id.sudo().kv_store().get("ifs_data")
1008
+ tipologia_risoluzione = ifs_data.get("tipologia_risoluzione")
1009
+
1010
+ return {
1011
+ "COD_FLUSSO": "0050",
1012
+ "PIVA": case_id.customer_id.numbers_only_vat or "",
1013
+ "CF": case_id.customer_id.fiscal_code or "",
1014
+ "CF_STRANIERO": "0",
1015
+ "ALIQUOTA_IVA": (
1016
+ sp.iva_rate if tipologia_risoluzione not in ["CAE1", "CA1"] else ""
1017
+ ),
1018
+ "ALIQUOTA_ACCISE": "0" if tipologia_risoluzione not in ["CAE1", "CA1"] else "",
1019
+ "ADDIZ_PROVINCIALE": (
1020
+ "0" if tipologia_risoluzione not in ["CAE1", "CA1"] else ""
1021
+ ),
1022
+ "ADDIZ_COMUNALE": "0" if tipologia_risoluzione not in ["CAE1", "CA1"] else "",
1023
+ "TIPOLOGIA_RISOLUZIONE": tipologia_risoluzione,
1024
+ "DATA_DECORRENZA": ifs_data.get("data_decorrenza"),
1025
+ "OWNER": "SORGE",
1026
+ }
1027
+
1028
+
1029
+ # ------------------------------
1030
+
1031
+
1032
+ def prep_rc1():
1033
+ message = shared_data()
1034
+ message.update(
1035
+ {
1036
+ "COD_SERVIZIO": "RC1",
1037
+ "COD_POD": case_id.service_point_ids[0].pod_id.code,
1038
+ "bypass": True,
1039
+ }
1040
+ )
1041
+ return message
1042
+
1043
+
1044
+ def _not_cae1_ca1(value, tipologia_risoluzione):
1045
+ if tipologia_risoluzione in ["CAE1", "CA1"]:
1046
+ return ""
1047
+ return value
1048
+
1049
+
1050
+ def prep_rcg1():
1051
+ ifs_data = case_id.sudo().kv_store().get("ifs_data")
1052
+ tipologia_risoluzione = ifs_data.get("tipologia_risoluzione")
1053
+ message = shared_data()
1054
+ is_person = not case_id.customer_id.is_company
1055
+ is_ui = message["TIPOLOGIA_RISOLUZIONE"] != "CA4"
1056
+ service_point = case_id.service_point_ids[0]
1057
+ invoicing_address = service_point.billing_profile_id.invoicing_address_id
1058
+ message.update(
1059
+ {
1060
+ "COD_SERVIZIO": "RCG1",
1061
+ "COD_PDR": case_id.service_point_ids[0].pdr_id.code,
1062
+ "MOTIVAZIONE": "Scelta commerciale Sorgenia",
1063
+ "PRIORITA": "",
1064
+ "ALTRE_INFORMAZIONI": "",
1065
+ "NOME": _not_cae1_ca1(
1066
+ case_id.customer_id.firstname if is_person else "",
1067
+ tipologia_risoluzione,
1068
+ ),
1069
+ "COGNOME": _not_cae1_ca1(
1070
+ case_id.customer_id.lastname if is_person else "", tipologia_risoluzione
1071
+ ),
1072
+ "EMAIL": _not_cae1_ca1(
1073
+ case_id.customer_id.email or "", tipologia_risoluzione
1074
+ ),
1075
+ "TELEFONO": _not_cae1_ca1(
1076
+ case_id.customer_id.phone or "", tipologia_risoluzione
1077
+ ),
1078
+ "ACCESSO_FUI": _not_cae1_ca1(
1079
+ "SI" if message["TIPOLOGIA_RISOLUZIONE"] == "CA4" else "NO",
1080
+ tipologia_risoluzione,
1081
+ ),
1082
+ "UI_CF": _not_cae1_ca1(
1083
+ case_id.customer_id.fiscal_code if is_ui else "", tipologia_risoluzione
1084
+ ),
1085
+ "UI_PIVA": _not_cae1_ca1(
1086
+ case_id.customer_id.vat if is_ui else "", tipologia_risoluzione
1087
+ ),
1088
+ "UI_CF_STRANIERO": _not_cae1_ca1("", tipologia_risoluzione),
1089
+ "UI_NOME": _not_cae1_ca1(
1090
+ case_id.customer_id.firstname if is_ui and is_person else "",
1091
+ tipologia_risoluzione,
1092
+ ),
1093
+ "UI_COGNOME": _not_cae1_ca1(
1094
+ case_id.customer_id.lastname if is_ui and is_person else "",
1095
+ tipologia_risoluzione,
1096
+ ),
1097
+ "UI_RAGIONE_SOCIALE_DENOMINAZIONE": _not_cae1_ca1(
1098
+ case_id.customer_id.name if is_ui and not is_person else "",
1099
+ tipologia_risoluzione,
1100
+ ),
1101
+ "UI_EMAIL": _not_cae1_ca1(
1102
+ case_id.customer_id.email or "" if is_ui else "", tipologia_risoluzione
1103
+ ),
1104
+ "UI_TELEFONO": _not_cae1_ca1(
1105
+ case_id.customer_id.phone or "" if is_ui else "", tipologia_risoluzione
1106
+ ),
1107
+ "UI_AF_CF": _not_cae1_ca1("", tipologia_risoluzione),
1108
+ "UI_AF_PIVA": _not_cae1_ca1("", tipologia_risoluzione),
1109
+ "UI_AF_CF_STRANIERO": _not_cae1_ca1("", tipologia_risoluzione),
1110
+ "UI_AF_NOME": _not_cae1_ca1("", tipologia_risoluzione),
1111
+ "UI_AF_COGNOME": _not_cae1_ca1("", tipologia_risoluzione),
1112
+ "UI_AF_RAGIONE_SOCIALE_DENOMINAZIONE": _not_cae1_ca1(
1113
+ "", tipologia_risoluzione
1114
+ ),
1115
+ "UI_FOR_TOPONIMO": _not_cae1_ca1(
1116
+ service_point.service_toponym_id.name or "", tipologia_risoluzione
1117
+ ),
1118
+ "UI_FOR_VIA": _not_cae1_ca1(
1119
+ service_point.service_street or "", tipologia_risoluzione
1120
+ ),
1121
+ "UI_FOR_CIV": _not_cae1_ca1(
1122
+ service_point.service_street_number or "", tipologia_risoluzione
1123
+ ),
1124
+ "UI_FOR_CAP": _not_cae1_ca1(
1125
+ service_point.service_zip or "40100", tipologia_risoluzione
1126
+ ),
1127
+ "UI_FOR_ISTAT": _not_cae1_ca1(
1128
+ service_point.service_city_id.istat_code or "", tipologia_risoluzione
1129
+ ),
1130
+ "UI_FOR_LOCALITA": _not_cae1_ca1(
1131
+ service_point.service_city_id.name or "", tipologia_risoluzione
1132
+ ),
1133
+ "UI_FOR_PROV": _not_cae1_ca1(
1134
+ service_point.service_state_code or "", tipologia_risoluzione
1135
+ ),
1136
+ "UI_FOR_NAZIONE": (
1137
+ _not_cae1_ca1(
1138
+ service_point.service_country_id.with_context(
1139
+ lang="it_IT"
1140
+ ).name.upper(),
1141
+ tipologia_risoluzione,
1142
+ )
1143
+ )
1144
+ or "",
1145
+ "UI_FOR_ALTRO": "",
1146
+ "UI_ES_TOPONIMO": _not_cae1_ca1(
1147
+ invoicing_address.toponym_id.name or "", tipologia_risoluzione
1148
+ ),
1149
+ "UI_ES_VIA": _not_cae1_ca1(
1150
+ invoicing_address.street or "", tipologia_risoluzione
1151
+ ),
1152
+ "UI_ES_CIV": _not_cae1_ca1(
1153
+ invoicing_address.street_num or "", tipologia_risoluzione
1154
+ ),
1155
+ "UI_ES_CAP": _not_cae1_ca1(
1156
+ invoicing_address.zip or "", tipologia_risoluzione
1157
+ ),
1158
+ "UI_ES_ISTAT": _not_cae1_ca1(
1159
+ invoicing_address.istat_code or "", tipologia_risoluzione
1160
+ ),
1161
+ "UI_ES_LOCALITA": _not_cae1_ca1(
1162
+ invoicing_address.city_id.name or "", tipologia_risoluzione
1163
+ ),
1164
+ "UI_ES_PROV": _not_cae1_ca1(
1165
+ invoicing_address.state_code or "", tipologia_risoluzione
1166
+ ),
1167
+ "UI_ES_NAZIONE": _not_cae1_ca1(
1168
+ invoicing_address.country_id.with_context(lang="it_IT").name.upper()
1169
+ or "",
1170
+ tipologia_risoluzione,
1171
+ ),
1172
+ "UI_ES_ALTRO": _not_cae1_ca1("", tipologia_risoluzione),
1173
+ "UI_CODICE_UFFICIO": service_point.billing_profile_id.office_code or "",
1174
+ "UI_PAGAMENTO_IVA": "",
1175
+ "SETT_MERCEOLOGICO": "",
1176
+ "COD_RICHIESTA": "",
1177
+ "ADDIZ_REGIONALE": (
1178
+ get_addizione_regionale()
1179
+ if message["TIPOLOGIA_RISOLUZIONE"] != "CA1"
1180
+ else ""
1181
+ ),
1182
+ "bypass": True,
1183
+ }
1184
+ )
1185
+ return message
1186
+
1187
+
1188
+ # ------------------------------
1189
+
1190
+
1191
+ def main():
1192
+ ifs_data_message = None
1193
+ is_ele = case_id.service_point_ids[0].pod_id.exists()
1194
+
1195
+ if is_ele:
1196
+ ifs_data_message = prep_rc1()
1197
+ else:
1198
+ ifs_data_message = prep_rcg1()
1199
+
1200
+ ifs_dict = {
1201
+ "ifs_code": "RC1" if is_ele else "RCG1",
1202
+ "case_id": str(case_id.id),
1203
+ "entity_bindings_resubmit": get_resubmit_bindings(),
1204
+ "ifs_data_message": ifs_data_message,
1205
+ }
1206
+ ifs_json = json_dumps(ifs_dict)
1207
+ tenant_id = env["ir.config_parameter"].sudo().get_param("m2c_header_tenant_id")
1208
+ org_token = env["ir.config_parameter"].sudo().get_param("m2c_header_org_token")
1209
+ headers = {"tenantId": tenant_id, "orgToken": org_token}
1210
+ btw_url = "http://b2w-symphony-rest-service/api/symphony/process-instances/ml_IFS_passthrough"
1211
+ response = request("POST", btw_url, headers=headers, data=ifs_json)
1212
+
1213
+ if str(response.status_code) != "200":
1214
+ raise ValidationError(str(response.status_code) + " " + str(response.text))
1215
+
1216
+ return "OK"
1217
+
1218
+
1219
+ try:
1220
+ result = main()
1221
+ except Exception as e:
1222
+ logs.append({"message": str(e), "traceback": format_exc()})
1223
+ prev = case_id.info_message + "\n" if case_id.info_message else ""
1224
+ case_id.write({"info_message": prev + str(e)})
1225
+
1226
+ result = "KO"
1227
+
1228
+
1229
+ if logs:
1230
+ log(json_dumps(logs))</field>
1231
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
1232
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
1233
+ <field name="is_a_postalizer_phase">False</field>
1234
+ <field name="is_compute_refund">False</field>
1235
+ <field name="is_dl">False</field>
1236
+ <field name="is_needs_child_case">False</field>
1237
+ <field name="is_pick_refund_template">False</field>
1238
+ <field name="is_process_managed">False</field>
1239
+ <field name="is_quote_accepted">False</field>
1240
+ <field name="is_quote_sent">False</field>
1241
+ <field name="is_timeout">False</field>
1242
+ <field name="is_voidable">False</field>
1243
+ <field name="name">A1879 - Invio alla Market Comm Forzato</field>
1244
+ <field name="set_result_automatically">from_code</field>
1245
+ </record>
1246
+ <record id="symple_triplet_phase_result_C2598_-_gestione_manuale_E-CC01-0018" model="symple.triplet.phase.result">
1247
+ <field name="active">True</field>
1248
+ <field name="has_message">False</field>
1249
+ <field name="is_annulment">False</field>
1250
+ <field name="is_dl_solicitation_result">False</field>
1251
+ <field name="is_hidden">False</field>
1252
+ <field name="is_quote_expired">False</field>
1253
+ <field name="name">C2598 - gestione manuale</field>
1254
+ <field name="next_phase_id" ref="symple_triplet_phase_A1879_-_Invio_alla_Market_Comm_Forzato"/>
1255
+ <field name="state_code">E-CC01-0018</field>
1256
+ <field name="wizard_result">SUCCESS</field>
1257
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A2558_-_verifica_avvio_gestione_manuale')])]"/>
1258
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
1259
+ </record>
1260
+ <record id="symple_triplet_phase_A1806_-_In_Attesa_Check_HUB_Forzato" model="symple.triplet.phase">
1261
+ <field name="active">True</field>
1262
+ <field name="child_case">False</field>
1263
+ <field name="code"># Available variables:
1264
+ # - case_id: the case that just reached this phase
1265
+ # - request: allows you to make HTTP requests (method, url, headers, data)
1266
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
1267
+ # - json_load: allows you to use JSON.load to convert a json into an object
1268
+ # - env: Odoo Environment on which the action is triggered
1269
+ # - time, datetime, dateutil, timezone: useful Python libraries
1270
+ # - float_compare: Odoo function to compare floats based on specific precisions
1271
+ # - ValidationError: Warning Exception to use with raise
1272
+ # - Command: x2Many commands namespace
1273
+ # - OrderedDict: ordered dictionaries
1274
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
1275
+ # (line = case id, func = phase name)
1276
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
1277
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
1278
+ # To return a result, assign: result = {...}
1279
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
1280
+ # phase result will not be set.
1281
+
1282
+
1283
+
1284
+ </field>
1285
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
1286
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
1287
+ <field name="is_a_postalizer_phase">False</field>
1288
+ <field name="is_compute_refund">False</field>
1289
+ <field name="is_dl">False</field>
1290
+ <field name="is_needs_child_case">False</field>
1291
+ <field name="is_pick_refund_template">False</field>
1292
+ <field name="is_process_managed">False</field>
1293
+ <field name="is_quote_accepted">False</field>
1294
+ <field name="is_quote_sent">False</field>
1295
+ <field name="is_timeout">False</field>
1296
+ <field name="is_voidable">False</field>
1297
+ <field name="name">A1806 - In Attesa Check HUB Forzato</field>
1298
+ </record>
1299
+ <record id="symple_triplet_phase_result_C1019_-_Inviata_E-CC01-0020" model="symple.triplet.phase.result">
1300
+ <field name="active">True</field>
1301
+ <field name="has_message">False</field>
1302
+ <field name="is_annulment">False</field>
1303
+ <field name="is_dl_solicitation_result">False</field>
1304
+ <field name="is_hidden">False</field>
1305
+ <field name="is_quote_expired">False</field>
1306
+ <field name="name">C1019 - Inviata</field>
1307
+ <field name="next_phase_id" ref="symple_triplet_phase_A1806_-_In_Attesa_Check_HUB_Forzato"/>
1308
+ <field name="state_code">E-CC01-0020</field>
1309
+ <field name="wizard_result">SUCCESS</field>
1310
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1879_-_Invio_alla_Market_Comm_Forzato')])]"/>
1311
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
1312
+ </record>
1313
+ <record id="symple_triplet_phase_A1834_-_Gestione_scarti_da_cruscotto_forzato" model="symple.triplet.phase">
1314
+ <field name="active">True</field>
1315
+ <field name="child_case">False</field>
1316
+ <field name="code"># Available variables:
1317
+ # - case_id: the case that just reached this phase
1318
+ # - request: allows you to make HTTP requests (method, url, headers, data)
1319
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
1320
+ # - json_load: allows you to use JSON.load to convert a json into an object
1321
+ # - env: Odoo Environment on which the action is triggered
1322
+ # - time, datetime, dateutil, timezone: useful Python libraries
1323
+ # - float_compare: Odoo function to compare floats based on specific precisions
1324
+ # - ValidationError: Warning Exception to use with raise
1325
+ # - Command: x2Many commands namespace
1326
+ # - OrderedDict: ordered dictionaries
1327
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
1328
+ # (line = case id, func = phase name)
1329
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
1330
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
1331
+ # To return a result, assign: result = {...}
1332
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
1333
+ # phase result will not be set.
1334
+
1335
+
1336
+
1337
+ </field>
1338
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
1339
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
1340
+ <field name="is_a_postalizer_phase">False</field>
1341
+ <field name="is_compute_refund">False</field>
1342
+ <field name="is_dl">False</field>
1343
+ <field name="is_needs_child_case">False</field>
1344
+ <field name="is_pick_refund_template">False</field>
1345
+ <field name="is_process_managed">False</field>
1346
+ <field name="is_quote_accepted">False</field>
1347
+ <field name="is_quote_sent">False</field>
1348
+ <field name="is_timeout">False</field>
1349
+ <field name="is_voidable">False</field>
1350
+ <field name="name">A1834 - Gestione scarti da cruscotto forzato</field>
1351
+ </record>
1352
+ <record id="symple_triplet_phase_result_C2225_-_KO_-_Ammissibilit__Hub_E-CC01-0021" model="symple.triplet.phase.result">
1353
+ <field name="active">True</field>
1354
+ <field name="has_message">False</field>
1355
+ <field name="is_annulment">False</field>
1356
+ <field name="is_dl_solicitation_result">False</field>
1357
+ <field name="is_hidden">False</field>
1358
+ <field name="is_quote_expired">False</field>
1359
+ <field name="name">C2225 - KO - Ammissibilità Hub</field>
1360
+ <field name="next_phase_id" ref="symple_triplet_phase_A1834_-_Gestione_scarti_da_cruscotto_forzato"/>
1361
+ <field name="state_code">E-CC01-0021</field>
1362
+ <field name="wizard_result">KO-HUB</field>
1363
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1806_-_In_Attesa_Check_HUB_Forzato')])]"/>
1364
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','KO-HUB')])" />
1365
+ </record>
1366
+ <record id="symple_triplet_phase_result_C2416_-_risottomessa_da_cruscotto_E-CC01-0023" model="symple.triplet.phase.result">
1367
+ <field name="active">True</field>
1368
+ <field name="has_message">False</field>
1369
+ <field name="is_annulment">False</field>
1370
+ <field name="is_dl_solicitation_result">False</field>
1371
+ <field name="is_hidden">False</field>
1372
+ <field name="is_quote_expired">False</field>
1373
+ <field name="name">C2416 - risottomessa da cruscotto</field>
1374
+ <field name="next_phase_id" ref="symple_triplet_phase_A1806_-_In_Attesa_Check_HUB_Forzato"/>
1375
+ <field name="state_code">E-CC01-0023</field>
1376
+ <field name="wizard_result">RESUBMIT</field>
1377
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1834_-_Gestione_scarti_da_cruscotto_forzato')])]"/>
1378
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Resubmit')])" />
1379
+ </record>
1380
+ <record id="symple_triplet_phase_A0816_-_In_attesa_esito_ammissibilit_" model="symple.triplet.phase">
1381
+ <field name="active">True</field>
1382
+ <field name="child_case">False</field>
1383
+ <field name="code"># Available variables:
1384
+ # - case_id: the case that just reached this phase
1385
+ # - request: allows you to make HTTP requests (method, url, headers, data)
1386
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
1387
+ # - json_load: allows you to use JSON.load to convert a json into an object
1388
+ # - env: Odoo Environment on which the action is triggered
1389
+ # - time, datetime, dateutil, timezone: useful Python libraries
1390
+ # - float_compare: Odoo function to compare floats based on specific precisions
1391
+ # - ValidationError: Warning Exception to use with raise
1392
+ # - Command: x2Many commands namespace
1393
+ # - OrderedDict: ordered dictionaries
1394
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
1395
+ # (line = case id, func = phase name)
1396
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
1397
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
1398
+ # To return a result, assign: result = {...}
1399
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
1400
+ # phase result will not be set.
1401
+
1402
+
1403
+
1404
+ </field>
1405
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
1406
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
1407
+ <field name="is_a_postalizer_phase">False</field>
1408
+ <field name="is_compute_refund">False</field>
1409
+ <field name="is_dl">False</field>
1410
+ <field name="is_needs_child_case">False</field>
1411
+ <field name="is_pick_refund_template">False</field>
1412
+ <field name="is_process_managed">False</field>
1413
+ <field name="is_quote_accepted">False</field>
1414
+ <field name="is_quote_sent">False</field>
1415
+ <field name="is_timeout">False</field>
1416
+ <field name="is_voidable">False</field>
1417
+ <field name="name">A0816 - In attesa esito ammissibilità</field>
1418
+ </record>
1419
+ <record id="symple_triplet_phase_result_C2224_-_OK_-_Ammissibilit__Hub_E-CC01-0022" model="symple.triplet.phase.result">
1420
+ <field name="active">True</field>
1421
+ <field name="has_message">False</field>
1422
+ <field name="is_annulment">False</field>
1423
+ <field name="is_dl_solicitation_result">False</field>
1424
+ <field name="is_hidden">False</field>
1425
+ <field name="is_quote_expired">False</field>
1426
+ <field name="name">C2224 - OK - Ammissibilità Hub</field>
1427
+ <field name="next_phase_id" ref="symple_triplet_phase_A0816_-_In_attesa_esito_ammissibilit_"/>
1428
+ <field name="state_code">E-CC01-0022</field>
1429
+ <field name="wizard_result">OK-HUB</field>
1430
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1806_-_In_Attesa_Check_HUB_Forzato')])]"/>
1431
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','OK-HUB')])" />
1432
+ </record>
1433
+ <record id="symple_triplet_phase_result_C1038_-_Ammissibilit__KO_E-CC01-0026" model="symple.triplet.phase.result">
1434
+ <field name="active">True</field>
1435
+ <field name="has_message">False</field>
1436
+ <field name="is_annulment">False</field>
1437
+ <field name="is_dl_solicitation_result">False</field>
1438
+ <field name="is_hidden">False</field>
1439
+ <field name="is_quote_expired">False</field>
1440
+ <field name="name">C1038 - Ammissibilità KO</field>
1441
+ <field name="next_phase_id" ref="symple_triplet_phase_A1717_-_Gestione_scarti_da_cruscotto"/>
1442
+ <field name="state_code">E-CC01-0026</field>
1443
+ <field name="wizard_result">KO-100</field>
1444
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A0816_-_In_attesa_esito_ammissibilit_')])]"/>
1445
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','KO-100')])" />
1446
+ </record>
1447
+ <record id="symple_triplet_phase_A1004_-_Verifica_RCU___Data_decorrenza" model="symple.triplet.phase">
1448
+ <field name="active">True</field>
1449
+ <field name="allowed_process_ids" model="symple.pb.process" eval="[(6, 0, obj().search([('name','in',('ml_annullamento_cessazione',)),]).ids)]" />
1450
+ <field name="child_case">False</field>
1451
+ <field name="code"># Available variables:
1452
+ # - case_id: the case that just reached this phase
1453
+ # - request: allows you to make HTTP requests (method, url, headers, data)
1454
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
1455
+ # - json_load: allows you to use JSON.load to convert a json into an object
1456
+ # - env: Odoo Environment on which the action is triggered
1457
+ # - time, datetime, dateutil, timezone: useful Python libraries
1458
+ # - float_compare: Odoo function to compare floats based on specific precisions
1459
+ # - ValidationError: Warning Exception to use with raise
1460
+ # - Command: x2Many commands namespace
1461
+ # - OrderedDict: ordered dictionaries
1462
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
1463
+ # (line = case id, func = phase name)
1464
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
1465
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
1466
+ # To return a result, assign: result = {...}
1467
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
1468
+ # phase result will not be set.
1469
+
1470
+
1471
+
1472
+ </field>
1473
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','BOT')])" />
1474
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
1475
+ <field name="is_a_postalizer_phase">False</field>
1476
+ <field name="is_compute_refund">False</field>
1477
+ <field name="is_dl">False</field>
1478
+ <field name="is_needs_child_case">False</field>
1479
+ <field name="is_pick_refund_template">False</field>
1480
+ <field name="is_process_managed">False</field>
1481
+ <field name="is_quote_accepted">False</field>
1482
+ <field name="is_quote_sent">False</field>
1483
+ <field name="is_timeout">False</field>
1484
+ <field name="is_voidable">False</field>
1485
+ <field name="name">A1004 - Verifica RCU + Data decorrenza</field>
1486
+ </record>
1487
+ <record id="symple_triplet_phase_A2397_-_OK_RCU___verifica_data_decorrenza" model="symple.triplet.phase">
1488
+ <field name="active">True</field>
1489
+ <field name="child_case">False</field>
1490
+ <field name="code"><![CDATA[# RES1 = C1936 - Data raggiunta
1491
+
1492
+ RES1 = "RES1"
1493
+
1494
+ logs = []
1495
+ debug_logs = []
1496
+ error_occurred = False
1497
+
1498
+
1499
+ def make_log(message, data=None, always=False):
1500
+ log_entry = {"message": message}
1501
+ if data is not None:
1502
+ log_entry["data"] = data
1503
+
1504
+ if always:
1505
+ logs.append(log_entry)
1506
+ else:
1507
+ debug_logs.append(log_entry)
1508
+
1509
+
1510
+ # --------------------------------------
1511
+
1512
+
1513
+ def main():
1514
+ date_to_check = case_id.disconnect_date
1515
+ today = datetime.date.today()
1516
+ cutoff = today.replace(day=1) - datetime.timedelta(days=1)
1517
+ date_reached = date_to_check <= cutoff
1518
+ if date_reached:
1519
+ return RES1
1520
+
1521
+
1522
+ try:
1523
+ result = main()
1524
+ except Exception as e:
1525
+ error_occurred = True
1526
+ make_log(
1527
+ "Error occurred in phase",
1528
+ {"error": str(e), "traceback": format_exc()},
1529
+ always=True,
1530
+ )
1531
+ case_id.write({"error_message": str(e)})
1532
+
1533
+
1534
+ if error_occurred and debug_logs:
1535
+ logs.append({"message": "debug_logs", "logs": debug_logs})
1536
+
1537
+ if logs:
1538
+ log(json_dumps(logs, indent=2))]]></field>
1539
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
1540
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
1541
+ <field name="is_a_postalizer_phase">False</field>
1542
+ <field name="is_compute_refund">False</field>
1543
+ <field name="is_dl">False</field>
1544
+ <field name="is_needs_child_case">False</field>
1545
+ <field name="is_pick_refund_template">False</field>
1546
+ <field name="is_process_managed">False</field>
1547
+ <field name="is_quote_accepted">False</field>
1548
+ <field name="is_quote_sent">False</field>
1549
+ <field name="is_timeout">False</field>
1550
+ <field name="is_voidable">False</field>
1551
+ <field name="name">A2397 - OK RCU + verifica data decorrenza</field>
1552
+ <field name="set_result_automatically">from_code</field>
1553
+ </record>
1554
+ <record id="symple_triplet_phase_result_C1448_-_OK_controlli_RCU___Data_decorrenza_E-CC01-0027" model="symple.triplet.phase.result">
1555
+ <field name="active">True</field>
1556
+ <field name="has_message">False</field>
1557
+ <field name="is_annulment">False</field>
1558
+ <field name="is_dl_solicitation_result">False</field>
1559
+ <field name="is_hidden">False</field>
1560
+ <field name="is_quote_expired">False</field>
1561
+ <field name="name">C1448 - OK controlli RCU + Data decorrenza</field>
1562
+ <field name="next_phase_id" ref="symple_triplet_phase_A2397_-_OK_RCU___verifica_data_decorrenza"/>
1563
+ <field name="state_code">E-CC01-0027</field>
1564
+ <field name="wizard_result">SUCCESS</field>
1565
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1004_-_Verifica_RCU___Data_decorrenza')])]"/>
1566
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
1567
+ </record>
1568
+ <record id="symple_triplet_phase_A1577_-_Chiusura_Ordine_CRM" model="symple.triplet.phase">
1569
+ <field name="active">True</field>
1570
+ <field name="child_case">False</field>
1571
+ <field name="code"># Available variables:
1572
+ # - case_id: the case that just reached this phase
1573
+ # - request: allows you to make HTTP requests (method, url, headers, data)
1574
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
1575
+ # - json_load: allows you to use JSON.load to convert a json into an object
1576
+ # - env: Odoo Environment on which the action is triggered
1577
+ # - time, datetime, dateutil, timezone: useful Python libraries
1578
+ # - float_compare: Odoo function to compare floats based on specific precisions
1579
+ # - ValidationError: Warning Exception to use with raise
1580
+ # - Command: x2Many commands namespace
1581
+ # - OrderedDict: ordered dictionaries
1582
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
1583
+ # (line = case id, func = phase name)
1584
+ # To return a result, assign: result = {...}
1585
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
1586
+ # phase result will not be set.
1587
+
1588
+ logs = []
1589
+
1590
+
1591
+ def log_and_parse_response(response, log_message):
1592
+ try:
1593
+ json_data = response.json()
1594
+ logs.append({"message": log_message, "data": json_data})
1595
+ return json_data
1596
+ except Exception:
1597
+ logs.append({"message": log_message, "response_text": response.text})
1598
+ return response.text
1599
+
1600
+
1601
+ def create_order_disconnect(asset_id, token):
1602
+ url = "http://b2w-cpq-order-management-service/v1/order"
1603
+ headers = {
1604
+ "X-Auth-Request-Access-Token": "" + token,
1605
+ "Content-Type": "application/json",
1606
+ "generatesession": "true",
1607
+ }
1608
+ body = {
1609
+ "obj_type": "Order",
1610
+ "crm_accountcode": case_id.customer_id.user_sequence,
1611
+ "accountcode": str(case_id.customer_id.id),
1612
+ "type": "Disconnect",
1613
+ "subtype": case_id.ticket_type_id.name,
1614
+ "industry": "BSP Utility",
1615
+ "commodity": "power" if case_id.service_point_ids[0].pod_id else "gas",
1616
+ "order_date": case_id.disconnect_date.strftime("%Y-%m-%d"),
1617
+ "contract": True,
1618
+ "singlecontract": True,
1619
+ "assets": [asset_id],
1620
+ "options": {
1621
+ "userLanguage": "en-US",
1622
+ "remotePagination": True,
1623
+ "itemsForPage": 10,
1624
+ "cartItemsForPage": 10,
1625
+ },
1626
+ }
1627
+
1628
+ logs.append({"message": "Creating order", "data": {"body": body}})
1629
+
1630
+ response = request("POST", url, headers=headers, data=json_dumps(body))
1631
+ json = log_and_parse_response(
1632
+ response,
1633
+ "Order creation response",
1634
+ )
1635
+
1636
+ if response.status_code != 200:
1637
+ raise ValidationError("Failed to create order")
1638
+
1639
+ return json
1640
+
1641
+
1642
+ def bind_catalog(config_id, catalog_id, token):
1643
+ logs.append(
1644
+ {
1645
+ "message": "Binding catalog and order",
1646
+ "data": {
1647
+ "config_id": config_id,
1648
+ "catalog_id": catalog_id,
1649
+ },
1650
+ }
1651
+ )
1652
+
1653
+ headers = {
1654
+ "X-Auth-Request-Access-Token": "" + token,
1655
+ "Content-Type": "application/json",
1656
+ "generatesession": "true",
1657
+ }
1658
+ url = "http://b2w-cpq-catalog-navigator-node-service/v1/configurations/{}/catalogs/{}".format(
1659
+ config_id, catalog_id
1660
+ )
1661
+
1662
+ response = request("GET", url, headers=headers)
1663
+ json = log_and_parse_response(
1664
+ response,
1665
+ "Catalog binding response",
1666
+ )
1667
+
1668
+ if response.status_code != 200:
1669
+ raise ValidationError("Failed to set catalog id on order")
1670
+
1671
+ return json
1672
+
1673
+
1674
+ def checkout(config_id, token):
1675
+ logs.append(
1676
+ {
1677
+ "message": "Binding catalog and order",
1678
+ "data": {
1679
+ "config_id": config_id,
1680
+ },
1681
+ }
1682
+ )
1683
+
1684
+ headers = {
1685
+ "X-Auth-Request-Access-Token": "" + token,
1686
+ "Content-Type": "application/json",
1687
+ "generatesession": "true",
1688
+ }
1689
+ url = "http://b2w-cpq-order-management-service/v1/order/{}".format(config_id)
1690
+
1691
+ response = request("POST", url, headers=headers, data="{}")
1692
+ json = log_and_parse_response(
1693
+ response,
1694
+ "Checkout response",
1695
+ )
1696
+
1697
+ if response.status_code != 200:
1698
+ raise ValidationError("Failed to checkout")
1699
+
1700
+ return json
1701
+
1702
+
1703
+ try:
1704
+ StagingArea = env["symple.pb.process.data"]
1705
+ IrConfigParam = env["ir.config_parameter"].sudo()
1706
+ token = IrConfigParam.get_b2w_access_token()
1707
+
1708
+ code = case_id.service_point_ids[0].code
1709
+ asset = case_id.sudo().kv_store().get("asset")
1710
+ catalog_id = asset["catalogid"]
1711
+ logs.append({"message": "Asset loaded", "data": asset})
1712
+ order = create_order_disconnect(asset["_id"], token)
1713
+ order_id = order["_id"]
1714
+ config_id = order["conf_id"]
1715
+ logs.append({"message": "Order created", "data": order})
1716
+ bind_catalog(config_id, catalog_id, token)
1717
+ checkout(config_id, token)
1718
+
1719
+ kv_store = case_id.sudo().kv_store()
1720
+ kv_store.set("order_id", order_id)
1721
+ kv_store.set("asset_id", asset["_id"])
1722
+ kv_store.set("config_id", order["conf_id"])
1723
+ kv_store.set("contract_id", asset["contract_id"])
1724
+
1725
+ result = "OK"
1726
+
1727
+ except Exception as e:
1728
+ logs.append({"message": str(e), "traceback": format_exc()})
1729
+ case_id.write(
1730
+ {"error_message": "Errore durante l'esecuzione della fase: {}".format(str(e))}
1731
+ )
1732
+
1733
+
1734
+ if logs:
1735
+ log(json_dumps(logs))</field>
1736
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
1737
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
1738
+ <field name="is_a_postalizer_phase">False</field>
1739
+ <field name="is_compute_refund">False</field>
1740
+ <field name="is_dl">False</field>
1741
+ <field name="is_needs_child_case">False</field>
1742
+ <field name="is_pick_refund_template">False</field>
1743
+ <field name="is_process_managed">False</field>
1744
+ <field name="is_quote_accepted">False</field>
1745
+ <field name="is_quote_sent">False</field>
1746
+ <field name="is_timeout">False</field>
1747
+ <field name="is_voidable">False</field>
1748
+ <field name="name">A1577 - Chiusura Ordine CRM</field>
1749
+ <field name="set_result_automatically">from_code</field>
1750
+ </record>
1751
+ <record id="symple_triplet_phase_result_C1936_-_Data_raggiunta_E-CC01-0031" model="symple.triplet.phase.result">
1752
+ <field name="active">True</field>
1753
+ <field name="has_message">False</field>
1754
+ <field name="is_annulment">False</field>
1755
+ <field name="is_dl_solicitation_result">False</field>
1756
+ <field name="is_hidden">False</field>
1757
+ <field name="is_quote_expired">False</field>
1758
+ <field name="name">C1936 - Data raggiunta</field>
1759
+ <field name="next_phase_id" ref="symple_triplet_phase_A1577_-_Chiusura_Ordine_CRM"/>
1760
+ <field name="state_code">E-CC01-0031</field>
1761
+ <field name="wizard_result">SUCCESS</field>
1762
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A2397_-_OK_RCU___verifica_data_decorrenza')])]"/>
1763
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
1764
+ </record>
1765
+ <record id="symple_triplet_phase_A1321_-_Errore_CRM__RC1_" model="symple.triplet.phase">
1766
+ <field name="active">True</field>
1767
+ <field name="child_case">False</field>
1768
+ <field name="code"># Available variables:
1769
+ # - case_id: the case that just reached this phase
1770
+ # - request: allows you to make HTTP requests (method, url, headers, data)
1771
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
1772
+ # - json_load: allows you to use JSON.load to convert a json into an object
1773
+ # - env: Odoo Environment on which the action is triggered
1774
+ # - time, datetime, dateutil, timezone: useful Python libraries
1775
+ # - float_compare: Odoo function to compare floats based on specific precisions
1776
+ # - ValidationError: Warning Exception to use with raise
1777
+ # - Command: x2Many commands namespace
1778
+ # - OrderedDict: ordered dictionaries
1779
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
1780
+ # (line = case id, func = phase name)
1781
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
1782
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
1783
+ # To return a result, assign: result = {...}
1784
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
1785
+ # phase result will not be set.
1786
+
1787
+
1788
+
1789
+ </field>
1790
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','AMS')])" />
1791
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
1792
+ <field name="is_a_postalizer_phase">False</field>
1793
+ <field name="is_compute_refund">False</field>
1794
+ <field name="is_dl">False</field>
1795
+ <field name="is_needs_child_case">False</field>
1796
+ <field name="is_pick_refund_template">False</field>
1797
+ <field name="is_process_managed">False</field>
1798
+ <field name="is_quote_accepted">False</field>
1799
+ <field name="is_quote_sent">False</field>
1800
+ <field name="is_timeout">False</field>
1801
+ <field name="is_voidable">False</field>
1802
+ <field name="name">A1321 - Errore CRM (RC1)</field>
1803
+ </record>
1804
+ <record id="symple_triplet_phase_result_C1899_-_Errore_CRM_durante_Chiusura_Ordine_E-CC01-0033" model="symple.triplet.phase.result">
1805
+ <field name="active">True</field>
1806
+ <field name="has_message">False</field>
1807
+ <field name="is_annulment">False</field>
1808
+ <field name="is_dl_solicitation_result">False</field>
1809
+ <field name="is_hidden">False</field>
1810
+ <field name="is_quote_expired">False</field>
1811
+ <field name="name">C1899 - Errore CRM durante Chiusura Ordine</field>
1812
+ <field name="next_phase_id" ref="symple_triplet_phase_A1321_-_Errore_CRM__RC1_"/>
1813
+ <field name="state_code">E-CC01-0033</field>
1814
+ <field name="wizard_result">SUCCESS</field>
1815
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1577_-_Chiusura_Ordine_CRM')])]"/>
1816
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
1817
+ </record>
1818
+ <record id="symple_triplet_phase_A2398_-_Invio_ordine_CRM" model="symple.triplet.phase">
1819
+ <field name="active">True</field>
1820
+ <field name="child_case">False</field>
1821
+ <field name="code"># Available variables:
1822
+ # - case_id: the case that just reached this phase
1823
+ # - request: allows you to make HTTP requests (method, url, headers, data)
1824
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
1825
+ # - json_load: allows you to use JSON.load to convert a json into an object
1826
+ # - env: Odoo Environment on which the action is triggered
1827
+ # - time, datetime, dateutil, timezone: useful Python libraries
1828
+ # - float_compare: Odoo function to compare floats based on specific precisions
1829
+ # - ValidationError: Warning Exception to use with raise
1830
+ # - Command: x2Many commands namespace
1831
+ # - OrderedDict: ordered dictionaries
1832
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
1833
+ # (line = case id, func = phase name)
1834
+ # To return a result, assign: result = {...}
1835
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
1836
+ # phase result will not be set.
1837
+
1838
+ logs = []
1839
+
1840
+
1841
+ def log_and_parse_response(response, log_message):
1842
+ try:
1843
+ json_data = response.json()
1844
+ logs.append({"message": log_message, "data": json_data})
1845
+ return json_data
1846
+ except Exception:
1847
+ logs.append({"message": log_message, "response_text": response.text})
1848
+ return response.text
1849
+
1850
+
1851
+ def get_contract(contract_id, token):
1852
+ response = request(
1853
+ "GET",
1854
+ "http://b2w-cpq-order-management-service/v1/contract/{}".format(contract_id),
1855
+ headers={"X-Auth-Request-Access-Token": "" + token},
1856
+ )
1857
+
1858
+ json = log_and_parse_response(response, "get_contract")
1859
+
1860
+ if response.status_code != 200:
1861
+ raise ValidationError("Failed to download contract from B2W API")
1862
+
1863
+ return json
1864
+
1865
+
1866
+ def write_disconnect_date(asset_id, token):
1867
+ dt = "{}T00:00:00.000+00:00".format(case_id.disconnect_date.isoformat())
1868
+ body = {"disconnectdate": dt}
1869
+
1870
+ response = request(
1871
+ "PATCH",
1872
+ "http://b2w-cpq-order-management-service/v1/asset/{}".format(asset_id),
1873
+ headers={"X-Auth-Request-Access-Token": "" + token},
1874
+ data=json_dumps(body),
1875
+ )
1876
+
1877
+ log_and_parse_response(response, "patch asset")
1878
+
1879
+ if response.status_code != 200:
1880
+ raise ValidationError("Failed to patch asset")
1881
+
1882
+
1883
+ def order2asset(order_id, token):
1884
+ url = "http://b2w-cpq-order-management-service/v1/order/asset/{}".format(order_id)
1885
+ headers = {
1886
+ "X-Auth-Request-Access-Token": "" + token,
1887
+ "Content-Type": "application/json",
1888
+ "generatesession": "true",
1889
+ }
1890
+
1891
+ response = request("POST", url, headers=headers, data=json_dumps([]))
1892
+ json = log_and_parse_response(
1893
+ response,
1894
+ "Order2Asset response",
1895
+ )
1896
+
1897
+ if response.status_code != 200:
1898
+ raise ValidationError("Failed to launch order2asset")
1899
+
1900
+ return json
1901
+
1902
+
1903
+ try:
1904
+ IrConfigParam = env["ir.config_parameter"].sudo()
1905
+ token = IrConfigParam.get_b2w_access_token()
1906
+
1907
+ kv_store = case_id.sudo().kv_store()
1908
+
1909
+ order_id = kv_store.get("order_id")
1910
+ contract_id = kv_store.get("contract_id")
1911
+ asset_id = kv_store.get("asset_id")
1912
+
1913
+ if not order_id or not contract_id:
1914
+ raise ValidationError("Order ID or Contract ID not found on case")
1915
+
1916
+ order2asset(order_id, token)
1917
+ logs.append({"message": "order2asset done"})
1918
+
1919
+ date_fmt = (case_id.disconnect_date or datetime.datetime.now()).strftime(
1920
+ "%Y-%m-%dT%H:%M:%S.%f"
1921
+ ) + "Z"
1922
+
1923
+ statemodel_result = IrConfigParam.update_b2w_statemodel(
1924
+ "cessato",
1925
+ sm_reason=case_id.ticket_type_id.name,
1926
+ expected_date=date_fmt,
1927
+ asset_id=asset_id,
1928
+ token=token,
1929
+ )
1930
+ logs.append({"message": "Statemodel updates on asset", "data": statemodel_result})
1931
+
1932
+ write_disconnect_date(asset_id, token)
1933
+
1934
+ case_id.service_point_ids[0].sudo().write(
1935
+ {
1936
+ "state": "inactive",
1937
+ "supply_end_date": datetime.datetime.today().strftime("%Y-%m-%d"),
1938
+ }
1939
+ )
1940
+
1941
+ contract = get_contract(contract_id, token)
1942
+
1943
+ if contract.get("status") == "disconnected":
1944
+ statemodel_result = IrConfigParam.update_b2w_statemodel(
1945
+ "cessato",
1946
+ sm_reason=case_id.ticket_type_id.name,
1947
+ expected_date=date_fmt,
1948
+ contract_id=contract_id,
1949
+ token=token,
1950
+ )
1951
+ logs.append(
1952
+ {"message": "Statemodel updates on contract", "data": statemodel_result}
1953
+ )
1954
+ kv_store.set("is_contract_disconnected", True)
1955
+ else:
1956
+ kv_store.set("is_contract_disconnected", False)
1957
+
1958
+ logs.append({"message": "service point updated"})
1959
+
1960
+ result = "OK"
1961
+
1962
+ except Exception as e:
1963
+ logs.append({"message": str(e), "traceback": format_exc()})
1964
+ case_id.write(
1965
+ {"error_message": "Errore durante l'esecuzione della fase: {}".format(str(e))}
1966
+ )
1967
+
1968
+
1969
+ if logs:
1970
+ log(json_dumps(logs))</field>
1971
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
1972
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
1973
+ <field name="is_a_postalizer_phase">False</field>
1974
+ <field name="is_compute_refund">False</field>
1975
+ <field name="is_dl">False</field>
1976
+ <field name="is_needs_child_case">False</field>
1977
+ <field name="is_pick_refund_template">False</field>
1978
+ <field name="is_process_managed">False</field>
1979
+ <field name="is_quote_accepted">False</field>
1980
+ <field name="is_quote_sent">False</field>
1981
+ <field name="is_timeout">False</field>
1982
+ <field name="is_voidable">False</field>
1983
+ <field name="name">A2398 - Invio ordine CRM</field>
1984
+ <field name="set_result_automatically">from_code</field>
1985
+ </record>
1986
+ <record id="symple_triplet_phase_result_C2242_-_Chiusura_Ordine_OK_E-CC01-0032" model="symple.triplet.phase.result">
1987
+ <field name="active">True</field>
1988
+ <field name="has_message">False</field>
1989
+ <field name="is_annulment">False</field>
1990
+ <field name="is_dl_solicitation_result">False</field>
1991
+ <field name="is_hidden">False</field>
1992
+ <field name="is_quote_expired">False</field>
1993
+ <field name="name">C2242 - Chiusura Ordine OK</field>
1994
+ <field name="next_phase_id" ref="symple_triplet_phase_A2398_-_Invio_ordine_CRM"/>
1995
+ <field name="state_code">E-CC01-0032</field>
1996
+ <field name="wizard_result">SUCCESS</field>
1997
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1577_-_Chiusura_Ordine_CRM')])]"/>
1998
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
1999
+ </record>
2000
+ <record id="symple_triplet_phase_result_C1616_-_Risoluzione_Errore_E-CC01-0034" model="symple.triplet.phase.result">
2001
+ <field name="active">True</field>
2002
+ <field name="has_message">False</field>
2003
+ <field name="is_annulment">False</field>
2004
+ <field name="is_dl_solicitation_result">False</field>
2005
+ <field name="is_hidden">False</field>
2006
+ <field name="is_quote_expired">False</field>
2007
+ <field name="name">C1616 - Risoluzione Errore</field>
2008
+ <field name="next_phase_id" ref="symple_triplet_phase_A2398_-_Invio_ordine_CRM"/>
2009
+ <field name="state_code">E-CC01-0034</field>
2010
+ <field name="wizard_result">SUCCESS</field>
2011
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1321_-_Errore_CRM__RC1_')])]"/>
2012
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
2013
+ </record>
2014
+ <record id="symple_triplet_phase_A0802_-_Integrazione_M2C" model="symple.triplet.phase">
2015
+ <field name="active">True</field>
2016
+ <field name="child_case">False</field>
2017
+ <field name="code"># Available variables:
2018
+ # - case_id: the case that just reached this phase
2019
+ # - request: allows you to make HTTP requests (method, url, headers, data)
2020
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
2021
+ # - json_load: allows you to use JSON.load to convert a json into an object
2022
+ # - env: Odoo Environment on which the action is triggered
2023
+ # - time, datetime, dateutil, timezone: useful Python libraries
2024
+ # - float_compare: Odoo function to compare floats based on specific precisions
2025
+ # - ValidationError: Warning Exception to use with raise
2026
+ # - Command: x2Many commands namespace
2027
+ # - OrderedDict: ordered dictionaries
2028
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
2029
+ # (line = case id, func = phase name)
2030
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
2031
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
2032
+ # To return a result, assign: result = {...}
2033
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
2034
+ # phase result will not be set.
2035
+
2036
+
2037
+ logs = []
2038
+
2039
+ ServicePoint = env["service.point"]
2040
+
2041
+ try:
2042
+ is_contract_done, contract_id = case_id.sudo().kv_store().get_many(
2043
+ "is_contract_disconnected", "contract_id"
2044
+ )
2045
+ date_fmt = case_id.disconnect_date.strftime("%d%m%Y")
2046
+
2047
+ logs.append({"date": date_fmt})
2048
+
2049
+ next_phase_result = (
2050
+ case_id.triplet_active_phase_id.allowed_phase_result_ids.filtered(
2051
+ lambda x: x.wizard_result == "SUCCESS"
2052
+ )[0]
2053
+ )
2054
+ ending_phase_result = (
2055
+ next_phase_result.next_phase_id.allowed_phase_result_ids.filtered(
2056
+ lambda x: x.wizard_result == "SUCCESS"
2057
+ )[0].state_code
2058
+ )
2059
+
2060
+ sp = case_id.service_point_ids[0]
2061
+ bp = sp.billing_profile_id
2062
+ podPdr = sp.pod_id if sp.pod_id else sp.pdr_id
2063
+
2064
+ json_dict = {
2065
+ "caseId": str(case_id.id),
2066
+ "flow": "m2c_passthrough",
2067
+ "azione": {
2068
+ "protocollo": str(case_id.id),
2069
+ "case": case_id.ticket_type_id.name,
2070
+ "cliente": {
2071
+ "cCodiceBP": case_id.customer_id.golden_key,
2072
+ "cCodiceCrm": case_id.customer_code,
2073
+ "contrattiMandato": [
2074
+ {
2075
+ "cCodiceContrattoMandato": bp.name,
2076
+ "contratti": {
2077
+ "cCodiceContratto": contract_id,
2078
+ "forniture": [
2079
+ {
2080
+ "cPodPdr": podPdr.code,
2081
+ "cCodicePR": sp.code,
2082
+ "cCausaleCessazione": case_id.ticket_type_id.name,
2083
+ "cStatoFornitura": "CESSATO",
2084
+ "dFineContrattoFornitura": date_fmt,
2085
+ }
2086
+ ],
2087
+ },
2088
+ }
2089
+ ],
2090
+ },
2091
+ },
2092
+ "m2c_callback_esito": ending_phase_result,
2093
+ }
2094
+
2095
+ if is_contract_done:
2096
+ json_dict["azione"]["cliente"]["contrattiMandato"][0]["contratti"][
2097
+ "dFineContratto"
2098
+ ] = date_fmt
2099
+
2100
+ has_active_points = ServicePoint.search(
2101
+ [("client_id", "=", case_id.customer_id.id), ("state", "!=", "inactive")]
2102
+ ).exists()
2103
+
2104
+ if not has_active_points:
2105
+ json_dict["azione"]["cliente"]["xStatoBp"] = "CESSATO"
2106
+
2107
+ tenant_id = env["ir.config_parameter"].sudo().get_param("m2c_header_tenant_id")
2108
+ org_token = env["ir.config_parameter"].sudo().get_param("m2c_header_org_token")
2109
+ token = env["symple.pb.launcher"].get_access_token()
2110
+ headers = {
2111
+ "tenantId": tenant_id,
2112
+ "orgToken": org_token,
2113
+ "Content-Type": "application/json",
2114
+ "X-Auth-Request-Access-Token": token,
2115
+ }
2116
+
2117
+ logs.append({"message": "m2c", "data": json_dict})
2118
+
2119
+ m2c_url = "http://b2w-symphony-rest-service/api/symphony/process-instances/M2C_passthrough"
2120
+ response = request("POST", m2c_url, headers=headers, data=json_dumps(json_dict))
2121
+ result = "OK"
2122
+
2123
+
2124
+ except Exception as e:
2125
+ logs.append({"message": str(e), "traceback": format_exc()})
2126
+ prev = case_id.info_message + "\n" if case_id.info_message else ""
2127
+ case_id.write({"info_message": prev + str(e)})
2128
+
2129
+ if logs:
2130
+ log(json_dumps(logs))</field>
2131
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
2132
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
2133
+ <field name="is_a_postalizer_phase">False</field>
2134
+ <field name="is_compute_refund">False</field>
2135
+ <field name="is_dl">False</field>
2136
+ <field name="is_needs_child_case">False</field>
2137
+ <field name="is_pick_refund_template">False</field>
2138
+ <field name="is_process_managed">False</field>
2139
+ <field name="is_quote_accepted">False</field>
2140
+ <field name="is_quote_sent">False</field>
2141
+ <field name="is_timeout">False</field>
2142
+ <field name="is_voidable">False</field>
2143
+ <field name="name">A0802 - Integrazione M2C</field>
2144
+ <field name="set_result_automatically">from_code</field>
2145
+ </record>
2146
+ <record id="symple_triplet_phase_result_C1900_-_Integrazione_M2C_E-CC01-0035" model="symple.triplet.phase.result">
2147
+ <field name="active">True</field>
2148
+ <field name="has_message">False</field>
2149
+ <field name="is_annulment">False</field>
2150
+ <field name="is_dl_solicitation_result">False</field>
2151
+ <field name="is_hidden">False</field>
2152
+ <field name="is_quote_expired">False</field>
2153
+ <field name="name">C1900 - Integrazione M2C</field>
2154
+ <field name="next_phase_id" ref="symple_triplet_phase_A0802_-_Integrazione_M2C"/>
2155
+ <field name="state_code">E-CC01-0035</field>
2156
+ <field name="wizard_result">SUCCESS</field>
2157
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A2398_-_Invio_ordine_CRM')])]"/>
2158
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
2159
+ </record>
2160
+ <record id="symple_triplet_phase_A0803_-_In_attesa_esito_M2C" model="symple.triplet.phase">
2161
+ <field name="active">True</field>
2162
+ <field name="child_case">False</field>
2163
+ <field name="code"># Available variables:
2164
+ # - case_id: the case that just reached this phase
2165
+ # - request: allows you to make HTTP requests (method, url, headers, data)
2166
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
2167
+ # - json_load: allows you to use JSON.load to convert a json into an object
2168
+ # - env: Odoo Environment on which the action is triggered
2169
+ # - time, datetime, dateutil, timezone: useful Python libraries
2170
+ # - float_compare: Odoo function to compare floats based on specific precisions
2171
+ # - ValidationError: Warning Exception to use with raise
2172
+ # - Command: x2Many commands namespace
2173
+ # - OrderedDict: ordered dictionaries
2174
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
2175
+ # (line = case id, func = phase name)
2176
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
2177
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
2178
+ # To return a result, assign: result = {...}
2179
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
2180
+ # phase result will not be set.
2181
+
2182
+
2183
+
2184
+ </field>
2185
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
2186
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
2187
+ <field name="is_a_postalizer_phase">False</field>
2188
+ <field name="is_compute_refund">False</field>
2189
+ <field name="is_dl">False</field>
2190
+ <field name="is_needs_child_case">False</field>
2191
+ <field name="is_pick_refund_template">False</field>
2192
+ <field name="is_process_managed">False</field>
2193
+ <field name="is_quote_accepted">False</field>
2194
+ <field name="is_quote_sent">False</field>
2195
+ <field name="is_timeout">False</field>
2196
+ <field name="is_voidable">False</field>
2197
+ <field name="name">A0803 - In attesa esito M2C</field>
2198
+ </record>
2199
+ <record id="symple_triplet_phase_result_C1904_-_In_attesa_esito_M2C_E-CC01-0036" model="symple.triplet.phase.result">
2200
+ <field name="active">True</field>
2201
+ <field name="has_message">False</field>
2202
+ <field name="is_annulment">False</field>
2203
+ <field name="is_dl_solicitation_result">False</field>
2204
+ <field name="is_hidden">False</field>
2205
+ <field name="is_quote_expired">False</field>
2206
+ <field name="name">C1904 - In attesa esito M2C</field>
2207
+ <field name="next_phase_id" ref="symple_triplet_phase_A0803_-_In_attesa_esito_M2C"/>
2208
+ <field name="state_code">E-CC01-0036</field>
2209
+ <field name="wizard_result">SUCCESS</field>
2210
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A0802_-_Integrazione_M2C')])]"/>
2211
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
2212
+ </record>
2213
+ <record id="symple_triplet_phase_A1836_-_Apertura_case_figlio" model="symple.triplet.phase">
2214
+ <field name="active">True</field>
2215
+ <field name="child_case">False</field>
2216
+ <field name="code"># Available variables:
2217
+ # - case_id: the case that just reached this phase
2218
+ # - request: allows you to make HTTP requests (method, url, headers, data)
2219
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
2220
+ # - json_load: allows you to use JSON.load to convert a json into an object
2221
+ # - env: Odoo Environment on which the action is triggered
2222
+ # - time, datetime, dateutil, timezone: useful Python libraries
2223
+ # - float_compare: Odoo function to compare floats based on specific precisions
2224
+ # - ValidationError: Warning Exception to use with raise
2225
+ # - Command: x2Many commands namespace
2226
+ # - OrderedDict: ordered dictionaries
2227
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
2228
+ # (line = case id, func = phase name)
2229
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
2230
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
2231
+ # To return a result, assign: result = {...}
2232
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
2233
+ # phase result will not be set.
2234
+
2235
+
2236
+
2237
+ </field>
2238
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
2239
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
2240
+ <field name="is_a_postalizer_phase">False</field>
2241
+ <field name="is_compute_refund">False</field>
2242
+ <field name="is_dl">False</field>
2243
+ <field name="is_needs_child_case">False</field>
2244
+ <field name="is_pick_refund_template">False</field>
2245
+ <field name="is_process_managed">False</field>
2246
+ <field name="is_quote_accepted">False</field>
2247
+ <field name="is_quote_sent">False</field>
2248
+ <field name="is_timeout">False</field>
2249
+ <field name="is_voidable">False</field>
2250
+ <field name="name">A1836 - Apertura case figlio</field>
2251
+ <field name="set_result_automatically">from_code</field>
2252
+ </record>
2253
+ <record id="symple_triplet_phase_result_C2552_-_Elaborazione_bloccata_nel_M2C_E-CC01-0039" model="symple.triplet.phase.result">
2254
+ <field name="active">True</field>
2255
+ <field name="has_message">False</field>
2256
+ <field name="is_annulment">False</field>
2257
+ <field name="is_dl_solicitation_result">False</field>
2258
+ <field name="is_hidden">False</field>
2259
+ <field name="is_quote_expired">False</field>
2260
+ <field name="name">C2552 - Elaborazione bloccata nel M2C</field>
2261
+ <field name="next_phase_id" ref="symple_triplet_phase_A1836_-_Apertura_case_figlio"/>
2262
+ <field name="state_code">E-CC01-0039</field>
2263
+ <field name="wizard_result">SUCCESS</field>
2264
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A0803_-_In_attesa_esito_M2C')])]"/>
2265
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
2266
+ </record>
2267
+ <record id="symple_triplet_phase_A1595_-_Invio_Annullamento_alla_Market_Communication" model="symple.triplet.phase">
2268
+ <field name="active">True</field>
2269
+ <field name="child_case">False</field>
2270
+ <field name="code"># Available variables:
2271
+ # - case_id: the case that just reached this phase
2272
+ # - request: allows you to make HTTP requests (method, url, headers, data)
2273
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
2274
+ # - json_load: allows you to use JSON.load to convert a json into an object
2275
+ # - env: Odoo Environment on which the action is triggered
2276
+ # - time, datetime, dateutil, timezone: useful Python libraries
2277
+ # - float_compare: Odoo function to compare floats based on specific precisions
2278
+ # - ValidationError: Warning Exception to use with raise
2279
+ # - Command: x2Many commands namespace
2280
+ # - OrderedDict: ordered dictionaries
2281
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
2282
+ # (line = case id, func = phase name)
2283
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
2284
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
2285
+ # To return a result, assign: result = {...}
2286
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
2287
+ # phase result will not be set.
2288
+
2289
+ logs = []
2290
+ bypass = False
2291
+
2292
+
2293
+ def _hub(x):
2294
+ return x.flow_code == "HUB"
2295
+
2296
+
2297
+ def _0100(x):
2298
+ return x.flow_code == "0100"
2299
+
2300
+
2301
+ def get_apr_reason():
2302
+ kv_store = case_id.sudo().kv_store()
2303
+ reason_code = kv_store.get("annulment_wizard_motivation")
2304
+ map_motivazione = {
2305
+ "RC01": "Annullamento RC per esecuzione di altra prestazione",
2306
+ "RC02": "Annullamento RC per disattivazione della fornitura",
2307
+ "RC04": "Revoca risoluzione per pratica errata",
2308
+ "RG01": "Revoca RCG per esecuzione di altra prestazione",
2309
+ "RG03": "Revoca risoluzione per errata trasmissione",
2310
+ }
2311
+
2312
+ return reason_code, map_motivazione.get(reason_code, "")
2313
+
2314
+
2315
+ def get_last_hub():
2316
+ return case_id.market_comm_event_log_ids.filtered(_hub)
2317
+
2318
+
2319
+ def get_last_0100():
2320
+ logs = case_id.market_comm_event_log_ids.filtered(_0100)
2321
+ return logs[-1]
2322
+
2323
+
2324
+ def main():
2325
+ ifs_data_message = None
2326
+ sp = case_id.service_point_ids[0]
2327
+ is_ele = sp.pod_id.exists()
2328
+
2329
+ log_hub = get_last_hub()
2330
+ log_100 = get_last_0100()
2331
+
2332
+ if not log_hub or not log_100:
2333
+ raise Exception("Payload HUB e 0100 non recuperati.")
2334
+
2335
+ content_hub = json_loads(log_hub.inner_payload)
2336
+ content_100 = json_loads(log_100.inner_payload)
2337
+
2338
+ causale, motivazione = get_apr_reason()
2339
+ cp_utente = content_hub.get("CP_UTENTE")
2340
+ cp_gestore = content_100.get("CP_GESTORE")
2341
+
2342
+ ifs_data_message = {
2343
+ "COD_SERVIZIO": "APR",
2344
+ "COD_FLUSSO": "0050",
2345
+ "CP_GESTORE_ANN": cp_gestore,
2346
+ "CP_UTENTE_ANN": cp_utente,
2347
+ "COD_CAUSALE": causale,
2348
+ "MOTIVAZIONE": motivazione,
2349
+ "COD_POD_PDR": sp.pod_id.code if is_ele else sp.pdr_id.code,
2350
+ "SETTORE": "G",
2351
+ "NOTE": "",
2352
+ "EMAIL": "",
2353
+ "COD_RICHIESTA": content_hub.get("COD_RICHIESTA"),
2354
+ "OWNER": "SORGE",
2355
+ }
2356
+
2357
+ ifs_dict = {
2358
+ "ifs_code": "APR",
2359
+ "case_id": str(case_id.id),
2360
+ "ifs_data_message": ifs_data_message,
2361
+ "is_annullment": True,
2362
+ "cp_utente": cp_utente,
2363
+ "cp_gestore": cp_gestore,
2364
+ }
2365
+
2366
+ ifs_json = json_dumps(ifs_dict)
2367
+ tenant_id = env["ir.config_parameter"].sudo().get_param("m2c_header_tenant_id")
2368
+ org_token = env["ir.config_parameter"].sudo().get_param("m2c_header_org_token")
2369
+ headers = {"tenantId": tenant_id, "orgToken": org_token}
2370
+ btw_url = "http://b2w-symphony-rest-service/api/symphony/process-instances/ml_IFS_passthrough"
2371
+ response = request("POST", btw_url, headers=headers, data=ifs_json)
2372
+
2373
+ if str(response.status_code) != "200":
2374
+ raise ValidationError(str(response.status_code) + " " + str(response.text))
2375
+
2376
+ return "OK"
2377
+
2378
+
2379
+ try:
2380
+ result = main()
2381
+ except Exception as e:
2382
+ logs.append({"message": str(e), "traceback": format_exc()})
2383
+ prev = case_id.info_message + "\n" if case_id.info_message else ""
2384
+ case_id.write({"error_message": str(e)})
2385
+
2386
+ result = "KO"
2387
+
2388
+
2389
+ if logs:
2390
+ log(json_dumps(logs))</field>
2391
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
2392
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
2393
+ <field name="is_a_postalizer_phase">False</field>
2394
+ <field name="is_compute_refund">False</field>
2395
+ <field name="is_dl">False</field>
2396
+ <field name="is_needs_child_case">False</field>
2397
+ <field name="is_pick_refund_template">False</field>
2398
+ <field name="is_process_managed">False</field>
2399
+ <field name="is_quote_accepted">False</field>
2400
+ <field name="is_quote_sent">False</field>
2401
+ <field name="is_timeout">False</field>
2402
+ <field name="is_voidable">False</field>
2403
+ <field name="name">A1595 - Invio Annullamento alla Market Communication</field>
2404
+ <field name="set_result_automatically">from_code</field>
2405
+ </record>
2406
+ <record id="symple_triplet_phase_result_C2549_-_annullamento_attivo_E-CC01-0029" model="symple.triplet.phase.result">
2407
+ <field name="active">True</field>
2408
+ <field name="has_message">False</field>
2409
+ <field name="is_annulment">False</field>
2410
+ <field name="is_dl_solicitation_result">False</field>
2411
+ <field name="is_hidden">False</field>
2412
+ <field name="is_quote_expired">False</field>
2413
+ <field name="name">C2549 - annullamento attivo</field>
2414
+ <field name="next_phase_id" ref="symple_triplet_phase_A1595_-_Invio_Annullamento_alla_Market_Communication"/>
2415
+ <field name="state_code">E-CC01-0029</field>
2416
+ <field name="wizard_result">CANCEL</field>
2417
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1004_-_Verifica_RCU___Data_decorrenza')])]"/>
2418
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Cancel')])" />
2419
+ </record>
2420
+ <record id="symple_triplet_phase_A1767_-_In_attesa_check_IFS_Annullamento" model="symple.triplet.phase">
2421
+ <field name="active">True</field>
2422
+ <field name="child_case">False</field>
2423
+ <field name="code"># Available variables:
2424
+ # - case_id: the case that just reached this phase
2425
+ # - request: allows you to make HTTP requests (method, url, headers, data)
2426
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
2427
+ # - json_load: allows you to use JSON.load to convert a json into an object
2428
+ # - env: Odoo Environment on which the action is triggered
2429
+ # - time, datetime, dateutil, timezone: useful Python libraries
2430
+ # - float_compare: Odoo function to compare floats based on specific precisions
2431
+ # - ValidationError: Warning Exception to use with raise
2432
+ # - Command: x2Many commands namespace
2433
+ # - OrderedDict: ordered dictionaries
2434
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
2435
+ # (line = case id, func = phase name)
2436
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
2437
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
2438
+ # To return a result, assign: result = {...}
2439
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
2440
+ # phase result will not be set.
2441
+
2442
+
2443
+
2444
+ </field>
2445
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
2446
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
2447
+ <field name="is_a_postalizer_phase">False</field>
2448
+ <field name="is_compute_refund">False</field>
2449
+ <field name="is_dl">False</field>
2450
+ <field name="is_needs_child_case">False</field>
2451
+ <field name="is_pick_refund_template">False</field>
2452
+ <field name="is_process_managed">False</field>
2453
+ <field name="is_quote_accepted">False</field>
2454
+ <field name="is_quote_sent">False</field>
2455
+ <field name="is_timeout">False</field>
2456
+ <field name="is_voidable">False</field>
2457
+ <field name="name">A1767 - In attesa check IFS Annullamento</field>
2458
+ </record>
2459
+ <record id="symple_triplet_phase_result_C1019_-_Inviata_E-CC01-0041" model="symple.triplet.phase.result">
2460
+ <field name="active">True</field>
2461
+ <field name="has_message">False</field>
2462
+ <field name="is_annulment">False</field>
2463
+ <field name="is_dl_solicitation_result">False</field>
2464
+ <field name="is_hidden">False</field>
2465
+ <field name="is_quote_expired">False</field>
2466
+ <field name="name">C1019 - Inviata</field>
2467
+ <field name="next_phase_id" ref="symple_triplet_phase_A1767_-_In_attesa_check_IFS_Annullamento"/>
2468
+ <field name="state_code">E-CC01-0041</field>
2469
+ <field name="wizard_result">SUCCESS</field>
2470
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1595_-_Invio_Annullamento_alla_Market_Communication')])]"/>
2471
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
2472
+ </record>
2473
+ <record id="symple_triplet_phase_result_C1448_-_OK_controlli_RCU_E-CC01-0046" model="symple.triplet.phase.result">
2474
+ <field name="active">True</field>
2475
+ <field name="has_message">False</field>
2476
+ <field name="is_annulment">False</field>
2477
+ <field name="is_dl_solicitation_result">False</field>
2478
+ <field name="is_hidden">False</field>
2479
+ <field name="is_quote_expired">False</field>
2480
+ <field name="name">C1448 - OK controlli RCU</field>
2481
+ <field name="next_phase_id" ref="symple_triplet_phase_A2397_-_OK_RCU___verifica_data_decorrenza"/>
2482
+ <field name="state_code">E-CC01-0046</field>
2483
+ <field name="wizard_result">SUCCESS</field>
2484
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1767_-_In_attesa_check_IFS_Annullamento')])]"/>
2485
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
2486
+ </record>
2487
+ <record id="symple_triplet_phase_A2562_-_verifica_avvio_gestione_manuale_annullamento" model="symple.triplet.phase">
2488
+ <field name="active">True</field>
2489
+ <field name="child_case">False</field>
2490
+ <field name="code"># Available variables:
2491
+ # - case_id: the case that just reached this phase
2492
+ # - request: allows you to make HTTP requests (method, url, headers, data)
2493
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
2494
+ # - json_load: allows you to use JSON.load to convert a json into an object
2495
+ # - env: Odoo Environment on which the action is triggered
2496
+ # - time, datetime, dateutil, timezone: useful Python libraries
2497
+ # - float_compare: Odoo function to compare floats based on specific precisions
2498
+ # - ValidationError: Warning Exception to use with raise
2499
+ # - Command: x2Many commands namespace
2500
+ # - OrderedDict: ordered dictionaries
2501
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
2502
+ # (line = case id, func = phase name)
2503
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
2504
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
2505
+ # To return a result, assign: result = {...}
2506
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
2507
+ # phase result will not be set.
2508
+
2509
+
2510
+
2511
+ </field>
2512
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','BOT')])" />
2513
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
2514
+ <field name="is_a_postalizer_phase">False</field>
2515
+ <field name="is_compute_refund">False</field>
2516
+ <field name="is_dl">False</field>
2517
+ <field name="is_needs_child_case">False</field>
2518
+ <field name="is_pick_refund_template">False</field>
2519
+ <field name="is_process_managed">False</field>
2520
+ <field name="is_quote_accepted">False</field>
2521
+ <field name="is_quote_sent">False</field>
2522
+ <field name="is_timeout">False</field>
2523
+ <field name="is_voidable">False</field>
2524
+ <field name="name">A2562 - verifica avvio gestione manuale annullamento</field>
2525
+ </record>
2526
+ <record id="symple_triplet_phase_result_C2509_-_Da_gestire_nuovo_invio_automatico_E-CC01-0049" model="symple.triplet.phase.result">
2527
+ <field name="active">True</field>
2528
+ <field name="has_message">False</field>
2529
+ <field name="is_annulment">False</field>
2530
+ <field name="is_dl_solicitation_result">False</field>
2531
+ <field name="is_hidden">False</field>
2532
+ <field name="is_quote_expired">False</field>
2533
+ <field name="name">C2509 - Da gestire nuovo invio automatico</field>
2534
+ <field name="next_phase_id" ref="symple_triplet_phase_A1595_-_Invio_Annullamento_alla_Market_Communication"/>
2535
+ <field name="state_code">E-CC01-0049</field>
2536
+ <field name="wizard_result">SUCCESS</field>
2537
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A2562_-_verifica_avvio_gestione_manuale_annullamento')])]"/>
2538
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
2539
+ </record>
2540
+ <record id="symple_triplet_phase_result_C1448_-_OK_controlli_RCU_E-CC01-0051" model="symple.triplet.phase.result">
2541
+ <field name="active">True</field>
2542
+ <field name="has_message">False</field>
2543
+ <field name="is_annulment">False</field>
2544
+ <field name="is_dl_solicitation_result">False</field>
2545
+ <field name="is_hidden">False</field>
2546
+ <field name="is_quote_expired">False</field>
2547
+ <field name="name">C1448 - OK controlli RCU</field>
2548
+ <field name="next_phase_id" ref="symple_triplet_phase_A2397_-_OK_RCU___verifica_data_decorrenza"/>
2549
+ <field name="state_code">E-CC01-0051</field>
2550
+ <field name="wizard_result">SUCCESS</field>
2551
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A2562_-_verifica_avvio_gestione_manuale_annullamento')])]"/>
2552
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
2553
+ </record>
2554
+ <record id="symple_triplet_phase_A2142_-_Invio_alla_marketcom_annullamento_forzato" model="symple.triplet.phase">
2555
+ <field name="active">True</field>
2556
+ <field name="child_case">False</field>
2557
+ <field name="code"># Available variables:
2558
+ # - case_id: the case that just reached this phase
2559
+ # - request: allows you to make HTTP requests (method, url, headers, data)
2560
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
2561
+ # - json_load: allows you to use JSON.load to convert a json into an object
2562
+ # - env: Odoo Environment on which the action is triggered
2563
+ # - time, datetime, dateutil, timezone: useful Python libraries
2564
+ # - float_compare: Odoo function to compare floats based on specific precisions
2565
+ # - ValidationError: Warning Exception to use with raise
2566
+ # - Command: x2Many commands namespace
2567
+ # - OrderedDict: ordered dictionaries
2568
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
2569
+ # (line = case id, func = phase name)
2570
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
2571
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
2572
+ # To return a result, assign: result = {...}
2573
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
2574
+ # phase result will not be set.
2575
+
2576
+ logs = []
2577
+ bypass = True
2578
+
2579
+
2580
+ def get_apr_reason():
2581
+ kv_store = case_id.sudo().kv_store()
2582
+ reason_code = kv_store.get("annulment_wizard_motivation")
2583
+ map_motivazione = {
2584
+ "RC01": "Annullamento RC per esecuzione di altra prestazione",
2585
+ "RC02": "Annullamento RC per disattivazione della fornitura",
2586
+ "RC04": "Revoca risoluzione per pratica errata",
2587
+ "RG01": "Revoca RCG per esecuzione di altra prestazione",
2588
+ "RG03": "Revoca risoluzione per errata trasmissione",
2589
+ }
2590
+
2591
+ return reason_code, map_motivazione.get(reason_code, "")
2592
+
2593
+
2594
+ try:
2595
+ sp = case_id.service_point_ids[0]
2596
+ podPdr = sp.pod_id if sp.pod_id else sp.pdr_id
2597
+ cod_causale, motivazione = get_apr_reason()
2598
+
2599
+ tenant_id = env["ir.config_parameter"].sudo().get_param("m2c_header_tenant_id")
2600
+ org_token = env["ir.config_parameter"].sudo().get_param("m2c_header_org_token")
2601
+ headers = {"tenantId": tenant_id, "orgToken": org_token}
2602
+ ok_payload = {
2603
+ "refName": "Annulment",
2604
+ "refId": case_id.symphonie_process,
2605
+ "messageProcessVars": {
2606
+ "ifs_code": "APR",
2607
+ "bypass": bypass,
2608
+ "aprInfo": {
2609
+ "COD_CAUSALE": cod_causale,
2610
+ "MOTIVAZIONE": motivazione,
2611
+ "COD_POD_PDR": podPdr.code,
2612
+ },
2613
+ },
2614
+ }
2615
+
2616
+ url = env["ir.config_parameter"].sudo().get_param("b2w_wake_up_process_url")
2617
+ payload = json_dumps(ok_payload)
2618
+ response = request("POST", url, data=payload, headers=headers)
2619
+
2620
+ if response.status_code != 200:
2621
+ raise ValidationError("Failed to launch VT.0040")
2622
+
2623
+ result = "OK"
2624
+
2625
+ except Exception as e:
2626
+ prev = case_id.info_message + "\n" if case_id.info_message else ""
2627
+ case_id.write({"info_message": prev + str(e)})
2628
+
2629
+ log(json_dumps(logs))</field>
2630
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
2631
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
2632
+ <field name="is_a_postalizer_phase">False</field>
2633
+ <field name="is_compute_refund">False</field>
2634
+ <field name="is_dl">False</field>
2635
+ <field name="is_needs_child_case">False</field>
2636
+ <field name="is_pick_refund_template">False</field>
2637
+ <field name="is_process_managed">False</field>
2638
+ <field name="is_quote_accepted">False</field>
2639
+ <field name="is_quote_sent">False</field>
2640
+ <field name="is_timeout">False</field>
2641
+ <field name="is_voidable">False</field>
2642
+ <field name="name">A2142 - Invio alla marketcom annullamento forzato</field>
2643
+ <field name="set_result_automatically">from_code</field>
2644
+ </record>
2645
+ <record id="symple_triplet_phase_result_C2508_-_gestione_fuori_linea_E-CC01-0048" model="symple.triplet.phase.result">
2646
+ <field name="active">True</field>
2647
+ <field name="has_message">False</field>
2648
+ <field name="is_annulment">False</field>
2649
+ <field name="is_dl_solicitation_result">False</field>
2650
+ <field name="is_hidden">False</field>
2651
+ <field name="is_quote_expired">False</field>
2652
+ <field name="name">C2508 - gestione fuori linea</field>
2653
+ <field name="next_phase_id" ref="symple_triplet_phase_A2142_-_Invio_alla_marketcom_annullamento_forzato"/>
2654
+ <field name="state_code">E-CC01-0048</field>
2655
+ <field name="wizard_result">SUCCESS</field>
2656
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A2562_-_verifica_avvio_gestione_manuale_annullamento')])]"/>
2657
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
2658
+ </record>
2659
+ <record id="symple_triplet_phase_A2143_-_In_attesa_check_IFS_Annullamento_forzato" model="symple.triplet.phase">
2660
+ <field name="active">True</field>
2661
+ <field name="child_case">False</field>
2662
+ <field name="code"># Available variables:
2663
+ # - case_id: the case that just reached this phase
2664
+ # - request: allows you to make HTTP requests (method, url, headers, data)
2665
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
2666
+ # - json_load: allows you to use JSON.load to convert a json into an object
2667
+ # - env: Odoo Environment on which the action is triggered
2668
+ # - time, datetime, dateutil, timezone: useful Python libraries
2669
+ # - float_compare: Odoo function to compare floats based on specific precisions
2670
+ # - ValidationError: Warning Exception to use with raise
2671
+ # - Command: x2Many commands namespace
2672
+ # - OrderedDict: ordered dictionaries
2673
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
2674
+ # (line = case id, func = phase name)
2675
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
2676
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
2677
+ # To return a result, assign: result = {...}
2678
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
2679
+ # phase result will not be set.
2680
+
2681
+
2682
+
2683
+ </field>
2684
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
2685
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
2686
+ <field name="is_a_postalizer_phase">False</field>
2687
+ <field name="is_compute_refund">False</field>
2688
+ <field name="is_dl">False</field>
2689
+ <field name="is_needs_child_case">False</field>
2690
+ <field name="is_pick_refund_template">False</field>
2691
+ <field name="is_process_managed">False</field>
2692
+ <field name="is_quote_accepted">False</field>
2693
+ <field name="is_quote_sent">False</field>
2694
+ <field name="is_timeout">False</field>
2695
+ <field name="is_voidable">False</field>
2696
+ <field name="name">A2143 - In attesa check IFS Annullamento forzato</field>
2697
+ </record>
2698
+ <record id="symple_triplet_phase_result_C1019_-_Inviata_E-CC01-0053" model="symple.triplet.phase.result">
2699
+ <field name="active">True</field>
2700
+ <field name="has_message">False</field>
2701
+ <field name="is_annulment">False</field>
2702
+ <field name="is_dl_solicitation_result">False</field>
2703
+ <field name="is_hidden">False</field>
2704
+ <field name="is_quote_expired">False</field>
2705
+ <field name="name">C1019 - Inviata</field>
2706
+ <field name="next_phase_id" ref="symple_triplet_phase_A2143_-_In_attesa_check_IFS_Annullamento_forzato"/>
2707
+ <field name="state_code">E-CC01-0053</field>
2708
+ <field name="wizard_result">SUCCESS</field>
2709
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A2142_-_Invio_alla_marketcom_annullamento_forzato')])]"/>
2710
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
2711
+ </record>
2712
+ <record id="symple_triplet_phase_A1732_-_Gestione_scarti_da_cruscotto_annullamento" model="symple.triplet.phase">
2713
+ <field name="active">True</field>
2714
+ <field name="child_case">False</field>
2715
+ <field name="code"># Available variables:
2716
+ # - case_id: the case that just reached this phase
2717
+ # - request: allows you to make HTTP requests (method, url, headers, data)
2718
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
2719
+ # - json_load: allows you to use JSON.load to convert a json into an object
2720
+ # - env: Odoo Environment on which the action is triggered
2721
+ # - time, datetime, dateutil, timezone: useful Python libraries
2722
+ # - float_compare: Odoo function to compare floats based on specific precisions
2723
+ # - ValidationError: Warning Exception to use with raise
2724
+ # - Command: x2Many commands namespace
2725
+ # - OrderedDict: ordered dictionaries
2726
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
2727
+ # (line = case id, func = phase name)
2728
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
2729
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
2730
+ # To return a result, assign: result = {...}
2731
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
2732
+ # phase result will not be set.
2733
+
2734
+
2735
+
2736
+ </field>
2737
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
2738
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
2739
+ <field name="is_a_postalizer_phase">False</field>
2740
+ <field name="is_compute_refund">False</field>
2741
+ <field name="is_dl">False</field>
2742
+ <field name="is_needs_child_case">False</field>
2743
+ <field name="is_pick_refund_template">False</field>
2744
+ <field name="is_process_managed">False</field>
2745
+ <field name="is_quote_accepted">False</field>
2746
+ <field name="is_quote_sent">False</field>
2747
+ <field name="is_timeout">False</field>
2748
+ <field name="is_voidable">False</field>
2749
+ <field name="name">A1732 - Gestione scarti da cruscotto annullamento</field>
2750
+ </record>
2751
+ <record id="symple_triplet_phase_result_C2476_-_KO_-_Ammissibilit__Annullamento_Hub_E-CC01-0043" model="symple.triplet.phase.result">
2752
+ <field name="active">True</field>
2753
+ <field name="has_message">False</field>
2754
+ <field name="is_annulment">False</field>
2755
+ <field name="is_dl_solicitation_result">False</field>
2756
+ <field name="is_hidden">False</field>
2757
+ <field name="is_quote_expired">False</field>
2758
+ <field name="name">C2476 - KO - Ammissibilità Annullamento Hub</field>
2759
+ <field name="next_phase_id" ref="symple_triplet_phase_A1732_-_Gestione_scarti_da_cruscotto_annullamento"/>
2760
+ <field name="state_code">E-CC01-0043</field>
2761
+ <field name="wizard_result">KO-HUB-ANN</field>
2762
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1767_-_In_attesa_check_IFS_Annullamento')])]"/>
2763
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','KO-HUB-ANN')])" />
2764
+ </record>
2765
+ <record id="symple_triplet_phase_result_C2416_-_risottomessa_da_cruscotto_E-CC01-0056" model="symple.triplet.phase.result">
2766
+ <field name="active">True</field>
2767
+ <field name="has_message">False</field>
2768
+ <field name="is_annulment">False</field>
2769
+ <field name="is_dl_solicitation_result">False</field>
2770
+ <field name="is_hidden">False</field>
2771
+ <field name="is_quote_expired">False</field>
2772
+ <field name="name">C2416 - risottomessa da cruscotto</field>
2773
+ <field name="next_phase_id" ref="symple_triplet_phase_A1767_-_In_attesa_check_IFS_Annullamento"/>
2774
+ <field name="state_code">E-CC01-0056</field>
2775
+ <field name="wizard_result">RESUBMIT</field>
2776
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1732_-_Gestione_scarti_da_cruscotto_annullamento')])]"/>
2777
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Resubmit')])" />
2778
+ </record>
2779
+ <record id="symple_triplet_phase_result_C1931_-_Errore_non_rilavorabile_E-CC01-0057" model="symple.triplet.phase.result">
2780
+ <field name="active">True</field>
2781
+ <field name="has_message">False</field>
2782
+ <field name="is_annulment">False</field>
2783
+ <field name="is_dl_solicitation_result">False</field>
2784
+ <field name="is_hidden">False</field>
2785
+ <field name="is_quote_expired">False</field>
2786
+ <field name="name">C1931 - Errore non rilavorabile</field>
2787
+ <field name="next_phase_id" ref="symple_triplet_phase_A1004_-_Verifica_RCU___Data_decorrenza"/>
2788
+ <field name="state_code">E-CC01-0057</field>
2789
+ <field name="wizard_result">DEF-KO</field>
2790
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1732_-_Gestione_scarti_da_cruscotto_annullamento')])]"/>
2791
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','DEF-KO')])" />
2792
+ </record>
2793
+ <record id="symple_triplet_phase_result_C1448_-_OK_controlli_RCU_E-CC01-0059" model="symple.triplet.phase.result">
2794
+ <field name="active">True</field>
2795
+ <field name="has_message">False</field>
2796
+ <field name="is_annulment">False</field>
2797
+ <field name="is_dl_solicitation_result">False</field>
2798
+ <field name="is_hidden">False</field>
2799
+ <field name="is_quote_expired">False</field>
2800
+ <field name="name">C1448 - OK controlli RCU</field>
2801
+ <field name="next_phase_id" ref="symple_triplet_phase_A2397_-_OK_RCU___verifica_data_decorrenza"/>
2802
+ <field name="state_code">E-CC01-0059</field>
2803
+ <field name="wizard_result">SUCCESS</field>
2804
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1732_-_Gestione_scarti_da_cruscotto_annullamento')])]"/>
2805
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
2806
+ </record>
2807
+ <record id="symple_triplet_phase_A1832_-_gestione_scarti_da_cruscotto_annullamento_forzato" model="symple.triplet.phase">
2808
+ <field name="active">True</field>
2809
+ <field name="child_case">False</field>
2810
+ <field name="code"># Available variables:
2811
+ # - case_id: the case that just reached this phase
2812
+ # - request: allows you to make HTTP requests (method, url, headers, data)
2813
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
2814
+ # - json_load: allows you to use JSON.load to convert a json into an object
2815
+ # - env: Odoo Environment on which the action is triggered
2816
+ # - time, datetime, dateutil, timezone: useful Python libraries
2817
+ # - float_compare: Odoo function to compare floats based on specific precisions
2818
+ # - ValidationError: Warning Exception to use with raise
2819
+ # - Command: x2Many commands namespace
2820
+ # - OrderedDict: ordered dictionaries
2821
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
2822
+ # (line = case id, func = phase name)
2823
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
2824
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
2825
+ # To return a result, assign: result = {...}
2826
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
2827
+ # phase result will not be set.
2828
+
2829
+
2830
+
2831
+ </field>
2832
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
2833
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
2834
+ <field name="is_a_postalizer_phase">False</field>
2835
+ <field name="is_compute_refund">False</field>
2836
+ <field name="is_dl">False</field>
2837
+ <field name="is_needs_child_case">False</field>
2838
+ <field name="is_pick_refund_template">False</field>
2839
+ <field name="is_process_managed">False</field>
2840
+ <field name="is_quote_accepted">False</field>
2841
+ <field name="is_quote_sent">False</field>
2842
+ <field name="is_timeout">False</field>
2843
+ <field name="is_voidable">False</field>
2844
+ <field name="name">A1832 - gestione scarti da cruscotto annullamento forzato</field>
2845
+ </record>
2846
+ <record id="symple_triplet_phase_result_C2225_-_KO_-_Ammissibilit__Hub_E-CC01-0054" model="symple.triplet.phase.result">
2847
+ <field name="active">True</field>
2848
+ <field name="has_message">False</field>
2849
+ <field name="is_annulment">False</field>
2850
+ <field name="is_dl_solicitation_result">False</field>
2851
+ <field name="is_hidden">False</field>
2852
+ <field name="is_quote_expired">False</field>
2853
+ <field name="name">C2225 - KO - Ammissibilità Hub</field>
2854
+ <field name="next_phase_id" ref="symple_triplet_phase_A1832_-_gestione_scarti_da_cruscotto_annullamento_forzato"/>
2855
+ <field name="state_code">E-CC01-0054</field>
2856
+ <field name="wizard_result">KO-HUB-ANN</field>
2857
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A2143_-_In_attesa_check_IFS_Annullamento_forzato')])]"/>
2858
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','KO-HUB-ANN')])" />
2859
+ </record>
2860
+ <record id="symple_triplet_phase_result_C2416_-_risottomessa_da_cruscotto_E-CC01-0061" model="symple.triplet.phase.result">
2861
+ <field name="active">True</field>
2862
+ <field name="has_message">False</field>
2863
+ <field name="is_annulment">False</field>
2864
+ <field name="is_dl_solicitation_result">False</field>
2865
+ <field name="is_hidden">False</field>
2866
+ <field name="is_quote_expired">False</field>
2867
+ <field name="name">C2416 - risottomessa da cruscotto</field>
2868
+ <field name="next_phase_id" ref="symple_triplet_phase_A2143_-_In_attesa_check_IFS_Annullamento_forzato"/>
2869
+ <field name="state_code">E-CC01-0061</field>
2870
+ <field name="wizard_result">RESUBMIT</field>
2871
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1832_-_gestione_scarti_da_cruscotto_annullamento_forzato')])]"/>
2872
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Resubmit')])" />
2873
+ </record>
2874
+ <record id="symple_triplet_phase_result_C1931_-_Errore_non_rilavorabile_E-CC01-0062" model="symple.triplet.phase.result">
2875
+ <field name="active">True</field>
2876
+ <field name="has_message">False</field>
2877
+ <field name="is_annulment">False</field>
2878
+ <field name="is_dl_solicitation_result">False</field>
2879
+ <field name="is_hidden">False</field>
2880
+ <field name="is_quote_expired">False</field>
2881
+ <field name="name">C1931 - Errore non rilavorabile</field>
2882
+ <field name="next_phase_id" ref="symple_triplet_phase_A1004_-_Verifica_RCU___Data_decorrenza"/>
2883
+ <field name="state_code">E-CC01-0062</field>
2884
+ <field name="wizard_result">SUCCESS</field>
2885
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1832_-_gestione_scarti_da_cruscotto_annullamento_forzato')])]"/>
2886
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
2887
+ </record>
2888
+ <record id="symple_triplet_phase_result_C1448_-_OK_controlli_RCU_E-CC01-0064" model="symple.triplet.phase.result">
2889
+ <field name="active">True</field>
2890
+ <field name="has_message">False</field>
2891
+ <field name="is_annulment">False</field>
2892
+ <field name="is_dl_solicitation_result">False</field>
2893
+ <field name="is_hidden">False</field>
2894
+ <field name="is_quote_expired">False</field>
2895
+ <field name="name">C1448 - OK controlli RCU</field>
2896
+ <field name="next_phase_id" ref="symple_triplet_phase_A2397_-_OK_RCU___verifica_data_decorrenza"/>
2897
+ <field name="state_code">E-CC01-0064</field>
2898
+ <field name="wizard_result">SUCCESS</field>
2899
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1832_-_gestione_scarti_da_cruscotto_annullamento_forzato')])]"/>
2900
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
2901
+ </record>
2902
+ <record id="symple_triplet_phase_A0833_-_In_attesa_ricezione_Ammissibilit__Annullamento" model="symple.triplet.phase">
2903
+ <field name="active">True</field>
2904
+ <field name="child_case">False</field>
2905
+ <field name="code"># Available variables:
2906
+ # - case_id: the case that just reached this phase
2907
+ # - request: allows you to make HTTP requests (method, url, headers, data)
2908
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
2909
+ # - json_load: allows you to use JSON.load to convert a json into an object
2910
+ # - env: Odoo Environment on which the action is triggered
2911
+ # - time, datetime, dateutil, timezone: useful Python libraries
2912
+ # - float_compare: Odoo function to compare floats based on specific precisions
2913
+ # - ValidationError: Warning Exception to use with raise
2914
+ # - Command: x2Many commands namespace
2915
+ # - OrderedDict: ordered dictionaries
2916
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
2917
+ # (line = case id, func = phase name)
2918
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
2919
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
2920
+ # To return a result, assign: result = {...}
2921
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
2922
+ # phase result will not be set.
2923
+
2924
+
2925
+
2926
+ </field>
2927
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
2928
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
2929
+ <field name="is_a_postalizer_phase">False</field>
2930
+ <field name="is_compute_refund">False</field>
2931
+ <field name="is_dl">False</field>
2932
+ <field name="is_needs_child_case">False</field>
2933
+ <field name="is_pick_refund_template">False</field>
2934
+ <field name="is_process_managed">False</field>
2935
+ <field name="is_quote_accepted">False</field>
2936
+ <field name="is_quote_sent">False</field>
2937
+ <field name="is_timeout">False</field>
2938
+ <field name="is_voidable">False</field>
2939
+ <field name="name">A0833 - In attesa ricezione Ammissibilità Annullamento</field>
2940
+ </record>
2941
+ <record id="symple_triplet_phase_result_C2224_-_OK_-_Ammissibilit__Hub_E-CC01-0055" model="symple.triplet.phase.result">
2942
+ <field name="active">True</field>
2943
+ <field name="has_message">False</field>
2944
+ <field name="is_annulment">False</field>
2945
+ <field name="is_dl_solicitation_result">False</field>
2946
+ <field name="is_hidden">False</field>
2947
+ <field name="is_quote_expired">False</field>
2948
+ <field name="name">C2224 - OK - Ammissibilità Hub</field>
2949
+ <field name="next_phase_id" ref="symple_triplet_phase_A0833_-_In_attesa_ricezione_Ammissibilit__Annullamento"/>
2950
+ <field name="state_code">E-CC01-0055</field>
2951
+ <field name="wizard_result">OK-HUB-ANN</field>
2952
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A2143_-_In_attesa_check_IFS_Annullamento_forzato')])]"/>
2953
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','OK-HUB-ANN')])" />
2954
+ </record>
2955
+ <record id="symple_triplet_phase_result_C1038_-_Ammissibilit__KO_E-CC01-0066" model="symple.triplet.phase.result">
2956
+ <field name="active">True</field>
2957
+ <field name="has_message">False</field>
2958
+ <field name="is_annulment">False</field>
2959
+ <field name="is_dl_solicitation_result">False</field>
2960
+ <field name="is_hidden">False</field>
2961
+ <field name="is_quote_expired">False</field>
2962
+ <field name="name">C1038 - Ammissibilità KO</field>
2963
+ <field name="next_phase_id" ref="symple_triplet_phase_A1732_-_Gestione_scarti_da_cruscotto_annullamento"/>
2964
+ <field name="state_code">E-CC01-0066</field>
2965
+ <field name="wizard_result">KO-100-ANN</field>
2966
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A0833_-_In_attesa_ricezione_Ammissibilit__Annullamento')])]"/>
2967
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','KO-100-ANN')])" />
2968
+ </record>
2969
+ <record id="symple_triplet_phase_result_C1448_-_OK_controlli_RCU_E-CC01-0068" model="symple.triplet.phase.result">
2970
+ <field name="active">True</field>
2971
+ <field name="has_message">False</field>
2972
+ <field name="is_annulment">False</field>
2973
+ <field name="is_dl_solicitation_result">False</field>
2974
+ <field name="is_hidden">False</field>
2975
+ <field name="is_quote_expired">False</field>
2976
+ <field name="name">C1448 - OK controlli RCU</field>
2977
+ <field name="next_phase_id" ref="symple_triplet_phase_A2397_-_OK_RCU___verifica_data_decorrenza"/>
2978
+ <field name="state_code">E-CC01-0068</field>
2979
+ <field name="wizard_result">SUCCESS</field>
2980
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A0833_-_In_attesa_ricezione_Ammissibilit__Annullamento')])]"/>
2981
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
2982
+ </record>
2983
+ <record id="symple_triplet_phase_A0366_-_In_attesa_Esito_finale_annullamento" model="symple.triplet.phase">
2984
+ <field name="active">True</field>
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="is_a_postalizer_phase">False</field>
3010
+ <field name="is_compute_refund">False</field>
3011
+ <field name="is_dl">False</field>
3012
+ <field name="is_needs_child_case">False</field>
3013
+ <field name="is_pick_refund_template">False</field>
3014
+ <field name="is_process_managed">False</field>
3015
+ <field name="is_quote_accepted">False</field>
3016
+ <field name="is_quote_sent">False</field>
3017
+ <field name="is_timeout">False</field>
3018
+ <field name="is_voidable">False</field>
3019
+ <field name="name">A0366 - In attesa Esito finale annullamento</field>
3020
+ </record>
3021
+ <record id="symple_triplet_phase_result_C1037_-_Ammissibilit__OK_E-CC01-0065" model="symple.triplet.phase.result">
3022
+ <field name="active">True</field>
3023
+ <field name="has_message">False</field>
3024
+ <field name="is_annulment">False</field>
3025
+ <field name="is_dl_solicitation_result">False</field>
3026
+ <field name="is_hidden">False</field>
3027
+ <field name="is_quote_expired">False</field>
3028
+ <field name="name">C1037 - Ammissibilità OK</field>
3029
+ <field name="next_phase_id" ref="symple_triplet_phase_A0366_-_In_attesa_Esito_finale_annullamento"/>
3030
+ <field name="state_code">E-CC01-0065</field>
3031
+ <field name="wizard_result">OK-100-ANN</field>
3032
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A0833_-_In_attesa_ricezione_Ammissibilit__Annullamento')])]"/>
3033
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','OK-100-ANN')])" />
3034
+ </record>
3035
+ <record id="symple_triplet_phase_result_C1064_-_Esito_finale_Annullamento_KO_E-CC01-0071" model="symple.triplet.phase.result">
3036
+ <field name="active">True</field>
3037
+ <field name="has_message">False</field>
3038
+ <field name="is_annulment">False</field>
3039
+ <field name="is_dl_solicitation_result">False</field>
3040
+ <field name="is_hidden">False</field>
3041
+ <field name="is_quote_expired">False</field>
3042
+ <field name="name">C1064 - Esito finale Annullamento KO</field>
3043
+ <field name="next_phase_id" ref="symple_triplet_phase_A1004_-_Verifica_RCU___Data_decorrenza"/>
3044
+ <field name="state_code">E-CC01-0071</field>
3045
+ <field name="wizard_result">KO-150-ANN</field>
3046
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A0366_-_In_attesa_Esito_finale_annullamento')])]"/>
3047
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','KO-150-ANN')])" />
3048
+ </record>
3049
+ <record id="symple_triplet_phase_result_C1448_-_OK_controlli_RCU_E-CC01-0073" model="symple.triplet.phase.result">
3050
+ <field name="active">True</field>
3051
+ <field name="has_message">False</field>
3052
+ <field name="is_annulment">False</field>
3053
+ <field name="is_dl_solicitation_result">False</field>
3054
+ <field name="is_hidden">False</field>
3055
+ <field name="is_quote_expired">False</field>
3056
+ <field name="name">C1448 - OK controlli RCU</field>
3057
+ <field name="next_phase_id" ref="symple_triplet_phase_A2397_-_OK_RCU___verifica_data_decorrenza"/>
3058
+ <field name="state_code">E-CC01-0073</field>
3059
+ <field name="wizard_result">SUCCESS</field>
3060
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A0366_-_In_attesa_Esito_finale_annullamento')])]"/>
3061
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
3062
+ </record>
3063
+ <record id="symple_triplet_phase_A0809_-_Case_Annullato" model="symple.triplet.phase">
3064
+ <field name="active">True</field>
3065
+ <field name="child_case">False</field>
3066
+ <field name="code"># Available variables:
3067
+ # - case_id: the case that just reached this phase
3068
+ # - request: allows you to make HTTP requests (method, url, headers, data)
3069
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
3070
+ # - json_load: allows you to use JSON.load to convert a json into an object
3071
+ # - env: Odoo Environment on which the action is triggered
3072
+ # - time, datetime, dateutil, timezone: useful Python libraries
3073
+ # - float_compare: Odoo function to compare floats based on specific precisions
3074
+ # - ValidationError: Warning Exception to use with raise
3075
+ # - Command: x2Many commands namespace
3076
+ # - OrderedDict: ordered dictionaries
3077
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
3078
+ # (line = case id, func = phase name)
3079
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
3080
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
3081
+ # To return a result, assign: result = {...}
3082
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
3083
+ # phase result will not be set.
3084
+
3085
+ if case_id.matrix_process_id:
3086
+ case_id.close_matrix_process()
3087
+
3088
+ </field>
3089
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
3090
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','Cancelled')])" />
3091
+ <field name="is_a_postalizer_phase">False</field>
3092
+ <field name="is_compute_refund">False</field>
3093
+ <field name="is_dl">False</field>
3094
+ <field name="is_needs_child_case">False</field>
3095
+ <field name="is_pick_refund_template">False</field>
3096
+ <field name="is_process_managed">False</field>
3097
+ <field name="is_quote_accepted">False</field>
3098
+ <field name="is_quote_sent">False</field>
3099
+ <field name="is_timeout">False</field>
3100
+ <field name="is_voidable">False</field>
3101
+ <field name="name">A0809 - Case Annullato</field>
3102
+ <field name="set_result_automatically">from_code</field>
3103
+ </record>
3104
+ <record id="symple_triplet_phase_result_C1402_-_Annullamento_Risoluzione_contrattuale_E-CC01-0001" model="symple.triplet.phase.result">
3105
+ <field name="active">True</field>
3106
+ <field name="has_message">False</field>
3107
+ <field name="is_annulment">False</field>
3108
+ <field name="is_dl_solicitation_result">False</field>
3109
+ <field name="is_hidden">False</field>
3110
+ <field name="is_quote_expired">False</field>
3111
+ <field name="name">C1402 - Annullamento Risoluzione contrattuale</field>
3112
+ <field name="next_phase_id" ref="symple_triplet_phase_A0809_-_Case_Annullato"/>
3113
+ <field name="state_code">E-CC01-0001</field>
3114
+ <field name="wizard_result">CANCEL</field>
3115
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1001_-_Apertura_Wizard_Risoluzione_contrattuale')])]"/>
3116
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Cancel')])" />
3117
+ </record>
3118
+ <record id="symple_triplet_phase_result_C1449_-_KO_controlli_RCU___Data_decorrenza_E-CC01-0028" model="symple.triplet.phase.result">
3119
+ <field name="active">True</field>
3120
+ <field name="has_message">False</field>
3121
+ <field name="is_annulment">False</field>
3122
+ <field name="is_dl_solicitation_result">False</field>
3123
+ <field name="is_hidden">False</field>
3124
+ <field name="is_quote_expired">False</field>
3125
+ <field name="name">C1449 - KO controlli RCU + Data decorrenza</field>
3126
+ <field name="next_phase_id" ref="symple_triplet_phase_A0809_-_Case_Annullato"/>
3127
+ <field name="state_code">E-CC01-0028</field>
3128
+ <field name="wizard_result">KO</field>
3129
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1004_-_Verifica_RCU___Data_decorrenza')])]"/>
3130
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','KO')])" />
3131
+ </record>
3132
+ <record id="symple_triplet_phase_result_C1449_-_KO_controlli_RCU___Data_decorrenza_E-CC01-0045" model="symple.triplet.phase.result">
3133
+ <field name="active">True</field>
3134
+ <field name="has_message">False</field>
3135
+ <field name="is_annulment">False</field>
3136
+ <field name="is_dl_solicitation_result">False</field>
3137
+ <field name="is_hidden">False</field>
3138
+ <field name="is_quote_expired">False</field>
3139
+ <field name="name">C1449 - KO controlli RCU + Data decorrenza</field>
3140
+ <field name="next_phase_id" ref="symple_triplet_phase_A0809_-_Case_Annullato"/>
3141
+ <field name="state_code">E-CC01-0045</field>
3142
+ <field name="wizard_result">SUCCESS</field>
3143
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1767_-_In_attesa_check_IFS_Annullamento')])]"/>
3144
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
3145
+ </record>
3146
+ <record id="symple_triplet_phase_result_C1449_-_KO_controlli_RCU___Data_decorrenza_E-CC01-0050" model="symple.triplet.phase.result">
3147
+ <field name="active">True</field>
3148
+ <field name="has_message">False</field>
3149
+ <field name="is_annulment">False</field>
3150
+ <field name="is_dl_solicitation_result">False</field>
3151
+ <field name="is_hidden">False</field>
3152
+ <field name="is_quote_expired">False</field>
3153
+ <field name="name">C1449 - KO controlli RCU + Data decorrenza</field>
3154
+ <field name="next_phase_id" ref="symple_triplet_phase_A0809_-_Case_Annullato"/>
3155
+ <field name="state_code">E-CC01-0050</field>
3156
+ <field name="wizard_result">KO</field>
3157
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A2562_-_verifica_avvio_gestione_manuale_annullamento')])]"/>
3158
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','KO')])" />
3159
+ </record>
3160
+ <record id="symple_triplet_phase_result_C1449_-_KO_controlli_RCU___Data_decorrenza_E-CC01-0058" model="symple.triplet.phase.result">
3161
+ <field name="active">True</field>
3162
+ <field name="has_message">False</field>
3163
+ <field name="is_annulment">False</field>
3164
+ <field name="is_dl_solicitation_result">False</field>
3165
+ <field name="is_hidden">False</field>
3166
+ <field name="is_quote_expired">False</field>
3167
+ <field name="name">C1449 - KO controlli RCU + Data decorrenza</field>
3168
+ <field name="next_phase_id" ref="symple_triplet_phase_A0809_-_Case_Annullato"/>
3169
+ <field name="state_code">E-CC01-0058</field>
3170
+ <field name="wizard_result">SUCCESS</field>
3171
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1732_-_Gestione_scarti_da_cruscotto_annullamento')])]"/>
3172
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
3173
+ </record>
3174
+ <record id="symple_triplet_phase_result_C1449_-_KO_controlli_RCU___Data_decorrenza_E-CC01-0063" model="symple.triplet.phase.result">
3175
+ <field name="active">True</field>
3176
+ <field name="has_message">False</field>
3177
+ <field name="is_annulment">False</field>
3178
+ <field name="is_dl_solicitation_result">False</field>
3179
+ <field name="is_hidden">False</field>
3180
+ <field name="is_quote_expired">False</field>
3181
+ <field name="name">C1449 - KO controlli RCU + Data decorrenza</field>
3182
+ <field name="next_phase_id" ref="symple_triplet_phase_A0809_-_Case_Annullato"/>
3183
+ <field name="state_code">E-CC01-0063</field>
3184
+ <field name="wizard_result">SUCCESS</field>
3185
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1832_-_gestione_scarti_da_cruscotto_annullamento_forzato')])]"/>
3186
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
3187
+ </record>
3188
+ <record id="symple_triplet_phase_result_C1449_-_KO_controlli_RCU___Data_decorrenza_E-CC01-0067" model="symple.triplet.phase.result">
3189
+ <field name="active">True</field>
3190
+ <field name="has_message">False</field>
3191
+ <field name="is_annulment">False</field>
3192
+ <field name="is_dl_solicitation_result">False</field>
3193
+ <field name="is_hidden">False</field>
3194
+ <field name="is_quote_expired">False</field>
3195
+ <field name="name">C1449 - KO controlli RCU + Data decorrenza</field>
3196
+ <field name="next_phase_id" ref="symple_triplet_phase_A0809_-_Case_Annullato"/>
3197
+ <field name="state_code">E-CC01-0067</field>
3198
+ <field name="wizard_result">SUCCESS</field>
3199
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A0833_-_In_attesa_ricezione_Ammissibilit__Annullamento')])]"/>
3200
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
3201
+ </record>
3202
+ <record id="symple_triplet_phase_result_C1449_-_KO_controlli_RCU___Data_decorrenza_E-CC01-0072" model="symple.triplet.phase.result">
3203
+ <field name="active">True</field>
3204
+ <field name="has_message">False</field>
3205
+ <field name="is_annulment">False</field>
3206
+ <field name="is_dl_solicitation_result">False</field>
3207
+ <field name="is_hidden">False</field>
3208
+ <field name="is_quote_expired">False</field>
3209
+ <field name="name">C1449 - KO controlli RCU + Data decorrenza</field>
3210
+ <field name="next_phase_id" ref="symple_triplet_phase_A0809_-_Case_Annullato"/>
3211
+ <field name="state_code">E-CC01-0072</field>
3212
+ <field name="wizard_result">SUCCESS</field>
3213
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A0366_-_In_attesa_Esito_finale_annullamento')])]"/>
3214
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
3215
+ </record>
3216
+ <record id="symple_triplet_phase_A0810_-_Case_Lavorato" model="symple.triplet.phase">
3217
+ <field name="active">True</field>
3218
+ <field name="child_case">False</field>
3219
+ <field name="code">if case_id.matrix_process_id:
3220
+ case_id.close_matrix_process()</field>
3221
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
3222
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','Done')])" />
3223
+ <field name="is_a_postalizer_phase">False</field>
3224
+ <field name="is_compute_refund">False</field>
3225
+ <field name="is_dl">False</field>
3226
+ <field name="is_needs_child_case">False</field>
3227
+ <field name="is_pick_refund_template">False</field>
3228
+ <field name="is_process_managed">False</field>
3229
+ <field name="is_quote_accepted">False</field>
3230
+ <field name="is_quote_sent">False</field>
3231
+ <field name="is_timeout">False</field>
3232
+ <field name="is_voidable">False</field>
3233
+ <field name="name">A0810 - Case Lavorato</field>
3234
+ <field name="set_result_automatically">from_code</field>
3235
+ </record>
3236
+ <record id="symple_triplet_phase_result_C1006_-_OK_Integrazione_M2C_E-CC01-0037" model="symple.triplet.phase.result">
3237
+ <field name="active">True</field>
3238
+ <field name="has_message">False</field>
3239
+ <field name="is_annulment">False</field>
3240
+ <field name="is_dl_solicitation_result">False</field>
3241
+ <field name="is_hidden">False</field>
3242
+ <field name="is_quote_expired">False</field>
3243
+ <field name="name">C1006 - OK Integrazione M2C</field>
3244
+ <field name="next_phase_id" ref="symple_triplet_phase_A0810_-_Case_Lavorato"/>
3245
+ <field name="state_code">E-CC01-0037</field>
3246
+ <field name="wizard_result">SUCCESS</field>
3247
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A0803_-_In_attesa_esito_M2C')])]"/>
3248
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
3249
+ </record>
3250
+ <record id="symple_triplet_phase_result_C2551_-_OK_Intregrazione_M2C_-_Fatture_di_Storno_da_emettere_E-CC01-0038" model="symple.triplet.phase.result">
3251
+ <field name="active">True</field>
3252
+ <field name="has_message">False</field>
3253
+ <field name="is_annulment">False</field>
3254
+ <field name="is_dl_solicitation_result">False</field>
3255
+ <field name="is_hidden">False</field>
3256
+ <field name="is_quote_expired">False</field>
3257
+ <field name="name">C2551 - OK Intregrazione M2C - Fatture di Storno da emettere</field>
3258
+ <field name="next_phase_id" ref="symple_triplet_phase_A0810_-_Case_Lavorato"/>
3259
+ <field name="state_code">E-CC01-0038</field>
3260
+ <field name="wizard_result">SUCCESS</field>
3261
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A0803_-_In_attesa_esito_M2C')])]"/>
3262
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
3263
+ </record>
3264
+ <record id="symple_triplet_phase_result_C2550_-_case_creato_E-CC01-0040" model="symple.triplet.phase.result">
3265
+ <field name="active">True</field>
3266
+ <field name="has_message">False</field>
3267
+ <field name="is_annulment">False</field>
3268
+ <field name="is_dl_solicitation_result">False</field>
3269
+ <field name="is_hidden">False</field>
3270
+ <field name="is_quote_expired">False</field>
3271
+ <field name="name">C2550 - case creato</field>
3272
+ <field name="next_phase_id" ref="symple_triplet_phase_A0810_-_Case_Lavorato"/>
3273
+ <field name="state_code">E-CC01-0040</field>
3274
+ <field name="wizard_result">SUCCESS</field>
3275
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1836_-_Apertura_case_figlio')])]"/>
3276
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
3277
+ </record>
3278
+ <record id="symple_triplet_phase_A1833_-_Case_annullato_da_APR" model="symple.triplet.phase">
3279
+ <field name="active">True</field>
3280
+ <field name="child_case">False</field>
3281
+ <field name="code"># Available variables:
3282
+ # - case_id: the case that just reached this phase
3283
+ # - request: allows you to make HTTP requests (method, url, headers, data)
3284
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
3285
+ # - json_load: allows you to use JSON.load to convert a json into an object
3286
+ # - env: Odoo Environment on which the action is triggered
3287
+ # - time, datetime, dateutil, timezone: useful Python libraries
3288
+ # - float_compare: Odoo function to compare floats based on specific precisions
3289
+ # - ValidationError: Warning Exception to use with raise
3290
+ # - Command: x2Many commands namespace
3291
+ # - OrderedDict: ordered dictionaries
3292
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
3293
+ # (line = case id, func = phase name)
3294
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
3295
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
3296
+ # To return a result, assign: result = {...}
3297
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
3298
+ # phase result will not be set.
3299
+
3300
+
3301
+
3302
+ </field>
3303
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
3304
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','Cancelled')])" />
3305
+ <field name="is_a_postalizer_phase">False</field>
3306
+ <field name="is_compute_refund">False</field>
3307
+ <field name="is_dl">False</field>
3308
+ <field name="is_needs_child_case">False</field>
3309
+ <field name="is_pick_refund_template">False</field>
3310
+ <field name="is_process_managed">False</field>
3311
+ <field name="is_quote_accepted">False</field>
3312
+ <field name="is_quote_sent">False</field>
3313
+ <field name="is_timeout">False</field>
3314
+ <field name="is_voidable">False</field>
3315
+ <field name="name">A1833 - Case annullato da APR</field>
3316
+ </record>
3317
+ <record id="symple_triplet_phase_result_C1063_-_Esito_finale_Annullamento_OK_E-CC01-0070" model="symple.triplet.phase.result">
3318
+ <field name="active">True</field>
3319
+ <field name="has_message">False</field>
3320
+ <field name="is_annulment">False</field>
3321
+ <field name="is_dl_solicitation_result">False</field>
3322
+ <field name="is_hidden">False</field>
3323
+ <field name="is_quote_expired">False</field>
3324
+ <field name="name">C1063 - Esito finale Annullamento OK</field>
3325
+ <field name="next_phase_id" ref="symple_triplet_phase_A1833_-_Case_annullato_da_APR"/>
3326
+ <field name="state_code">E-CC01-0070</field>
3327
+ <field name="wizard_result">OK-150-ANN</field>
3328
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A0366_-_In_attesa_Esito_finale_annullamento')])]"/>
3329
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','OK-150-ANN')])" />
3330
+ </record>
3331
+ <record id="symple_triplet_phase_result_C2599_-_annullamento_confermato_E-CC01-00082" model="symple.triplet.phase.result">
3332
+ <field name="active">True</field>
3333
+ <field name="has_message">False</field>
3334
+ <field name="is_annulment">False</field>
3335
+ <field name="is_dl_solicitation_result">False</field>
3336
+ <field name="is_hidden">False</field>
3337
+ <field name="is_quote_expired">False</field>
3338
+ <field name="name">C2599 - annullamento confermato</field>
3339
+ <field name="next_phase_id" ref="symple_triplet_phase_A1833_-_Case_annullato_da_APR"/>
3340
+ <field name="state_code">E-CC01-00082</field>
3341
+ <field name="wizard_result">SUCCESS</field>
3342
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1767_-_In_attesa_check_IFS_Annullamento')])]"/>
3343
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
3344
+ </record>
3345
+ <record id="symple_triplet_phase_A1835_-_Case_annullato_da_APN" model="symple.triplet.phase">
3346
+ <field name="active">True</field>
3347
+ <field name="child_case">False</field>
3348
+ <field name="code"># Available variables:
3349
+ # - case_id: the case that just reached this phase
3350
+ # - request: allows you to make HTTP requests (method, url, headers, data)
3351
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
3352
+ # - json_load: allows you to use JSON.load to convert a json into an object
3353
+ # - env: Odoo Environment on which the action is triggered
3354
+ # - time, datetime, dateutil, timezone: useful Python libraries
3355
+ # - float_compare: Odoo function to compare floats based on specific precisions
3356
+ # - ValidationError: Warning Exception to use with raise
3357
+ # - Command: x2Many commands namespace
3358
+ # - OrderedDict: ordered dictionaries
3359
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
3360
+ # (line = case id, func = phase name)
3361
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
3362
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
3363
+ # To return a result, assign: result = {...}
3364
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
3365
+ # phase result will not be set.
3366
+
3367
+
3368
+
3369
+ </field>
3370
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
3371
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','Cancelled')])" />
3372
+ <field name="is_a_postalizer_phase">False</field>
3373
+ <field name="is_compute_refund">False</field>
3374
+ <field name="is_dl">False</field>
3375
+ <field name="is_needs_child_case">False</field>
3376
+ <field name="is_pick_refund_template">False</field>
3377
+ <field name="is_process_managed">False</field>
3378
+ <field name="is_quote_accepted">False</field>
3379
+ <field name="is_quote_sent">False</field>
3380
+ <field name="is_timeout">False</field>
3381
+ <field name="is_voidable">False</field>
3382
+ <field name="name">A1835 - Case annullato da APN</field>
3383
+ </record>
3384
+ <record id="symple_triplet_phase_result_C1763_-_Annullamento_passivo_dal_SII_E-CC01-0017" model="symple.triplet.phase.result">
3385
+ <field name="active">True</field>
3386
+ <field name="has_message">False</field>
3387
+ <field name="is_annulment">False</field>
3388
+ <field name="is_dl_solicitation_result">False</field>
3389
+ <field name="is_hidden">False</field>
3390
+ <field name="is_quote_expired">False</field>
3391
+ <field name="name">C1763 - Annullamento passivo dal SII</field>
3392
+ <field name="next_phase_id" ref="symple_triplet_phase_A1835_-_Case_annullato_da_APN"/>
3393
+ <field name="state_code">E-CC01-0017</field>
3394
+ <field name="wizard_result">CANCEL-APN</field>
3395
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1717_-_Gestione_scarti_da_cruscotto')])]"/>
3396
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','CANCEL-APN')])" />
3397
+ </record>
3398
+ <record id="symple_triplet_phase_result_C1763_-_Annullamento_passivo_dal_SII_E-CC01-0030" model="symple.triplet.phase.result">
3399
+ <field name="active">True</field>
3400
+ <field name="has_message">False</field>
3401
+ <field name="is_annulment">False</field>
3402
+ <field name="is_dl_solicitation_result">False</field>
3403
+ <field name="is_hidden">False</field>
3404
+ <field name="is_quote_expired">False</field>
3405
+ <field name="name">C1763 - Annullamento passivo dal SII</field>
3406
+ <field name="next_phase_id" ref="symple_triplet_phase_A1835_-_Case_annullato_da_APN"/>
3407
+ <field name="state_code">E-CC01-0030</field>
3408
+ <field name="wizard_result">CANCEL-APN</field>
3409
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1004_-_Verifica_RCU___Data_decorrenza')])]"/>
3410
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','CANCEL-APN')])" />
3411
+ </record>
3412
+ <record id="symple_triplet_phase_result_C1763_-_Annullamento_passivo_dal_SII_E-CC01-0047" model="symple.triplet.phase.result">
3413
+ <field name="active">True</field>
3414
+ <field name="has_message">False</field>
3415
+ <field name="is_annulment">False</field>
3416
+ <field name="is_dl_solicitation_result">False</field>
3417
+ <field name="is_hidden">False</field>
3418
+ <field name="is_quote_expired">False</field>
3419
+ <field name="name">C1763 - Annullamento passivo dal SII</field>
3420
+ <field name="next_phase_id" ref="symple_triplet_phase_A1835_-_Case_annullato_da_APN"/>
3421
+ <field name="state_code">E-CC01-0047</field>
3422
+ <field name="wizard_result">CANCEL-APN</field>
3423
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1767_-_In_attesa_check_IFS_Annullamento')])]"/>
3424
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','CANCEL-APN')])" />
3425
+ </record>
3426
+ <record id="symple_triplet_phase_result_C1763_-_Annullamento_passivo_dal_SII_E-CC01-0052" model="symple.triplet.phase.result">
3427
+ <field name="active">True</field>
3428
+ <field name="has_message">False</field>
3429
+ <field name="is_annulment">False</field>
3430
+ <field name="is_dl_solicitation_result">False</field>
3431
+ <field name="is_hidden">False</field>
3432
+ <field name="is_quote_expired">False</field>
3433
+ <field name="name">C1763 - Annullamento passivo dal SII</field>
3434
+ <field name="next_phase_id" ref="symple_triplet_phase_A1835_-_Case_annullato_da_APN"/>
3435
+ <field name="state_code">E-CC01-0052</field>
3436
+ <field name="wizard_result">CANCEL</field>
3437
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A2562_-_verifica_avvio_gestione_manuale_annullamento')])]"/>
3438
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Cancel')])" />
3439
+ </record>
3440
+ <record id="symple_triplet_phase_result_C1763_-_Annullamento_passivo_dal_SII_E-CC01-0060" model="symple.triplet.phase.result">
3441
+ <field name="active">True</field>
3442
+ <field name="has_message">False</field>
3443
+ <field name="is_annulment">False</field>
3444
+ <field name="is_dl_solicitation_result">False</field>
3445
+ <field name="is_hidden">False</field>
3446
+ <field name="is_quote_expired">False</field>
3447
+ <field name="name">C1763 - Annullamento passivo dal SII</field>
3448
+ <field name="next_phase_id" ref="symple_triplet_phase_A1835_-_Case_annullato_da_APN"/>
3449
+ <field name="state_code">E-CC01-0060</field>
3450
+ <field name="wizard_result">CANCEL-APN</field>
3451
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1732_-_Gestione_scarti_da_cruscotto_annullamento')])]"/>
3452
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','CANCEL-APN')])" />
3453
+ </record>
3454
+ <record id="symple_triplet_phase_result_C1763_-_Annullamento_passivo_dal_SII_E-CC01-0069" model="symple.triplet.phase.result">
3455
+ <field name="active">True</field>
3456
+ <field name="has_message">False</field>
3457
+ <field name="is_annulment">False</field>
3458
+ <field name="is_dl_solicitation_result">False</field>
3459
+ <field name="is_hidden">False</field>
3460
+ <field name="is_quote_expired">False</field>
3461
+ <field name="name">C1763 - Annullamento passivo dal SII</field>
3462
+ <field name="next_phase_id" ref="symple_triplet_phase_A1835_-_Case_annullato_da_APN"/>
3463
+ <field name="state_code">E-CC01-0069</field>
3464
+ <field name="wizard_result">CANCEL-APN</field>
3465
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A0833_-_In_attesa_ricezione_Ammissibilit__Annullamento')])]"/>
3466
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','CANCEL-APN')])" />
3467
+ </record>
3468
+ <record id="symple_triplet_phase_result_C1763_-_Annullamento_passivo_dal_SII_E-CC01-0074" model="symple.triplet.phase.result">
3469
+ <field name="active">True</field>
3470
+ <field name="has_message">False</field>
3471
+ <field name="is_annulment">False</field>
3472
+ <field name="is_dl_solicitation_result">False</field>
3473
+ <field name="is_hidden">False</field>
3474
+ <field name="is_quote_expired">False</field>
3475
+ <field name="name">C1763 - Annullamento passivo dal SII</field>
3476
+ <field name="next_phase_id" ref="symple_triplet_phase_A1835_-_Case_annullato_da_APN"/>
3477
+ <field name="state_code">E-CC01-0074</field>
3478
+ <field name="wizard_result">CANCEL-APN</field>
3479
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A0366_-_In_attesa_Esito_finale_annullamento')])]"/>
3480
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','CANCEL-APN')])" />
3481
+ </record>
3482
+ <record id="symple_triplet_phase_A0811_-_Lavorato_KO" model="symple.triplet.phase">
3483
+ <field name="active">True</field>
3484
+ <field name="child_case">False</field>
3485
+ <field name="code">if case_id.matrix_process_id:
3486
+ case_id.close_matrix_process(status="ERROR")</field>
3487
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
3488
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','Done KO')])" />
3489
+ <field name="is_a_postalizer_phase">False</field>
3490
+ <field name="is_compute_refund">False</field>
3491
+ <field name="is_dl">False</field>
3492
+ <field name="is_needs_child_case">False</field>
3493
+ <field name="is_pick_refund_template">False</field>
3494
+ <field name="is_process_managed">False</field>
3495
+ <field name="is_quote_accepted">False</field>
3496
+ <field name="is_quote_sent">False</field>
3497
+ <field name="is_timeout">False</field>
3498
+ <field name="is_voidable">False</field>
3499
+ <field name="name">A0811 - Lavorato KO</field>
3500
+ <field name="set_result_automatically">from_code</field>
3501
+ </record>
3502
+ <record id="symple_triplet_phase_result_C2409_-_KO_Confermato_E-CC01-0006" model="symple.triplet.phase.result">
3503
+ <field name="active">True</field>
3504
+ <field name="has_message">False</field>
3505
+ <field name="is_annulment">False</field>
3506
+ <field name="is_dl_solicitation_result">False</field>
3507
+ <field name="is_hidden">False</field>
3508
+ <field name="is_quote_expired">False</field>
3509
+ <field name="name">C2409 - KO Confermato</field>
3510
+ <field name="next_phase_id" ref="symple_triplet_phase_A0811_-_Lavorato_KO"/>
3511
+ <field name="state_code">E-CC01-0006</field>
3512
+ <field name="wizard_result">KO</field>
3513
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1710_-_Verifica_compatibilit__KO')])]"/>
3514
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','KO')])" />
3515
+ </record>
3516
+ <record id="symple_triplet_phase_result_C1931_-_Errore_non_rilavorabile_E-CC01-0016" model="symple.triplet.phase.result">
3517
+ <field name="active">True</field>
3518
+ <field name="has_message">False</field>
3519
+ <field name="is_annulment">False</field>
3520
+ <field name="is_dl_solicitation_result">False</field>
3521
+ <field name="is_hidden">False</field>
3522
+ <field name="is_quote_expired">False</field>
3523
+ <field name="name">C1931 - Errore non rilavorabile</field>
3524
+ <field name="next_phase_id" ref="symple_triplet_phase_A0811_-_Lavorato_KO"/>
3525
+ <field name="state_code">E-CC01-0016</field>
3526
+ <field name="wizard_result">DEF-KO</field>
3527
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1717_-_Gestione_scarti_da_cruscotto')])]"/>
3528
+ </record>
3529
+ <record id="symple_triplet_phase_result_C1931_-_Errore_non_rilavorabile_E-CC01-0024" model="symple.triplet.phase.result">
3530
+ <field name="active">True</field>
3531
+ <field name="has_message">False</field>
3532
+ <field name="is_annulment">False</field>
3533
+ <field name="is_dl_solicitation_result">False</field>
3534
+ <field name="is_hidden">False</field>
3535
+ <field name="is_quote_expired">False</field>
3536
+ <field name="name">C1931 - Errore non rilavorabile</field>
3537
+ <field name="next_phase_id" ref="symple_triplet_phase_A0811_-_Lavorato_KO"/>
3538
+ <field name="state_code">E-CC01-0024</field>
3539
+ <field name="wizard_result">DEF-KO</field>
3540
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1834_-_Gestione_scarti_da_cruscotto_forzato')])]"/>
3541
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','DEF-KO')])" />
3542
+ </record>
3543
+ <record id="symple_triplet_phase_A1590_-_Verifica_Tipologia_Apertura_Case" model="symple.triplet.phase">
3544
+ <field name="active">True</field>
3545
+ <field name="child_case">False</field>
3546
+ <field name="code"># Available variables:
3547
+ # - case_id: the case that just reached this phase
3548
+ # - request: allows you to make HTTP requests (method, url, headers, data)
3549
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
3550
+ # - json_load: allows you to use JSON.load to convert a json into an object
3551
+ # - env: Odoo Environment on which the action is triggered
3552
+ # - time, datetime, dateutil, timezone: useful Python libraries
3553
+ # - float_compare: Odoo function to compare floats based on specific precisions
3554
+ # - ValidationError: Warning Exception to use with raise
3555
+ # - Command: x2Many commands namespace
3556
+ # - OrderedDict: ordered dictionaries
3557
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
3558
+ # (line = case id, func = phase name)
3559
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
3560
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
3561
+ # To return a result, assign: result = {...}
3562
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
3563
+ # phase result will not be set.
3564
+ try:
3565
+ is_automatic = case_id.is_automatic_case
3566
+ if is_automatic:
3567
+ result = "AUTOMATICO"
3568
+ else:
3569
+ result = "MANUALE"
3570
+ except Exception as e :
3571
+ case_id.write({
3572
+ 'info_message':(case_id.info_message + "\n" + str(e)) if case_id.info_message else str(e)
3573
+ })
3574
+
3575
+
3576
+ </field>
3577
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
3578
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','New')])" />
3579
+ <field name="is_a_postalizer_phase">False</field>
3580
+ <field name="is_compute_refund">False</field>
3581
+ <field name="is_dl">False</field>
3582
+ <field name="is_needs_child_case">False</field>
3583
+ <field name="is_pick_refund_template">False</field>
3584
+ <field name="is_process_managed">False</field>
3585
+ <field name="is_quote_accepted">False</field>
3586
+ <field name="is_quote_sent">False</field>
3587
+ <field name="is_timeout">False</field>
3588
+ <field name="is_voidable">False</field>
3589
+ <field name="name">A1590 - Verifica Tipologia Apertura Case</field>
3590
+ <field name="set_result_automatically">from_code</field>
3591
+ </record>
3592
+ <record id="symple_triplet_phase_result_C2251_-_Apertura_Case_Manuale_E-CC01-0001-01" model="symple.triplet.phase.result">
3593
+ <field name="active">True</field>
3594
+ <field name="has_message">False</field>
3595
+ <field name="is_annulment">False</field>
3596
+ <field name="is_dl_solicitation_result">False</field>
3597
+ <field name="is_hidden">False</field>
3598
+ <field name="is_quote_expired">False</field>
3599
+ <field name="name">C2251 - Apertura Case Manuale</field>
3600
+ <field name="next_phase_id" ref="symple_triplet_phase_A1001_-_Apertura_Wizard_Risoluzione_contrattuale"/>
3601
+ <field name="state_code">E-CC01-0001-01</field>
3602
+ <field name="wizard_result">SUCCESS</field>
3603
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1590_-_Verifica_Tipologia_Apertura_Case')])]"/>
3604
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
3605
+ </record>
3606
+ <record id="symple_workflow_ML_-_RISOLUZIONE_CONTRATTUALE" model="symple.workflow">
3607
+ <field name="active">True</field>
3608
+ <field name="code"># Available variables:
3609
+ # - case_id: the case that just reached this phase
3610
+ # - request: allows you to make HTTP requests (method, url, headers, data)
3611
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
3612
+ # - json_load: allows you to use JSON.load to convert a json into an object
3613
+ # - env: Odoo Environment on which the action is triggered
3614
+ # - time, datetime, dateutil, timezone: useful Python libraries
3615
+ # - float_compare: Odoo function to compare floats based on specific precisions
3616
+ # - ValidationError: Warning Exception to use with raise
3617
+ # - Command: x2Many commands namespace
3618
+ # - OrderedDict: ordered dictionaries
3619
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
3620
+ # (line = case id, func = phase name)
3621
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
3622
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
3623
+ # To return a result, assign: result = {...}
3624
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
3625
+ # phase result will not be set.
3626
+
3627
+
3628
+
3629
+ </field>
3630
+ <field name="execute_code_every_phase">False</field>
3631
+ <field name="is_tiqv">False</field>
3632
+ <field name="name">ML - RISOLUZIONE CONTRATTUALE</field>
3633
+ <field name="triplet_phase_id" ref="symple_triplet_phase_A1590_-_Verifica_Tipologia_Apertura_Case"/>
3634
+ <field name="bpmn_diagram"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
3635
+ <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"
3636
+ xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
3637
+ xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
3638
+ xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
3639
+ xmlns:bioc="http://bpmn.io/schema/bpmn/biocolor/1.0"
3640
+ xmlns:color="http://www.omg.org/spec/BPMN/non-normative/color/1.0">
3641
+ <bpmn:process id="process_458" name="ML - RISOLUZIONE CONTRATTUALE" isExecutable="false"><bpmn:startEvent id="start"/><bpmn:scriptTask id="phase18083" name="A1590 - Verifica Tipologia Apertura Case"/><bpmn:userTask id="phase17995" name="A1001 - Apertura Wizard Risoluzione contrattuale"/><bpmn:scriptTask id="phase18025" name="A0809 - Case Annullato"/><bpmn:scriptTask id="phase17996" name="A1709 - verifica compatibilità"/><bpmn:userTask id="phase17997" name="A1710 - Verifica compatibilità KO"/><bpmn:scriptTask id="phase18029" name="A0811 - Lavorato KO"/><bpmn:scriptTask id="phase17998" name="A1672 - Recupero dati a CRM"/><bpmn:scriptTask id="phase18000" name="A1559 - Invio alla Market Communication"/><bpmn:serviceTask id="phase18001" name="A1715 - In attesa check IFS"/><bpmn:serviceTask id="phase18002" name="A1717 - Gestione scarti da cruscotto"/><bpmn:serviceTask id="phase18028" name="A1835 - Case annullato da APN"/><bpmn:serviceTask id="phase20854" name="A2338 - Inserimento Pratica"/><bpmn:userTask id="phase18003" name="A2558 - verifica avvio gestione manuale"/><bpmn:serviceTask id="phase18004" name="A1879 - Invio alla Market Comm Forzato"/><bpmn:serviceTask id="phase18005" name="A1806 - In Attesa Check HUB Forzato"/><bpmn:serviceTask id="phase18006" name="A1834 - Gestione scarti da cruscotto forzato"/><bpmn:serviceTask id="phase18007" name="A0816 - In attesa esito ammissibilità"/><bpmn:scriptTask id="phase18099" name="A1556 - Verica commodity"/><bpmn:userTask id="phase18008" name="A1004 - Verifica RCU + Data decorrenza"/><bpmn:scriptTask id="phase18009" name="A2397 - OK RCU + verifica data decorrenza"/><bpmn:scriptTask id="phase18010" name="A1577 - Chiusura Ordine CRM"/><bpmn:scriptTask id="phase18012" name="A2398 - Invio ordine CRM"/><bpmn:scriptTask id="phase18013" name="A0802 - Integrazione M2C"/><bpmn:serviceTask id="phase18014" name="A0803 - In attesa esito M2C"/><bpmn:scriptTask id="phase18026" name="A0810 - Case Lavorato"/><bpmn:scriptTask id="phase18015" name="A1836 - Apertura case figlio"/><bpmn:userTask id="phase18011" name="A1321 - Errore CRM (RC1)"/><bpmn:scriptTask id="phase18016" name="A1595 - Invio Annullamento alla Market Communication"/><bpmn:serviceTask id="phase18017" name="A1767 - In attesa check IFS Annullamento"/><bpmn:serviceTask id="phase20855" name="A2561 - verifica stato invio pratica da annullare"/><bpmn:serviceTask id="phase20856" name="A0832 - Invio Richiesta Annullamento"/><bpmn:userTask id="phase18018" name="A2562 - verifica avvio gestione manuale annullamento"/><bpmn:scriptTask id="phase18019" name="A2142 - Invio alla marketcom annullamento forzato"/><bpmn:serviceTask id="phase18020" name="A2143 - In attesa check IFS Annullamento forzato"/><bpmn:serviceTask id="phase18022" name="A1832 - gestione scarti da cruscotto annullamento forzato"/><bpmn:serviceTask id="phase18023" name="A0833 - In attesa ricezione Ammissibilità Annullamento"/><bpmn:serviceTask id="phase18024" name="A0366 - In attesa Esito finale annullamento"/><bpmn:serviceTask id="phase18027" name="A1833 - Case annullato da APR"/><bpmn:serviceTask id="phase18021" name="A1732 - Gestione scarti da cruscotto annullamento"/><bpmn:sendTask id="phase18100" name="A2598 - Invio Pec"/><bpmn:userTask id="phase17999" name="A1323 - Errore CRM (Recupero dati)"/><bpmn:scriptTask id="phase18098" name="A1001 – Creazione Case di Risoluzione Contrattuale Automatica"/><bpmn:sequenceFlow id="flowStart" sourceRef="start" targetRef="phase18083"/><bpmn:sequenceFlow id="flow18083" sourceRef="phase18083" targetRef="gateway18083"/><bpmn:sequenceFlow id="flow31428" name="C2251 - Apertura Case Manuale" sourceRef="gateway18083" targetRef="phase17995"/><bpmn:sequenceFlow id="flow17995" sourceRef="phase17995" targetRef="gateway17995"/><bpmn:sequenceFlow id="flow31312" name="C1402 - Annullamento Risoluzione contrattuale" sourceRef="gateway17995" targetRef="phase18025"/><bpmn:sequenceFlow id="flowEnd18025" sourceRef="phase18025" targetRef="end18025"/><bpmn:sequenceFlow id="flow31313" name="C1401 - Risoluzione contrattuale OK" sourceRef="gateway17995" targetRef="phase17996"/><bpmn:sequenceFlow id="flow17996" sourceRef="phase17996" targetRef="gateway17996"/><bpmn:sequenceFlow id="flow31314" name="C404 - KO - Incompatibile" sourceRef="gateway17996" targetRef="phase17997"/><bpmn:sequenceFlow id="flow17997" sourceRef="phase17997" targetRef="gateway17997"/><bpmn:sequenceFlow id="flow31317" name="C2409 - KO Confermato" sourceRef="gateway17997" targetRef="phase18029"/><bpmn:sequenceFlow id="flowEnd18029" sourceRef="phase18029" targetRef="end18029"/><bpmn:sequenceFlow id="flow31318" name="C2410 - OK Incompatibilità Gestita" sourceRef="gateway17997" targetRef="phase17996"/><bpmn:sequenceFlow id="flow31315" name="C2654 - Processo Compatibile" sourceRef="gateway17996" targetRef="phase17998"/><bpmn:sequenceFlow id="flow17998" sourceRef="phase17998" targetRef="gateway17998"/><bpmn:sequenceFlow id="flow31319" name="C2365 - Recupero Dati OK" sourceRef="gateway17998" targetRef="phase18000"/><bpmn:sequenceFlow id="flow31322" name="C1019 - Inviata" sourceRef="phase18000" targetRef="phase18001"/><bpmn:sequenceFlow id="flow18001" sourceRef="phase18001" targetRef="gateway18001"/><bpmn:sequenceFlow id="flow31323" name="C2225 - KO - Ammissibilità Hub" sourceRef="gateway18001" targetRef="phase18002"/><bpmn:sequenceFlow id="flow18002" sourceRef="phase18002" targetRef="gateway18002"/><bpmn:sequenceFlow id="flow31326" name="C2416 - risottomessa da cruscotto" sourceRef="gateway18002" targetRef="phase18001"/><bpmn:sequenceFlow id="flow31327" name="C1931 - Errore non rilavorabile" sourceRef="gateway18002" targetRef="phase18029"/><bpmn:sequenceFlow id="flow31328" name="C1763 - Annullamento passivo dal SII" sourceRef="gateway18002" targetRef="phase18028"/><bpmn:sequenceFlow id="flowEnd18028" sourceRef="phase18028" targetRef="end18028"/><bpmn:sequenceFlow id="flow31324" name="C2224 - OK - Ammissibilità Hub" sourceRef="gateway18001" targetRef="phase20854"/><bpmn:sequenceFlow id="flow20854" sourceRef="phase20854" targetRef="gateway20854"/><bpmn:sequenceFlow id="flow31325" name="C3118 - KO AtoA/pdc" sourceRef="gateway20854" targetRef="phase18003"/><bpmn:sequenceFlow id="flow18003" sourceRef="phase18003" targetRef="gateway18003"/><bpmn:sequenceFlow id="flow31329" name="C2598 - gestione manuale" sourceRef="gateway18003" targetRef="phase18004"/><bpmn:sequenceFlow id="flow31331" name="C1019 - Inviata" sourceRef="phase18004" targetRef="phase18005"/><bpmn:sequenceFlow id="flow18005" sourceRef="phase18005" targetRef="gateway18005"/><bpmn:sequenceFlow id="flow31332" name="C2225 - KO - Ammissibilità Hub" sourceRef="gateway18005" targetRef="phase18006"/><bpmn:sequenceFlow id="flow18006" sourceRef="phase18006" targetRef="gateway18006"/><bpmn:sequenceFlow id="flow31334" name="C2416 - risottomessa da cruscotto" sourceRef="gateway18006" targetRef="phase18005"/><bpmn:sequenceFlow id="flow31335" name="C1931 - Errore non rilavorabile" sourceRef="gateway18006" targetRef="phase18029"/><bpmn:sequenceFlow id="flow31333" name="C2224 - OK - Ammissibilità Hub" sourceRef="gateway18005" targetRef="phase18007"/><bpmn:sequenceFlow id="flow18007" sourceRef="phase18007" targetRef="gateway18007"/><bpmn:sequenceFlow id="flow31336" name="C1037 - Ammissibilità OK" sourceRef="gateway18007" targetRef="phase18099"/><bpmn:sequenceFlow id="flow18099" sourceRef="phase18099" targetRef="gateway18099"/><bpmn:sequenceFlow id="flow31443" name="C2222 – Commodity Gas" sourceRef="gateway18099" targetRef="phase18008"/><bpmn:sequenceFlow id="flow18008" sourceRef="phase18008" targetRef="gateway18008"/><bpmn:sequenceFlow id="flow31338" name="C1448 - OK controlli RCU + Data decorrenza" sourceRef="gateway18008" targetRef="phase18009"/><bpmn:sequenceFlow id="flow31342" name="C1936 - Data raggiunta" sourceRef="phase18009" targetRef="phase18010"/><bpmn:sequenceFlow id="flow18010" sourceRef="phase18010" targetRef="gateway18010"/><bpmn:sequenceFlow id="flow31343" name="C2242 - Chiusura Ordine OK" sourceRef="gateway18010" targetRef="phase18012"/><bpmn:sequenceFlow id="flow31346" name="C1900 - Integrazione M2C" sourceRef="phase18012" targetRef="phase18013"/><bpmn:sequenceFlow id="flow31347" name="C1904 - In attesa esito M2C" sourceRef="phase18013" targetRef="phase18014"/><bpmn:sequenceFlow id="flow18014" sourceRef="phase18014" targetRef="gateway18014"/><bpmn:sequenceFlow id="flow31348" name="C1006 - OK Integrazione M2C" sourceRef="gateway18014" targetRef="phase18026"/><bpmn:sequenceFlow id="flowEnd18026" sourceRef="phase18026" targetRef="end18026"/><bpmn:sequenceFlow id="flow31349" name="C2551 - OK Intregrazione M2C - Fatture di Storno da emettere" sourceRef="gateway18014" targetRef="phase18026"/><bpmn:sequenceFlow id="flow31350" name="C2552 - Elaborazione bloccata nel M2C" sourceRef="gateway18014" targetRef="phase18015"/><bpmn:sequenceFlow id="flow31351" name="C2550 - case creato" sourceRef="phase18015" targetRef="phase18026"/><bpmn:sequenceFlow id="flow31344" name="C1899 - Errore CRM durante Chiusura Ordine" sourceRef="gateway18010" targetRef="phase18011"/><bpmn:sequenceFlow id="flow31345" name="C1616 - Risoluzione Errore" sourceRef="phase18011" targetRef="phase18012"/><bpmn:sequenceFlow id="flow31339" name="C1449 - KO controlli RCU + Data decorrenza" sourceRef="gateway18008" targetRef="phase18025"/><bpmn:sequenceFlow id="flow31340" name="C2549 - annullamento attivo" sourceRef="gateway18008" targetRef="phase18016"/><bpmn:sequenceFlow id="flow31352" name="C1019 - Inviata" sourceRef="phase18016" targetRef="phase18017"/><bpmn:sequenceFlow id="flow18017" sourceRef="phase18017" targetRef="gateway18017"/><bpmn:sequenceFlow id="flow31353" name="C2475 - OK - Ammissibilità Annullamento Hub" sourceRef="gateway18017" targetRef="phase20855"/><bpmn:sequenceFlow id="flow20855" sourceRef="phase20855" targetRef="gateway20855"/><bpmn:sequenceFlow id="flow37139" name="C3120 - annullamento da gestire" sourceRef="gateway20855" targetRef="phase20856"/><bpmn:sequenceFlow id="flow20856" sourceRef="phase20856" targetRef="gateway20856"/><bpmn:sequenceFlow id="flow31355" name="C3118 - KO AtoA/pdc" sourceRef="gateway20856" targetRef="phase18018"/><bpmn:sequenceFlow id="flow18018" sourceRef="phase18018" targetRef="gateway18018"/><bpmn:sequenceFlow id="flow31359" name="C2508 - gestione fuori linea" sourceRef="gateway18018" targetRef="phase18019"/><bpmn:sequenceFlow id="flow31364" name="C1019 - Inviata" sourceRef="phase18019" targetRef="phase18020"/><bpmn:sequenceFlow id="flow18020" sourceRef="phase18020" targetRef="gateway18020"/><bpmn:sequenceFlow id="flow31365" name="C2225 - KO - Ammissibilità Hub" sourceRef="gateway18020" targetRef="phase18022"/><bpmn:sequenceFlow id="flow18022" sourceRef="phase18022" targetRef="gateway18022"/><bpmn:sequenceFlow id="flow31372" name="C2416 - risottomessa da cruscotto" sourceRef="gateway18022" targetRef="phase18020"/><bpmn:sequenceFlow id="flow31373" name="C1931 - Errore non rilavorabile" sourceRef="gateway18022" targetRef="phase18008"/><bpmn:sequenceFlow id="flow31374" name="C1449 - KO controlli RCU + Data decorrenza" sourceRef="gateway18022" targetRef="phase18025"/><bpmn:sequenceFlow id="flow31375" name="C1448 - OK controlli RCU" sourceRef="gateway18022" targetRef="phase18009"/><bpmn:sequenceFlow id="flow31366" name="C2224 - OK - Ammissibilità Hub" sourceRef="gateway18020" targetRef="phase18023"/><bpmn:sequenceFlow id="flow18023" sourceRef="phase18023" targetRef="gateway18023"/><bpmn:sequenceFlow id="flow31376" name="C1037 - Ammissibilità OK" sourceRef="gateway18023" targetRef="phase18024"/><bpmn:sequenceFlow id="flow18024" sourceRef="phase18024" targetRef="gateway18024"/><bpmn:sequenceFlow id="flow31381" name="C1063 - Esito finale Annullamento OK" sourceRef="gateway18024" targetRef="phase18027"/><bpmn:sequenceFlow id="flowEnd18027" sourceRef="phase18027" targetRef="end18027"/><bpmn:sequenceFlow id="flow31382" name="C1064 - Esito finale Annullamento KO" sourceRef="gateway18024" targetRef="phase18008"/><bpmn:sequenceFlow id="flow31383" name="C1449 - KO controlli RCU + Data decorrenza" sourceRef="gateway18024" targetRef="phase18025"/><bpmn:sequenceFlow id="flow31384" name="C1448 - OK controlli RCU" sourceRef="gateway18024" targetRef="phase18009"/><bpmn:sequenceFlow id="flow31385" name="C1763 - Annullamento passivo dal SII" sourceRef="gateway18024" targetRef="phase18028"/><bpmn:sequenceFlow id="flow31377" name="C1038 - Ammissibilità KO" sourceRef="gateway18023" targetRef="phase18021"/><bpmn:sequenceFlow id="flow18021" sourceRef="phase18021" targetRef="gateway18021"/><bpmn:sequenceFlow id="flow31367" name="C2416 - risottomessa da cruscotto" sourceRef="gateway18021" targetRef="phase18017"/><bpmn:sequenceFlow id="flow31368" name="C1931 - Errore non rilavorabile" sourceRef="gateway18021" targetRef="phase18008"/><bpmn:sequenceFlow id="flow31369" name="C1449 - KO controlli RCU + Data decorrenza" sourceRef="gateway18021" targetRef="phase18025"/><bpmn:sequenceFlow id="flow31370" name="C1448 - OK controlli RCU" sourceRef="gateway18021" targetRef="phase18009"/><bpmn:sequenceFlow id="flow31371" name="C1763 - Annullamento passivo dal SII" sourceRef="gateway18021" targetRef="phase18028"/><bpmn:sequenceFlow id="flow31378" name="C1449 - KO controlli RCU + Data decorrenza" sourceRef="gateway18023" targetRef="phase18025"/><bpmn:sequenceFlow id="flow31379" name="C1448 - OK controlli RCU" sourceRef="gateway18023" targetRef="phase18009"/><bpmn:sequenceFlow id="flow31380" name="C1763 - Annullamento passivo dal SII" sourceRef="gateway18023" targetRef="phase18028"/><bpmn:sequenceFlow id="flow31360" name="C2509 - Da gestire nuovo invio automatico" sourceRef="gateway18018" targetRef="phase18016"/><bpmn:sequenceFlow id="flow31361" name="C1449 - KO controlli RCU + Data decorrenza" sourceRef="gateway18018" targetRef="phase18025"/><bpmn:sequenceFlow id="flow31362" name="C1448 - OK controlli RCU" sourceRef="gateway18018" targetRef="phase18009"/><bpmn:sequenceFlow id="flow31363" name="C1763 - Annullamento passivo dal SII" sourceRef="gateway18018" targetRef="phase18028"/><bpmn:sequenceFlow id="flow37141" name="C2875 - OK - Inviato Annullamento al SII" sourceRef="gateway20856" targetRef="phase18023"/><bpmn:sequenceFlow id="flow37140" name="C2599 - annullamento confermato" sourceRef="gateway20855" targetRef="phase18027"/><bpmn:sequenceFlow id="flow31354" name="C2476 - KO - Ammissibilità Annullamento Hub" sourceRef="gateway18017" targetRef="phase18021"/><bpmn:sequenceFlow id="flow31356" name="C1449 - KO controlli RCU + Data decorrenza" sourceRef="gateway18017" targetRef="phase18025"/><bpmn:sequenceFlow id="flow31357" name="C1448 - OK controlli RCU" sourceRef="gateway18017" targetRef="phase18009"/><bpmn:sequenceFlow id="flow31358" name="C1763 - Annullamento passivo dal SII" sourceRef="gateway18017" targetRef="phase18028"/><bpmn:sequenceFlow id="flow37138" name="C2599 - annullamento confermato" sourceRef="gateway18017" targetRef="phase18027"/><bpmn:sequenceFlow id="flow31341" name="C1763 - Annullamento passivo dal SII" sourceRef="gateway18008" targetRef="phase18028"/><bpmn:sequenceFlow id="flow31445" name="C2221 - Commodity Elettricità" sourceRef="gateway18099" targetRef="phase18100"/><bpmn:sequenceFlow id="flow31444" name="C1019 - Inviata" sourceRef="phase18100" targetRef="phase18008"/><bpmn:sequenceFlow id="flow31337" name="C1038 - Ammissibilità KO" sourceRef="gateway18007" targetRef="phase18002"/><bpmn:sequenceFlow id="flow31330" name="C2509 - Da gestire nuovo invio automatico" sourceRef="gateway18003" targetRef="phase18000"/><bpmn:sequenceFlow id="flow37137" name="C3117 - OK pratica inserita" sourceRef="gateway20854" targetRef="phase18007"/><bpmn:sequenceFlow id="flow31320" name="C1933 - Recupero Dati KO" sourceRef="gateway17998" targetRef="phase17999"/><bpmn:sequenceFlow id="flow31321" name="C1616 - Risoluzione Errore" sourceRef="phase17999" targetRef="phase17998"/><bpmn:sequenceFlow id="flow31316" name="C2639 - Incompatibilità Non bloccante" sourceRef="gateway17996" targetRef="phase17998"/><bpmn:sequenceFlow id="flow31429" name="C2252 - Apertura Case Automatica" sourceRef="gateway18083" targetRef="phase18098"/><bpmn:sequenceFlow id="flow31442" name="C1401 - Risoluzione contrattuale OK" sourceRef="phase18098" targetRef="phase17996"/><bpmn:exclusiveGateway id="gateway18083"/><bpmn:exclusiveGateway id="gateway17995"/><bpmn:exclusiveGateway id="gateway17996"/><bpmn:exclusiveGateway id="gateway17997"/><bpmn:exclusiveGateway id="gateway17998"/><bpmn:exclusiveGateway id="gateway18001"/><bpmn:exclusiveGateway id="gateway18002"/><bpmn:exclusiveGateway id="gateway20854"/><bpmn:exclusiveGateway id="gateway18003"/><bpmn:exclusiveGateway id="gateway18005"/><bpmn:exclusiveGateway id="gateway18006"/><bpmn:exclusiveGateway id="gateway18007"/><bpmn:exclusiveGateway id="gateway18099"/><bpmn:exclusiveGateway id="gateway18008"/><bpmn:exclusiveGateway id="gateway18010"/><bpmn:exclusiveGateway id="gateway18014"/><bpmn:exclusiveGateway id="gateway18017"/><bpmn:exclusiveGateway id="gateway20855"/><bpmn:exclusiveGateway id="gateway20856"/><bpmn:exclusiveGateway id="gateway18018"/><bpmn:exclusiveGateway id="gateway18020"/><bpmn:exclusiveGateway id="gateway18022"/><bpmn:exclusiveGateway id="gateway18023"/><bpmn:exclusiveGateway id="gateway18024"/><bpmn:exclusiveGateway id="gateway18021"/><bpmn:endEvent id="end18025"/><bpmn:endEvent id="end18029"/><bpmn:endEvent id="end18028"/><bpmn:endEvent id="end18026"/><bpmn:endEvent id="end18027"/></bpmn:process><bpmndi:BPMNDiagram id="BPMNDiagram_1">
3642
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="process_458"><bpmndi:BPMNShape id="start_di" bpmnElement="start" ><dc:Bounds x="150" y="-18.0" width="36" height="36"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18083_di" bpmnElement="phase18083" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="286" y="-40.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway18083_di" bpmnElement="gateway18083" isMarkerVisible="true"><dc:Bounds x="496" y="-25.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase17995_di" bpmnElement="phase17995" bioc:stroke="#0d4372" bioc:fill="#bbdefb" color:background-color="#bbdefb" color:border-color="#0d4372"><dc:Bounds x="646" y="-40.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway17995_di" bpmnElement="gateway17995" isMarkerVisible="true"><dc:Bounds x="856" y="-25.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18025_di" bpmnElement="phase18025" bioc:stroke="#6b3c00" bioc:fill="#ffe0b2" color:background-color="#ffe0b2" color:border-color="#6b3c00"><dc:Bounds x="1006" y="-40.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="end18025_di" bpmnElement="end18025" bioc:stroke="#6b3c00" bioc:fill="#ffe0b2" color:background-color="#ffe0b2" color:border-color="#6b3c00"><dc:Bounds x="1216" y="-18.0" width="36" height="36"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase17996_di" bpmnElement="phase17996" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="1006" y="110.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway17996_di" bpmnElement="gateway17996" isMarkerVisible="true"><dc:Bounds x="1216" y="125.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase17997_di" bpmnElement="phase17997" ><dc:Bounds x="1366" y="110.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway17997_di" bpmnElement="gateway17997" isMarkerVisible="true"><dc:Bounds x="1576" y="125.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18029_di" bpmnElement="phase18029" bioc:stroke="#831311" bioc:fill="#ffcdd2" color:background-color="#ffcdd2" color:border-color="#831311"><dc:Bounds x="1726" y="110.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="end18029_di" bpmnElement="end18029" bioc:stroke="#831311" bioc:fill="#ffcdd2" color:background-color="#ffcdd2" color:border-color="#831311"><dc:Bounds x="1936" y="132.0" width="36" height="36"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase17998_di" bpmnElement="phase17998" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="1366" y="260.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway17998_di" bpmnElement="gateway17998" isMarkerVisible="true"><dc:Bounds x="1576" y="275.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18000_di" bpmnElement="phase18000" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="1726" y="260.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18001_di" bpmnElement="phase18001" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="1936" y="260.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway18001_di" bpmnElement="gateway18001" isMarkerVisible="true"><dc:Bounds x="2146" y="275.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18002_di" bpmnElement="phase18002" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="2296" y="260.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway18002_di" bpmnElement="gateway18002" isMarkerVisible="true"><dc:Bounds x="2506" y="275.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18028_di" bpmnElement="phase18028" bioc:stroke="#6b3c00" bioc:fill="#ffe0b2" color:background-color="#ffe0b2" color:border-color="#6b3c00"><dc:Bounds x="2656" y="410.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="end18028_di" bpmnElement="end18028" bioc:stroke="#6b3c00" bioc:fill="#ffe0b2" color:background-color="#ffe0b2" color:border-color="#6b3c00"><dc:Bounds x="2866" y="432.0" width="36" height="36"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase20854_di" bpmnElement="phase20854" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="2296" y="560.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway20854_di" bpmnElement="gateway20854" isMarkerVisible="true"><dc:Bounds x="2506" y="575.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18003_di" bpmnElement="phase18003" ><dc:Bounds x="2656" y="560.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway18003_di" bpmnElement="gateway18003" isMarkerVisible="true"><dc:Bounds x="2866" y="575.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18004_di" bpmnElement="phase18004" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="3016" y="560.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18005_di" bpmnElement="phase18005" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="3226" y="560.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway18005_di" bpmnElement="gateway18005" isMarkerVisible="true"><dc:Bounds x="3436" y="575.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18006_di" bpmnElement="phase18006" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="3586" y="560.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway18006_di" bpmnElement="gateway18006" isMarkerVisible="true"><dc:Bounds x="3796" y="575.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18007_di" bpmnElement="phase18007" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="3586" y="710.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway18007_di" bpmnElement="gateway18007" isMarkerVisible="true"><dc:Bounds x="3796" y="725.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18099_di" bpmnElement="phase18099" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="3946" y="710.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway18099_di" bpmnElement="gateway18099" isMarkerVisible="true"><dc:Bounds x="4156" y="725.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18008_di" bpmnElement="phase18008" bioc:stroke="#0d4372" bioc:fill="#bbdefb" color:background-color="#bbdefb" color:border-color="#0d4372"><dc:Bounds x="4306" y="710.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway18008_di" bpmnElement="gateway18008" isMarkerVisible="true"><dc:Bounds x="4516" y="725.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18009_di" bpmnElement="phase18009" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="4666" y="710.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18010_di" bpmnElement="phase18010" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="4876" y="710.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway18010_di" bpmnElement="gateway18010" isMarkerVisible="true"><dc:Bounds x="5086" y="725.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18012_di" bpmnElement="phase18012" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="5236" y="710.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18013_di" bpmnElement="phase18013" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="5446" y="710.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18014_di" bpmnElement="phase18014" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="5656" y="710.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway18014_di" bpmnElement="gateway18014" isMarkerVisible="true"><dc:Bounds x="5866" y="725.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18026_di" bpmnElement="phase18026" bioc:stroke="#205022" bioc:fill="#c8e6c9" color:background-color="#c8e6c9" color:border-color="#205022"><dc:Bounds x="6016" y="710.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="end18026_di" bpmnElement="end18026" bioc:stroke="#205022" bioc:fill="#c8e6c9" color:background-color="#c8e6c9" color:border-color="#205022"><dc:Bounds x="6226" y="732.0" width="36" height="36"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18015_di" bpmnElement="phase18015" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="6016" y="860.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18011_di" bpmnElement="phase18011" ><dc:Bounds x="5236" y="1010.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18016_di" bpmnElement="phase18016" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="4666" y="1160.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18017_di" bpmnElement="phase18017" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="4876" y="1160.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway18017_di" bpmnElement="gateway18017" isMarkerVisible="true"><dc:Bounds x="5086" y="1175.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase20855_di" bpmnElement="phase20855" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="5236" y="1160.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway20855_di" bpmnElement="gateway20855" isMarkerVisible="true"><dc:Bounds x="5446" y="1175.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase20856_di" bpmnElement="phase20856" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="5596" y="1160.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway20856_di" bpmnElement="gateway20856" isMarkerVisible="true"><dc:Bounds x="5806" y="1175.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18018_di" bpmnElement="phase18018" ><dc:Bounds x="5956" y="1160.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway18018_di" bpmnElement="gateway18018" isMarkerVisible="true"><dc:Bounds x="6166" y="1175.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18019_di" bpmnElement="phase18019" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="6316" y="1160.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18020_di" bpmnElement="phase18020" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="6526" y="1160.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway18020_di" bpmnElement="gateway18020" isMarkerVisible="true"><dc:Bounds x="6736" y="1175.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18022_di" bpmnElement="phase18022" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="6886" y="1160.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway18022_di" bpmnElement="gateway18022" isMarkerVisible="true"><dc:Bounds x="7096" y="1175.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18023_di" bpmnElement="phase18023" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="6886" y="1310.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway18023_di" bpmnElement="gateway18023" isMarkerVisible="true"><dc:Bounds x="7096" y="1325.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18024_di" bpmnElement="phase18024" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="7246" y="1310.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway18024_di" bpmnElement="gateway18024" isMarkerVisible="true"><dc:Bounds x="7456" y="1325.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18027_di" bpmnElement="phase18027" bioc:stroke="#6b3c00" bioc:fill="#ffe0b2" color:background-color="#ffe0b2" color:border-color="#6b3c00"><dc:Bounds x="7606" y="1310.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="end18027_di" bpmnElement="end18027" bioc:stroke="#6b3c00" bioc:fill="#ffe0b2" color:background-color="#ffe0b2" color:border-color="#6b3c00"><dc:Bounds x="7816" y="1332.0" width="36" height="36"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18021_di" bpmnElement="phase18021" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="7246" y="1460.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="gateway18021_di" bpmnElement="gateway18021" isMarkerVisible="true"><dc:Bounds x="7456" y="1475.0" width="50" height="50"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18100_di" bpmnElement="phase18100" ><dc:Bounds x="4306" y="1610.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase17999_di" bpmnElement="phase17999" ><dc:Bounds x="1726" y="1760.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape id="phase18098_di" bpmnElement="phase18098" bioc:stroke="#5b176d" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#5b176d"><dc:Bounds x="646" y="1910.0" width="110" height="80"/></bpmndi:BPMNShape><bpmndi:BPMNEdge id="flowStart_di" bpmnElement="flowStart"><di:waypoint x="186" y="0.0" /><di:waypoint x="286" y="0.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow18083_di" bpmnElement="flow18083"><di:waypoint x="396" y="0.0" /><di:waypoint x="496" y="0.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31428_di" bpmnElement="flow31428"><di:waypoint x="546" y="0.0" /><di:waypoint x="646" y="0.0" /><bpmndi:BPMNLabel><dc:Bounds x="546" y="5.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow17995_di" bpmnElement="flow17995"><di:waypoint x="756" y="0.0" /><di:waypoint x="856" y="0.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31312_di" bpmnElement="flow31312"><di:waypoint x="906" y="0.0" /><di:waypoint x="1006" y="0.0" /><bpmndi:BPMNLabel><dc:Bounds x="906" y="5.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flowEnd18025_di" bpmnElement="flowEnd18025"><di:waypoint x="1116" y="0.0" /><di:waypoint x="1216" y="0.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31313_di" bpmnElement="flow31313"><di:waypoint x="881.0" y="25.0" /><di:waypoint x="881.0" y="150.0" /><di:waypoint x="1006" y="150.0" /><bpmndi:BPMNLabel><dc:Bounds x="881.0" y="155.0" width="125.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow17996_di" bpmnElement="flow17996"><di:waypoint x="1116" y="150.0" /><di:waypoint x="1216" y="150.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31314_di" bpmnElement="flow31314"><di:waypoint x="1266" y="150.0" /><di:waypoint x="1366" y="150.0" /><bpmndi:BPMNLabel><dc:Bounds x="1266" y="155.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow17997_di" bpmnElement="flow17997"><di:waypoint x="1476" y="150.0" /><di:waypoint x="1576" y="150.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31317_di" bpmnElement="flow31317"><di:waypoint x="1626" y="150.0" /><di:waypoint x="1726" y="150.0" /><bpmndi:BPMNLabel><dc:Bounds x="1626" y="155.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flowEnd18029_di" bpmnElement="flowEnd18029"><di:waypoint x="1836" y="150.0" /><di:waypoint x="1936" y="150.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31318_di" bpmnElement="flow31318" bioc:stroke="#2a25a4" color:border-color="#2a25a4"><di:waypoint x="1601.0" y="175.0" /><di:waypoint x="1601.0" y="229.0" /><di:waypoint x="976" y="229.0" /><di:waypoint x="976" y="150.01" /><bpmndi:BPMNLabel><dc:Bounds x="1601.0" y="180.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31315_di" bpmnElement="flow31315"><di:waypoint x="1241.0" y="175.0" /><di:waypoint x="1241.0" y="300.0" /><di:waypoint x="1366" y="300.0" /><bpmndi:BPMNLabel><dc:Bounds x="1241.0" y="305.0" width="125.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow17998_di" bpmnElement="flow17998"><di:waypoint x="1476" y="300.0" /><di:waypoint x="1576" y="300.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31319_di" bpmnElement="flow31319"><di:waypoint x="1626" y="300.0" /><di:waypoint x="1726" y="300.0" /><bpmndi:BPMNLabel><dc:Bounds x="1626" y="305.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31322_di" bpmnElement="flow31322"><di:waypoint x="1836" y="300.0" /><di:waypoint x="1936" y="300.0" /><bpmndi:BPMNLabel><dc:Bounds x="1836" y="305.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow18001_di" bpmnElement="flow18001"><di:waypoint x="2046" y="300.0" /><di:waypoint x="2146" y="300.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31323_di" bpmnElement="flow31323"><di:waypoint x="2196" y="300.0" /><di:waypoint x="2296" y="300.0" /><bpmndi:BPMNLabel><dc:Bounds x="2196" y="305.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow18002_di" bpmnElement="flow18002"><di:waypoint x="2406" y="300.0" /><di:waypoint x="2506" y="300.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31326_di" bpmnElement="flow31326" bioc:stroke="#0194b5" color:border-color="#0194b5"><di:waypoint x="2531.0" y="325.0" /><di:waypoint x="2531.0" y="383.0" /><di:waypoint x="1906" y="383.0" /><di:waypoint x="1906" y="300.01" /><bpmndi:BPMNLabel><dc:Bounds x="2531.0" y="330.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31327_di" bpmnElement="flow31327" bioc:stroke="#b3f345" color:border-color="#b3f345"><di:waypoint x="2531.0" y="325.0" /><di:waypoint x="2531.0" y="383.0" /><di:waypoint x="1696" y="383.0" /><di:waypoint x="1696" y="150.01" /><bpmndi:BPMNLabel><dc:Bounds x="1696" y="383.0" width="31" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31328_di" bpmnElement="flow31328"><di:waypoint x="2531.0" y="325.0" /><di:waypoint x="2531.0" y="450.0" /><di:waypoint x="2656" y="450.0" /><bpmndi:BPMNLabel><dc:Bounds x="2531.0" y="455.0" width="125.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flowEnd18028_di" bpmnElement="flowEnd18028"><di:waypoint x="2766" y="450.0" /><di:waypoint x="2866" y="450.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31324_di" bpmnElement="flow31324"><di:waypoint x="2171.0" y="325.0" /><di:waypoint x="2171.0" y="600.0" /><di:waypoint x="2296" y="600.0" /><bpmndi:BPMNLabel><dc:Bounds x="2171.0" y="605.0" width="125.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow20854_di" bpmnElement="flow20854"><di:waypoint x="2406" y="600.0" /><di:waypoint x="2506" y="600.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31325_di" bpmnElement="flow31325"><di:waypoint x="2556" y="600.0" /><di:waypoint x="2656" y="600.0" /><bpmndi:BPMNLabel><dc:Bounds x="2556" y="605.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow18003_di" bpmnElement="flow18003"><di:waypoint x="2766" y="600.0" /><di:waypoint x="2866" y="600.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31329_di" bpmnElement="flow31329"><di:waypoint x="2916" y="600.0" /><di:waypoint x="3016" y="600.0" /><bpmndi:BPMNLabel><dc:Bounds x="2916" y="605.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31331_di" bpmnElement="flow31331"><di:waypoint x="3126" y="600.0" /><di:waypoint x="3226" y="600.0" /><bpmndi:BPMNLabel><dc:Bounds x="3126" y="605.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow18005_di" bpmnElement="flow18005"><di:waypoint x="3336" y="600.0" /><di:waypoint x="3436" y="600.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31332_di" bpmnElement="flow31332"><di:waypoint x="3486" y="600.0" /><di:waypoint x="3586" y="600.0" /><bpmndi:BPMNLabel><dc:Bounds x="3486" y="605.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow18006_di" bpmnElement="flow18006"><di:waypoint x="3696" y="600.0" /><di:waypoint x="3796" y="600.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31334_di" bpmnElement="flow31334" bioc:stroke="#7a1a12" color:border-color="#7a1a12"><di:waypoint x="3821.0" y="625.0" /><di:waypoint x="3821.0" y="691.0" /><di:waypoint x="3196" y="691.0" /><di:waypoint x="3196" y="600.01" /><bpmndi:BPMNLabel><dc:Bounds x="3821.0" y="630.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31335_di" bpmnElement="flow31335" bioc:stroke="#4ee1ec" color:border-color="#4ee1ec"><di:waypoint x="3821.0" y="625.0" /><di:waypoint x="3821.0" y="691.0" /><di:waypoint x="1696" y="691.0" /><di:waypoint x="1696" y="150.01" /><bpmndi:BPMNLabel><dc:Bounds x="1696" y="691.0" width="31" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31333_di" bpmnElement="flow31333"><di:waypoint x="3461.0" y="625.0" /><di:waypoint x="3461.0" y="750.0" /><di:waypoint x="3586" y="750.0" /><bpmndi:BPMNLabel><dc:Bounds x="3461.0" y="755.0" width="125.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow18007_di" bpmnElement="flow18007"><di:waypoint x="3696" y="750.0" /><di:waypoint x="3796" y="750.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31336_di" bpmnElement="flow31336"><di:waypoint x="3846" y="750.0" /><di:waypoint x="3946" y="750.0" /><bpmndi:BPMNLabel><dc:Bounds x="3846" y="755.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow18099_di" bpmnElement="flow18099"><di:waypoint x="4056" y="750.0" /><di:waypoint x="4156" y="750.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31443_di" bpmnElement="flow31443"><di:waypoint x="4206" y="750.0" /><di:waypoint x="4306" y="750.0" /><bpmndi:BPMNLabel><dc:Bounds x="4206" y="755.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow18008_di" bpmnElement="flow18008"><di:waypoint x="4416" y="750.0" /><di:waypoint x="4516" y="750.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31338_di" bpmnElement="flow31338"><di:waypoint x="4566" y="750.0" /><di:waypoint x="4666" y="750.0" /><bpmndi:BPMNLabel><dc:Bounds x="4566" y="755.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31342_di" bpmnElement="flow31342"><di:waypoint x="4776" y="750.0" /><di:waypoint x="4876" y="750.0" /><bpmndi:BPMNLabel><dc:Bounds x="4776" y="755.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow18010_di" bpmnElement="flow18010"><di:waypoint x="4986" y="750.0" /><di:waypoint x="5086" y="750.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31343_di" bpmnElement="flow31343"><di:waypoint x="5136" y="750.0" /><di:waypoint x="5236" y="750.0" /><bpmndi:BPMNLabel><dc:Bounds x="5136" y="755.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31346_di" bpmnElement="flow31346"><di:waypoint x="5346" y="750.0" /><di:waypoint x="5446" y="750.0" /><bpmndi:BPMNLabel><dc:Bounds x="5346" y="755.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31347_di" bpmnElement="flow31347"><di:waypoint x="5556" y="750.0" /><di:waypoint x="5656" y="750.0" /><bpmndi:BPMNLabel><dc:Bounds x="5556" y="755.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow18014_di" bpmnElement="flow18014"><di:waypoint x="5766" y="750.0" /><di:waypoint x="5866" y="750.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31348_di" bpmnElement="flow31348"><di:waypoint x="5916" y="750.0" /><di:waypoint x="6016" y="750.0" /><bpmndi:BPMNLabel><dc:Bounds x="5916" y="755.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flowEnd18026_di" bpmnElement="flowEnd18026"><di:waypoint x="6126" y="750.0" /><di:waypoint x="6226" y="750.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31349_di" bpmnElement="flow31349" bioc:stroke="#c365c0" color:border-color="#c365c0"><di:waypoint x="5891.0" y="775.0" /><di:waypoint x="5891.0" y="845.0" /><di:waypoint x="5986" y="845.0" /><di:waypoint x="5986" y="750.01" /><bpmndi:BPMNLabel><dc:Bounds x="5891.0" y="780.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31350_di" bpmnElement="flow31350"><di:waypoint x="5891.0" y="775.0" /><di:waypoint x="5891.0" y="900.0" /><di:waypoint x="6016" y="900.0" /><bpmndi:BPMNLabel><dc:Bounds x="5891.0" y="905.0" width="125.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31351_di" bpmnElement="flow31351" bioc:stroke="#288096" color:border-color="#288096"><di:waypoint x="6071.0" y="940.0" /><di:waypoint x="6071.0" y="1014.0" /><di:waypoint x="5986" y="1014.0" /><di:waypoint x="5986" y="750.01" /><bpmndi:BPMNLabel><dc:Bounds x="6071.0" y="945.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31344_di" bpmnElement="flow31344"><di:waypoint x="5111.0" y="775.0" /><di:waypoint x="5111.0" y="1050.0" /><di:waypoint x="5236" y="1050.0" /><bpmndi:BPMNLabel><dc:Bounds x="5111.0" y="1055.0" width="125.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31345_di" bpmnElement="flow31345" bioc:stroke="#28135a" color:border-color="#28135a"><di:waypoint x="5291.0" y="1090.0" /><di:waypoint x="5291.0" y="1168.0" /><di:waypoint x="5206" y="1168.0" /><di:waypoint x="5206" y="750.01" /><bpmndi:BPMNLabel><dc:Bounds x="5291.0" y="1095.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31339_di" bpmnElement="flow31339" bioc:stroke="#2dd981" color:border-color="#2dd981"><di:waypoint x="4541.0" y="775.0" /><di:waypoint x="4541.0" y="853.0" /><di:waypoint x="976" y="853.0" /><di:waypoint x="976" y="0.01" /><bpmndi:BPMNLabel><dc:Bounds x="4541.0" y="780.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31340_di" bpmnElement="flow31340"><di:waypoint x="4541.0" y="775.0" /><di:waypoint x="4541.0" y="1200.0" /><di:waypoint x="4666" y="1200.0" /><bpmndi:BPMNLabel><dc:Bounds x="4541.0" y="1205.0" width="125.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31352_di" bpmnElement="flow31352"><di:waypoint x="4776" y="1200.0" /><di:waypoint x="4876" y="1200.0" /><bpmndi:BPMNLabel><dc:Bounds x="4776" y="1205.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow18017_di" bpmnElement="flow18017"><di:waypoint x="4986" y="1200.0" /><di:waypoint x="5086" y="1200.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31353_di" bpmnElement="flow31353"><di:waypoint x="5136" y="1200.0" /><di:waypoint x="5236" y="1200.0" /><bpmndi:BPMNLabel><dc:Bounds x="5136" y="1205.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow20855_di" bpmnElement="flow20855"><di:waypoint x="5346" y="1200.0" /><di:waypoint x="5446" y="1200.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow37139_di" bpmnElement="flow37139"><di:waypoint x="5496" y="1200.0" /><di:waypoint x="5596" y="1200.0" /><bpmndi:BPMNLabel><dc:Bounds x="5496" y="1205.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow20856_di" bpmnElement="flow20856"><di:waypoint x="5706" y="1200.0" /><di:waypoint x="5806" y="1200.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31355_di" bpmnElement="flow31355"><di:waypoint x="5856" y="1200.0" /><di:waypoint x="5956" y="1200.0" /><bpmndi:BPMNLabel><dc:Bounds x="5856" y="1205.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow18018_di" bpmnElement="flow18018"><di:waypoint x="6066" y="1200.0" /><di:waypoint x="6166" y="1200.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31359_di" bpmnElement="flow31359"><di:waypoint x="6216" y="1200.0" /><di:waypoint x="6316" y="1200.0" /><bpmndi:BPMNLabel><dc:Bounds x="6216" y="1205.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31364_di" bpmnElement="flow31364"><di:waypoint x="6426" y="1200.0" /><di:waypoint x="6526" y="1200.0" /><bpmndi:BPMNLabel><dc:Bounds x="6426" y="1205.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow18020_di" bpmnElement="flow18020"><di:waypoint x="6636" y="1200.0" /><di:waypoint x="6736" y="1200.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31365_di" bpmnElement="flow31365"><di:waypoint x="6786" y="1200.0" /><di:waypoint x="6886" y="1200.0" /><bpmndi:BPMNLabel><dc:Bounds x="6786" y="1205.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow18022_di" bpmnElement="flow18022"><di:waypoint x="6996" y="1200.0" /><di:waypoint x="7096" y="1200.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31372_di" bpmnElement="flow31372" bioc:stroke="#cac043" color:border-color="#cac043"><di:waypoint x="7121.0" y="1225.0" /><di:waypoint x="7121.0" y="1307.0" /><di:waypoint x="6496" y="1307.0" /><di:waypoint x="6496" y="1200.01" /><bpmndi:BPMNLabel><dc:Bounds x="7121.0" y="1230.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31373_di" bpmnElement="flow31373" bioc:stroke="#b9de0e" color:border-color="#b9de0e"><di:waypoint x="7121.0" y="1225.0" /><di:waypoint x="7121.0" y="1307.0" /><di:waypoint x="4276" y="1307.0" /><di:waypoint x="4276" y="750.01" /><bpmndi:BPMNLabel><dc:Bounds x="4276" y="1307.0" width="31" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31374_di" bpmnElement="flow31374" bioc:stroke="#e3fd5f" color:border-color="#e3fd5f"><di:waypoint x="7121.0" y="1225.0" /><di:waypoint x="7121.0" y="1307.0" /><di:waypoint x="976" y="1307.0" /><di:waypoint x="976" y="0.01" /><bpmndi:BPMNLabel><dc:Bounds x="976" y="1307.0" width="42" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31375_di" bpmnElement="flow31375" bioc:stroke="#3d5885" color:border-color="#3d5885"><di:waypoint x="7121.0" y="1225.0" /><di:waypoint x="7121.0" y="1307.0" /><di:waypoint x="4636" y="1307.0" /><di:waypoint x="4636" y="750.01" /><bpmndi:BPMNLabel><dc:Bounds x="4636" y="1307.0" width="24" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31366_di" bpmnElement="flow31366"><di:waypoint x="6761.0" y="1225.0" /><di:waypoint x="6761.0" y="1350.0" /><di:waypoint x="6886" y="1350.0" /><bpmndi:BPMNLabel><dc:Bounds x="6761.0" y="1355.0" width="125.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow18023_di" bpmnElement="flow18023"><di:waypoint x="6996" y="1350.0" /><di:waypoint x="7096" y="1350.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31376_di" bpmnElement="flow31376"><di:waypoint x="7146" y="1350.0" /><di:waypoint x="7246" y="1350.0" /><bpmndi:BPMNLabel><dc:Bounds x="7146" y="1355.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow18024_di" bpmnElement="flow18024"><di:waypoint x="7356" y="1350.0" /><di:waypoint x="7456" y="1350.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31381_di" bpmnElement="flow31381"><di:waypoint x="7506" y="1350.0" /><di:waypoint x="7606" y="1350.0" /><bpmndi:BPMNLabel><dc:Bounds x="7506" y="1355.0" width="100" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flowEnd18027_di" bpmnElement="flowEnd18027"><di:waypoint x="7716" y="1350.0" /><di:waypoint x="7816" y="1350.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31382_di" bpmnElement="flow31382" bioc:stroke="#510201" color:border-color="#510201"><di:waypoint x="7481.0" y="1375.0" /><di:waypoint x="7481.0" y="1461.0" /><di:waypoint x="4276" y="1461.0" /><di:waypoint x="4276" y="750.01" /><bpmndi:BPMNLabel><dc:Bounds x="7481.0" y="1380.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31383_di" bpmnElement="flow31383" bioc:stroke="#1006f4" color:border-color="#1006f4"><di:waypoint x="7481.0" y="1375.0" /><di:waypoint x="7481.0" y="1461.0" /><di:waypoint x="976" y="1461.0" /><di:waypoint x="976" y="0.01" /><bpmndi:BPMNLabel><dc:Bounds x="976" y="1461.0" width="42" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31384_di" bpmnElement="flow31384" bioc:stroke="#6b96da" color:border-color="#6b96da"><di:waypoint x="7481.0" y="1375.0" /><di:waypoint x="7481.0" y="1461.0" /><di:waypoint x="4636" y="1461.0" /><di:waypoint x="4636" y="750.01" /><bpmndi:BPMNLabel><dc:Bounds x="4636" y="1461.0" width="24" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31385_di" bpmnElement="flow31385" bioc:stroke="#94a66d" color:border-color="#94a66d"><di:waypoint x="7481.0" y="1375.0" /><di:waypoint x="7481.0" y="1461.0" /><di:waypoint x="2626" y="1461.0" /><di:waypoint x="2626" y="450.01" /><bpmndi:BPMNLabel><dc:Bounds x="2626" y="1461.0" width="36" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31377_di" bpmnElement="flow31377"><di:waypoint x="7121.0" y="1375.0" /><di:waypoint x="7121.0" y="1500.0" /><di:waypoint x="7246" y="1500.0" /><bpmndi:BPMNLabel><dc:Bounds x="7121.0" y="1505.0" width="125.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow18021_di" bpmnElement="flow18021"><di:waypoint x="7356" y="1500.0" /><di:waypoint x="7456" y="1500.0" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31367_di" bpmnElement="flow31367" bioc:stroke="#99ddeb" color:border-color="#99ddeb"><di:waypoint x="7481.0" y="1525.0" /><di:waypoint x="7481.0" y="1615.0" /><di:waypoint x="4846" y="1615.0" /><di:waypoint x="4846" y="1200.01" /><bpmndi:BPMNLabel><dc:Bounds x="7481.0" y="1530.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31368_di" bpmnElement="flow31368" bioc:stroke="#6e37f9" color:border-color="#6e37f9"><di:waypoint x="7481.0" y="1525.0" /><di:waypoint x="7481.0" y="1615.0" /><di:waypoint x="4276" y="1615.0" /><di:waypoint x="4276" y="750.01" /><bpmndi:BPMNLabel><dc:Bounds x="4276" y="1615.0" width="31" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31369_di" bpmnElement="flow31369" bioc:stroke="#56defc" color:border-color="#56defc"><di:waypoint x="7481.0" y="1525.0" /><di:waypoint x="7481.0" y="1615.0" /><di:waypoint x="976" y="1615.0" /><di:waypoint x="976" y="0.01" /><bpmndi:BPMNLabel><dc:Bounds x="976" y="1615.0" width="42" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31370_di" bpmnElement="flow31370" bioc:stroke="#9a3cae" color:border-color="#9a3cae"><di:waypoint x="7481.0" y="1525.0" /><di:waypoint x="7481.0" y="1615.0" /><di:waypoint x="4636" y="1615.0" /><di:waypoint x="4636" y="750.01" /><bpmndi:BPMNLabel><dc:Bounds x="4636" y="1615.0" width="24" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31371_di" bpmnElement="flow31371" bioc:stroke="#132fae" color:border-color="#132fae"><di:waypoint x="7481.0" y="1525.0" /><di:waypoint x="7481.0" y="1615.0" /><di:waypoint x="2626" y="1615.0" /><di:waypoint x="2626" y="450.01" /><bpmndi:BPMNLabel><dc:Bounds x="2626" y="1615.0" width="36" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31378_di" bpmnElement="flow31378" bioc:stroke="#e055c0" color:border-color="#e055c0"><di:waypoint x="7121.0" y="1375.0" /><di:waypoint x="7121.0" y="1465.0" /><di:waypoint x="976" y="1465.0" /><di:waypoint x="976" y="0.01" /><bpmndi:BPMNLabel><dc:Bounds x="7121.0" y="1380.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31379_di" bpmnElement="flow31379" bioc:stroke="#aa7f6e" color:border-color="#aa7f6e"><di:waypoint x="7121.0" y="1375.0" /><di:waypoint x="7121.0" y="1465.0" /><di:waypoint x="4636" y="1465.0" /><di:waypoint x="4636" y="750.01" /><bpmndi:BPMNLabel><dc:Bounds x="4636" y="1465.0" width="24" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31380_di" bpmnElement="flow31380" bioc:stroke="#161cf9" color:border-color="#161cf9"><di:waypoint x="7121.0" y="1375.0" /><di:waypoint x="7121.0" y="1465.0" /><di:waypoint x="2626" y="1465.0" /><di:waypoint x="2626" y="450.01" /><bpmndi:BPMNLabel><dc:Bounds x="2626" y="1465.0" width="36" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31360_di" bpmnElement="flow31360" bioc:stroke="#93a8d9" color:border-color="#93a8d9"><di:waypoint x="6191.0" y="1225.0" /><di:waypoint x="6191.0" y="1315.0" /><di:waypoint x="4636" y="1315.0" /><di:waypoint x="4636" y="1200.01" /><bpmndi:BPMNLabel><dc:Bounds x="6191.0" y="1230.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31361_di" bpmnElement="flow31361" bioc:stroke="#ef091b" color:border-color="#ef091b"><di:waypoint x="6191.0" y="1225.0" /><di:waypoint x="6191.0" y="1315.0" /><di:waypoint x="976" y="1315.0" /><di:waypoint x="976" y="0.01" /><bpmndi:BPMNLabel><dc:Bounds x="976" y="1315.0" width="42" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31362_di" bpmnElement="flow31362" bioc:stroke="#4a32de" color:border-color="#4a32de"><di:waypoint x="6191.0" y="1225.0" /><di:waypoint x="6191.0" y="1315.0" /><di:waypoint x="4636" y="1315.0" /><di:waypoint x="4636" y="750.01" /><bpmndi:BPMNLabel><dc:Bounds x="4636" y="1315.0" width="24" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31363_di" bpmnElement="flow31363" bioc:stroke="#ab0726" color:border-color="#ab0726"><di:waypoint x="6191.0" y="1225.0" /><di:waypoint x="6191.0" y="1315.0" /><di:waypoint x="2626" y="1315.0" /><di:waypoint x="2626" y="450.01" /><bpmndi:BPMNLabel><dc:Bounds x="2626" y="1315.0" width="36" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow37141_di" bpmnElement="flow37141" bioc:stroke="#3d6859" color:border-color="#3d6859"><di:waypoint x="5831.0" y="1225.0" /><di:waypoint x="5831.0" y="1315.0" /><di:waypoint x="6856" y="1315.0" /><di:waypoint x="6856" y="1350.01" /><bpmndi:BPMNLabel><dc:Bounds x="5831.0" y="1230.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow37140_di" bpmnElement="flow37140" bioc:stroke="#d83824" color:border-color="#d83824"><di:waypoint x="5471.0" y="1225.0" /><di:waypoint x="5471.0" y="1315.0" /><di:waypoint x="7576" y="1315.0" /><di:waypoint x="7576" y="1350.01" /><bpmndi:BPMNLabel><dc:Bounds x="5471.0" y="1230.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31354_di" bpmnElement="flow31354" bioc:stroke="#ee49e5" color:border-color="#ee49e5"><di:waypoint x="5111.0" y="1225.0" /><di:waypoint x="5111.0" y="1315.0" /><di:waypoint x="7216" y="1315.0" /><di:waypoint x="7216" y="1500.01" /><bpmndi:BPMNLabel><dc:Bounds x="5111.0" y="1230.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31356_di" bpmnElement="flow31356" bioc:stroke="#cf7e9d" color:border-color="#cf7e9d"><di:waypoint x="5111.0" y="1225.0" /><di:waypoint x="5111.0" y="1315.0" /><di:waypoint x="976" y="1315.0" /><di:waypoint x="976" y="0.01" /><bpmndi:BPMNLabel><dc:Bounds x="976" y="1315.0" width="42" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31357_di" bpmnElement="flow31357" bioc:stroke="#388f9f" color:border-color="#388f9f"><di:waypoint x="5111.0" y="1225.0" /><di:waypoint x="5111.0" y="1315.0" /><di:waypoint x="4636" y="1315.0" /><di:waypoint x="4636" y="750.01" /><bpmndi:BPMNLabel><dc:Bounds x="4636" y="1315.0" width="24" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31358_di" bpmnElement="flow31358" bioc:stroke="#1391b5" color:border-color="#1391b5"><di:waypoint x="5111.0" y="1225.0" /><di:waypoint x="5111.0" y="1315.0" /><di:waypoint x="2626" y="1315.0" /><di:waypoint x="2626" y="450.01" /><bpmndi:BPMNLabel><dc:Bounds x="2626" y="1315.0" width="36" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow37138_di" bpmnElement="flow37138" bioc:stroke="#cb6aba" color:border-color="#cb6aba"><di:waypoint x="5111.0" y="1225.0" /><di:waypoint x="5111.0" y="1315.0" /><di:waypoint x="7576" y="1315.0" /><di:waypoint x="7576" y="1350.01" /><bpmndi:BPMNLabel><dc:Bounds x="7576" y="1315.0" width="31" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31341_di" bpmnElement="flow31341" bioc:stroke="#359707" color:border-color="#359707"><di:waypoint x="4541.0" y="775.0" /><di:waypoint x="4541.0" y="865.0" /><di:waypoint x="2626" y="865.0" /><di:waypoint x="2626" y="450.01" /><bpmndi:BPMNLabel><dc:Bounds x="2626" y="865.0" width="36" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31445_di" bpmnElement="flow31445"><di:waypoint x="4181.0" y="775.0" /><di:waypoint x="4181.0" y="1650.0" /><di:waypoint x="4306" y="1650.0" /><bpmndi:BPMNLabel><dc:Bounds x="4181.0" y="1655.0" width="125.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31444_di" bpmnElement="flow31444" bioc:stroke="#8f0608" color:border-color="#8f0608"><di:waypoint x="4361.0" y="1690.0" /><di:waypoint x="4361.0" y="1784.0" /><di:waypoint x="4276" y="1784.0" /><di:waypoint x="4276" y="750.01" /><bpmndi:BPMNLabel><dc:Bounds x="4361.0" y="1695.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31337_di" bpmnElement="flow31337" bioc:stroke="#c5eb56" color:border-color="#c5eb56"><di:waypoint x="3821.0" y="775.0" /><di:waypoint x="3821.0" y="869.0" /><di:waypoint x="2266" y="869.0" /><di:waypoint x="2266" y="300.01" /><bpmndi:BPMNLabel><dc:Bounds x="3821.0" y="780.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31330_di" bpmnElement="flow31330" bioc:stroke="#edbdfb" color:border-color="#edbdfb"><di:waypoint x="2891.0" y="625.0" /><di:waypoint x="2891.0" y="719.0" /><di:waypoint x="1696" y="719.0" /><di:waypoint x="1696" y="300.01" /><bpmndi:BPMNLabel><dc:Bounds x="2891.0" y="630.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow37137_di" bpmnElement="flow37137" bioc:stroke="#0f2695" color:border-color="#0f2695"><di:waypoint x="2531.0" y="625.0" /><di:waypoint x="2531.0" y="719.0" /><di:waypoint x="3556" y="719.0" /><di:waypoint x="3556" y="750.01" /><bpmndi:BPMNLabel><dc:Bounds x="2531.0" y="630.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31320_di" bpmnElement="flow31320"><di:waypoint x="1601.0" y="325.0" /><di:waypoint x="1601.0" y="1800.0" /><di:waypoint x="1726" y="1800.0" /><bpmndi:BPMNLabel><dc:Bounds x="1601.0" y="1805.0" width="125.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31321_di" bpmnElement="flow31321" bioc:stroke="#2fa99b" color:border-color="#2fa99b"><di:waypoint x="1781.0" y="1840.0" /><di:waypoint x="1781.0" y="1938.0" /><di:waypoint x="1336" y="1938.0" /><di:waypoint x="1336" y="300.01" /><bpmndi:BPMNLabel><dc:Bounds x="1781.0" y="1845.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31316_di" bpmnElement="flow31316" bioc:stroke="#e7411c" color:border-color="#e7411c"><di:waypoint x="1241.0" y="175.0" /><di:waypoint x="1241.0" y="273.0" /><di:waypoint x="1336" y="273.0" /><di:waypoint x="1336" y="300.01" /><bpmndi:BPMNLabel><dc:Bounds x="1241.0" y="180.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31429_di" bpmnElement="flow31429"><di:waypoint x="521.0" y="25.0" /><di:waypoint x="521.0" y="1950.0" /><di:waypoint x="646" y="1950.0" /><bpmndi:BPMNLabel><dc:Bounds x="521.0" y="1955.0" width="125.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="flow31442_di" bpmnElement="flow31442" bioc:stroke="#ae68a9" color:border-color="#ae68a9"><di:waypoint x="701.0" y="1990.0" /><di:waypoint x="701.0" y="2092.0" /><di:waypoint x="976" y="2092.0" /><di:waypoint x="976" y="150.01" /><bpmndi:BPMNLabel><dc:Bounds x="701.0" y="1995.0" width="0.0" height="14" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge></bpmndi:BPMNPlane> </bpmndi:BPMNDiagram></bpmn:definitions>]]></field>
3643
+ <field name="can_update_pod_supply_state">True</field>
3644
+ <field name="show_invoice_tab">False</field>
3645
+ <field name="use_sla">False</field>
3646
+ <field name="wf_code">CC01</field>
3647
+ </record>
3648
+ <record id="symple_triplet_phase_A1001___Creazione_Case_di_Risoluzione_Contrattuale_Automatica" model="symple.triplet.phase">
3649
+ <field name="active">True</field>
3650
+ <field name="child_case">False</field>
3651
+ <field name="code"># Available variables:
3652
+ # - case_id: the case that just reached this phase
3653
+ # - request: allows you to make HTTP requests (method, url, headers, data)
3654
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
3655
+ # - json_load: allows you to use JSON.load to convert a json into an object
3656
+ # - env: Odoo Environment on which the action is triggered
3657
+ # - time, datetime, dateutil, timezone: useful Python libraries
3658
+ # - float_compare: Odoo function to compare floats based on specific precisions
3659
+ # - ValidationError: Warning Exception to use with raise
3660
+ # - Command: x2Many commands namespace
3661
+ # - OrderedDict: ordered dictionaries
3662
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
3663
+ # (line = case id, func = phase name)
3664
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
3665
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
3666
+ # To return a result, assign: result = {...}
3667
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
3668
+ # phase result will not be set.
3669
+
3670
+
3671
+ logs = []
3672
+
3673
+
3674
+ def main():
3675
+ if not case_id.service_point_ids:
3676
+ raise ValidationError(
3677
+ "Il case è stato aperto senza service point"
3678
+ )
3679
+
3680
+ sp = case_id.service_point_ids[0]
3681
+
3682
+ if sp.state != "active":
3683
+ raise ValidationError("Il service point non è in stato attivo.")
3684
+
3685
+ return "OK"
3686
+
3687
+
3688
+ try:
3689
+ result = main()
3690
+
3691
+
3692
+ except Exception as e:
3693
+ logs.append({"message": str(e), "traceback": format_exc()})
3694
+ case_id.write(
3695
+ {"error_message": "Errore durante l'esecuzione della fase: {}".format(str(e))}
3696
+ )
3697
+
3698
+ if logs:
3699
+ log(json_dumps(logs))</field>
3700
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
3701
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
3702
+ <field name="is_a_postalizer_phase">False</field>
3703
+ <field name="is_compute_refund">False</field>
3704
+ <field name="is_dl">False</field>
3705
+ <field name="is_needs_child_case">False</field>
3706
+ <field name="is_pick_refund_template">False</field>
3707
+ <field name="is_process_managed">False</field>
3708
+ <field name="is_quote_accepted">False</field>
3709
+ <field name="is_quote_sent">False</field>
3710
+ <field name="is_timeout">False</field>
3711
+ <field name="is_voidable">False</field>
3712
+ <field name="name">A1001 – Creazione Case di Risoluzione Contrattuale Automatica</field>
3713
+ <field name="set_result_automatically">from_code</field>
3714
+ </record>
3715
+ <record id="symple_triplet_phase_result_C2252_-_Apertura_Case_Automatica_C" model="symple.triplet.phase.result">
3716
+ <field name="active">True</field>
3717
+ <field name="has_message">False</field>
3718
+ <field name="is_annulment">False</field>
3719
+ <field name="is_dl_solicitation_result">False</field>
3720
+ <field name="is_hidden">False</field>
3721
+ <field name="is_quote_expired">False</field>
3722
+ <field name="name">C2252 - Apertura Case Automatica</field>
3723
+ <field name="next_phase_id" ref="symple_triplet_phase_A1001___Creazione_Case_di_Risoluzione_Contrattuale_Automatica"/>
3724
+ <field name="state_code">C</field>
3725
+ <field name="wizard_result">SUCCESS</field>
3726
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1590_-_Verifica_Tipologia_Apertura_Case')])]"/>
3727
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
3728
+ </record>
3729
+ <record id="symple_triplet_phase_result_C1401_-_Risoluzione_contrattuale_OK_E-CC01-0001-03" model="symple.triplet.phase.result">
3730
+ <field name="active">True</field>
3731
+ <field name="has_message">False</field>
3732
+ <field name="is_annulment">False</field>
3733
+ <field name="is_dl_solicitation_result">False</field>
3734
+ <field name="is_hidden">False</field>
3735
+ <field name="is_quote_expired">False</field>
3736
+ <field name="name">C1401 - Risoluzione contrattuale OK</field>
3737
+ <field name="next_phase_id" ref="symple_triplet_phase_A1709_-_verifica_compatibilit_"/>
3738
+ <field name="state_code">E-CC01-0001-03</field>
3739
+ <field name="wizard_result">SUCCESS</field>
3740
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1001___Creazione_Case_di_Risoluzione_Contrattuale_Automatica')])]"/>
3741
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
3742
+ </record>
3743
+ <record id="symple_triplet_phase_A1556_-_Verica_commodity" model="symple.triplet.phase">
3744
+ <field name="active">True</field>
3745
+ <field name="child_case">False</field>
3746
+ <field name="code"># Available variables:
3747
+ # - case_id: the case that just reached this phase
3748
+ # - request: allows you to make HTTP requests (method, url, headers, data)
3749
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
3750
+ # - json_load: allows you to use JSON.load to convert a json into an object
3751
+ # - env: Odoo Environment on which the action is triggered
3752
+ # - time, datetime, dateutil, timezone: useful Python libraries
3753
+ # - float_compare: Odoo function to compare floats based on specific precisions
3754
+ # - ValidationError: Warning Exception to use with raise
3755
+ # - Command: x2Many commands namespace
3756
+ # - OrderedDict: ordered dictionaries
3757
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
3758
+ # (line = case id, func = phase name)
3759
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
3760
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
3761
+ # To return a result, assign: result = {...}
3762
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
3763
+ # phase result will not be set.
3764
+
3765
+ sp = case_id.service_point_ids[0]
3766
+
3767
+ if sp.pod_id:
3768
+ result = "ELE"
3769
+ elif sp.pdr_id:
3770
+ result= "GAS"</field>
3771
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
3772
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
3773
+ <field name="is_a_postalizer_phase">False</field>
3774
+ <field name="is_compute_refund">False</field>
3775
+ <field name="is_dl">False</field>
3776
+ <field name="is_needs_child_case">False</field>
3777
+ <field name="is_pick_refund_template">False</field>
3778
+ <field name="is_process_managed">False</field>
3779
+ <field name="is_quote_accepted">False</field>
3780
+ <field name="is_quote_sent">False</field>
3781
+ <field name="is_timeout">False</field>
3782
+ <field name="is_voidable">False</field>
3783
+ <field name="name">A1556 - Verica commodity</field>
3784
+ <field name="set_result_automatically">from_code</field>
3785
+ </record>
3786
+ <record id="symple_triplet_phase_result_C1037_-_Ammissibilit__OK_E-CC01-0025" model="symple.triplet.phase.result">
3787
+ <field name="active">True</field>
3788
+ <field name="has_message">False</field>
3789
+ <field name="is_annulment">False</field>
3790
+ <field name="is_dl_solicitation_result">False</field>
3791
+ <field name="is_hidden">False</field>
3792
+ <field name="is_quote_expired">False</field>
3793
+ <field name="name">C1037 - Ammissibilità OK</field>
3794
+ <field name="next_phase_id" ref="symple_triplet_phase_A1556_-_Verica_commodity"/>
3795
+ <field name="state_code">E-CC01-0025</field>
3796
+ <field name="wizard_result">OK-100</field>
3797
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A0816_-_In_attesa_esito_ammissibilit_')])]"/>
3798
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','OK-100')])" />
3799
+ </record>
3800
+ <record id="symple_triplet_phase_result_C2222___Commodity_Gas_E-CC01-0001-04" model="symple.triplet.phase.result">
3801
+ <field name="active">True</field>
3802
+ <field name="has_message">False</field>
3803
+ <field name="is_annulment">False</field>
3804
+ <field name="is_dl_solicitation_result">False</field>
3805
+ <field name="is_hidden">False</field>
3806
+ <field name="is_quote_expired">False</field>
3807
+ <field name="name">C2222 – Commodity Gas</field>
3808
+ <field name="next_phase_id" ref="symple_triplet_phase_A1004_-_Verifica_RCU___Data_decorrenza"/>
3809
+ <field name="state_code">E-CC01-0001-04</field>
3810
+ <field name="wizard_result">SUCCESS</field>
3811
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1556_-_Verica_commodity')])]"/>
3812
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
3813
+ </record>
3814
+ <record id="symple_triplet_phase_A2598_-_Invio_Pec" model="symple.triplet.phase">
3815
+ <field name="active">True</field>
3816
+ <field name="automatic_template_id" model="mail.template" eval="obj().search([('name','=','TEST PEC TG (copia)')])" />
3817
+ <field name="child_case">False</field>
3818
+ <field name="code"># Available variables:
3819
+ # - case_id: the case that just reached this phase
3820
+ # - request: allows you to make HTTP requests (method, url, headers, data)
3821
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
3822
+ # - json_load: allows you to use JSON.load to convert a json into an object
3823
+ # - env: Odoo Environment on which the action is triggered
3824
+ # - time, datetime, dateutil, timezone: useful Python libraries
3825
+ # - float_compare: Odoo function to compare floats based on specific precisions
3826
+ # - ValidationError: Warning Exception to use with raise
3827
+ # - Command: x2Many commands namespace
3828
+ # - OrderedDict: ordered dictionaries
3829
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
3830
+ # (line = case id, func = phase name)
3831
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
3832
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
3833
+ # To return a result, assign: result = {...}
3834
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
3835
+ # phase result will not be set.
3836
+
3837
+
3838
+
3839
+ </field>
3840
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','Customer Care')])" />
3841
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
3842
+ <field name="is_a_postalizer_phase">False</field>
3843
+ <field name="is_compute_refund">False</field>
3844
+ <field name="is_dl">False</field>
3845
+ <field name="is_mail_managed">manually</field>
3846
+ <field name="is_needs_child_case">False</field>
3847
+ <field name="is_pick_refund_template">False</field>
3848
+ <field name="is_process_managed">True</field>
3849
+ <field name="is_quote_accepted">False</field>
3850
+ <field name="is_quote_sent">False</field>
3851
+ <field name="is_timeout">False</field>
3852
+ <field name="is_voidable">False</field>
3853
+ <field name="name">A2598 - Invio Pec</field>
3854
+ <field name="set_result_automatically">from_email</field>
3855
+ </record>
3856
+ <record id="symple_triplet_phase_result_C1019_-_Inviata_E-CC01-0001-05" model="symple.triplet.phase.result">
3857
+ <field name="active">True</field>
3858
+ <field name="has_message">False</field>
3859
+ <field name="is_annulment">False</field>
3860
+ <field name="is_dl_solicitation_result">False</field>
3861
+ <field name="is_hidden">False</field>
3862
+ <field name="is_quote_expired">False</field>
3863
+ <field name="name">C1019 - Inviata</field>
3864
+ <field name="next_phase_id" ref="symple_triplet_phase_A1004_-_Verifica_RCU___Data_decorrenza"/>
3865
+ <field name="state_code">E-CC01-0001-05</field>
3866
+ <field name="wizard_result">SUCCESS</field>
3867
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A2598_-_Invio_Pec')])]"/>
3868
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
3869
+ </record>
3870
+ <record id="symple_triplet_phase_result_C2221_-_Commodity_Elettricit__E-CC01-0001-06" model="symple.triplet.phase.result">
3871
+ <field name="active">True</field>
3872
+ <field name="has_message">False</field>
3873
+ <field name="is_annulment">False</field>
3874
+ <field name="is_dl_solicitation_result">False</field>
3875
+ <field name="is_hidden">False</field>
3876
+ <field name="is_quote_expired">False</field>
3877
+ <field name="name">C2221 - Commodity Elettricità</field>
3878
+ <field name="next_phase_id" ref="symple_triplet_phase_A2598_-_Invio_Pec"/>
3879
+ <field name="state_code">E-CC01-0001-06</field>
3880
+ <field name="wizard_result">SUCCESS</field>
3881
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1556_-_Verica_commodity')])]"/>
3882
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
3883
+ </record>
3884
+ <record id="symple_triplet_phase_A2338_-_Inserimento_Pratica" model="symple.triplet.phase">
3885
+ <field name="active">True</field>
3886
+ <field name="child_case">False</field>
3887
+ <field name="code"># Available variables:
3888
+ # - case_id: the case that just reached this phase
3889
+ # - request: allows you to make HTTP requests (method, url, headers, data)
3890
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
3891
+ # - json_load: allows you to use JSON.load to convert a json into an object
3892
+ # - env: Odoo Environment on which the action is triggered
3893
+ # - time, datetime, dateutil, timezone: useful Python libraries
3894
+ # - float_compare: Odoo function to compare floats based on specific precisions
3895
+ # - ValidationError: Warning Exception to use with raise
3896
+ # - Command: x2Many commands namespace
3897
+ # - OrderedDict: ordered dictionaries
3898
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
3899
+ # (line = case id, func = phase name)
3900
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
3901
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
3902
+ # To return a result, assign: result = {...}
3903
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
3904
+ # phase result will not be set.
3905
+
3906
+
3907
+
3908
+ </field>
3909
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
3910
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
3911
+ <field name="is_a_postalizer_phase">False</field>
3912
+ <field name="is_compute_refund">False</field>
3913
+ <field name="is_dl">False</field>
3914
+ <field name="is_needs_child_case">False</field>
3915
+ <field name="is_pick_refund_template">False</field>
3916
+ <field name="is_process_managed">False</field>
3917
+ <field name="is_quote_accepted">False</field>
3918
+ <field name="is_quote_sent">False</field>
3919
+ <field name="is_timeout">False</field>
3920
+ <field name="is_voidable">False</field>
3921
+ <field name="name">A2338 - Inserimento Pratica</field>
3922
+ </record>
3923
+ <record id="symple_triplet_phase_result_C2224_-_OK_-_Ammissibilit__Hub_E-CC01-0013" model="symple.triplet.phase.result">
3924
+ <field name="active">True</field>
3925
+ <field name="has_message">False</field>
3926
+ <field name="is_annulment">False</field>
3927
+ <field name="is_dl_solicitation_result">False</field>
3928
+ <field name="is_hidden">False</field>
3929
+ <field name="is_quote_expired">False</field>
3930
+ <field name="name">C2224 - OK - Ammissibilità Hub</field>
3931
+ <field name="next_phase_id" ref="symple_triplet_phase_A2338_-_Inserimento_Pratica"/>
3932
+ <field name="state_code">E-CC01-0013</field>
3933
+ <field name="wizard_result">OK-HUB</field>
3934
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1715_-_In_attesa_check_IFS')])]"/>
3935
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','OK-HUB')])" />
3936
+ </record>
3937
+ <record id="symple_triplet_phase_result_C3118_-_KO_AtoA_pdc_E-CC01-0014" model="symple.triplet.phase.result">
3938
+ <field name="active">True</field>
3939
+ <field name="has_message">False</field>
3940
+ <field name="is_annulment">False</field>
3941
+ <field name="is_dl_solicitation_result">False</field>
3942
+ <field name="is_hidden">False</field>
3943
+ <field name="is_quote_expired">False</field>
3944
+ <field name="name">C3118 - KO AtoA/pdc</field>
3945
+ <field name="next_phase_id" ref="symple_triplet_phase_A2558_-_verifica_avvio_gestione_manuale"/>
3946
+ <field name="state_code">E-CC01-0014</field>
3947
+ <field name="wizard_result">KO-PDC-A2A</field>
3948
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A2338_-_Inserimento_Pratica')])]"/>
3949
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','KO-PDC-A2A')])" />
3950
+ </record>
3951
+ <record id="symple_triplet_phase_result_C3117_-_OK_pratica_inserita_E-CC01-00081" model="symple.triplet.phase.result">
3952
+ <field name="active">True</field>
3953
+ <field name="has_message">False</field>
3954
+ <field name="is_annulment">False</field>
3955
+ <field name="is_dl_solicitation_result">False</field>
3956
+ <field name="is_hidden">False</field>
3957
+ <field name="is_quote_expired">False</field>
3958
+ <field name="name">C3117 - OK pratica inserita</field>
3959
+ <field name="next_phase_id" ref="symple_triplet_phase_A0816_-_In_attesa_esito_ammissibilit_"/>
3960
+ <field name="state_code">E-CC01-00081</field>
3961
+ <field name="wizard_result">SUCCESS</field>
3962
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A2338_-_Inserimento_Pratica')])]"/>
3963
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
3964
+ </record>
3965
+ <record id="symple_triplet_phase_A2561_-_verifica_stato_invio_pratica_da_annullare" model="symple.triplet.phase">
3966
+ <field name="active">True</field>
3967
+ <field name="child_case">False</field>
3968
+ <field name="code"># Available variables:
3969
+ # - case_id: the case that just reached this phase
3970
+ # - request: allows you to make HTTP requests (method, url, headers, data)
3971
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
3972
+ # - json_load: allows you to use JSON.load to convert a json into an object
3973
+ # - env: Odoo Environment on which the action is triggered
3974
+ # - time, datetime, dateutil, timezone: useful Python libraries
3975
+ # - float_compare: Odoo function to compare floats based on specific precisions
3976
+ # - ValidationError: Warning Exception to use with raise
3977
+ # - Command: x2Many commands namespace
3978
+ # - OrderedDict: ordered dictionaries
3979
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
3980
+ # (line = case id, func = phase name)
3981
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
3982
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
3983
+ # To return a result, assign: result = {...}
3984
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
3985
+ # phase result will not be set.
3986
+
3987
+
3988
+
3989
+ </field>
3990
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
3991
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
3992
+ <field name="is_a_postalizer_phase">False</field>
3993
+ <field name="is_compute_refund">False</field>
3994
+ <field name="is_dl">False</field>
3995
+ <field name="is_needs_child_case">False</field>
3996
+ <field name="is_pick_refund_template">False</field>
3997
+ <field name="is_process_managed">False</field>
3998
+ <field name="is_quote_accepted">False</field>
3999
+ <field name="is_quote_sent">False</field>
4000
+ <field name="is_timeout">False</field>
4001
+ <field name="is_voidable">False</field>
4002
+ <field name="name">A2561 - verifica stato invio pratica da annullare</field>
4003
+ </record>
4004
+ <record id="symple_triplet_phase_result_C2475_-_OK_-_Ammissibilit__Annullamento_Hub_E-CC01-0042" model="symple.triplet.phase.result">
4005
+ <field name="active">True</field>
4006
+ <field name="has_message">False</field>
4007
+ <field name="is_annulment">False</field>
4008
+ <field name="is_dl_solicitation_result">False</field>
4009
+ <field name="is_hidden">False</field>
4010
+ <field name="is_quote_expired">False</field>
4011
+ <field name="name">C2475 - OK - Ammissibilità Annullamento Hub</field>
4012
+ <field name="next_phase_id" ref="symple_triplet_phase_A2561_-_verifica_stato_invio_pratica_da_annullare"/>
4013
+ <field name="state_code">E-CC01-0042</field>
4014
+ <field name="wizard_result">OK-HUB-ANN</field>
4015
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A1767_-_In_attesa_check_IFS_Annullamento')])]"/>
4016
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','OK-HUB-ANN')])" />
4017
+ </record>
4018
+ <record id="symple_triplet_phase_result_C2599_-_annullamento_confermato_E-CC01-00084" model="symple.triplet.phase.result">
4019
+ <field name="active">True</field>
4020
+ <field name="has_message">False</field>
4021
+ <field name="is_annulment">False</field>
4022
+ <field name="is_dl_solicitation_result">False</field>
4023
+ <field name="is_hidden">False</field>
4024
+ <field name="is_quote_expired">False</field>
4025
+ <field name="name">C2599 - annullamento confermato</field>
4026
+ <field name="next_phase_id" ref="symple_triplet_phase_A1833_-_Case_annullato_da_APR"/>
4027
+ <field name="state_code">E-CC01-00084</field>
4028
+ <field name="wizard_result">SUCCESS</field>
4029
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A2561_-_verifica_stato_invio_pratica_da_annullare')])]"/>
4030
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
4031
+ </record>
4032
+ <record id="symple_triplet_phase_A0832_-_Invio_Richiesta_Annullamento" model="symple.triplet.phase">
4033
+ <field name="active">True</field>
4034
+ <field name="child_case">False</field>
4035
+ <field name="code"># Available variables:
4036
+ # - case_id: the case that just reached this phase
4037
+ # - request: allows you to make HTTP requests (method, url, headers, data)
4038
+ # - json_dumps: allows you to use JSON.dumps to convert an object into a json
4039
+ # - json_load: allows you to use JSON.load to convert a json into an object
4040
+ # - env: Odoo Environment on which the action is triggered
4041
+ # - time, datetime, dateutil, timezone: useful Python libraries
4042
+ # - float_compare: Odoo function to compare floats based on specific precisions
4043
+ # - ValidationError: Warning Exception to use with raise
4044
+ # - Command: x2Many commands namespace
4045
+ # - OrderedDict: ordered dictionaries
4046
+ # - log: log(message, level='info'): logging function to record debug information in ir.logging table
4047
+ # (line = case id, func = phase name)
4048
+ # - format_exc: forwarded from traceback.format_exc - returns str stack trace of last exception thrown
4049
+ # - first: forwarded from odoo.fields.first - safely gets first element of recordset
4050
+ # To return a result, assign: result = {...}
4051
+ # WARNING: if return = False or return value is not in the result table or no result is returned at all,
4052
+ # phase result will not be set.
4053
+
4054
+
4055
+
4056
+ </field>
4057
+ <field name="helpdesk_group_id" model="helpdesk.team" eval="obj().search([('name','=','SYSTEM-Sorgenia')])" />
4058
+ <field name="helpdesk_stage_id" model="helpdesk.stage" eval="obj().search([('name','=','In Progress')])" />
4059
+ <field name="is_a_postalizer_phase">False</field>
4060
+ <field name="is_compute_refund">False</field>
4061
+ <field name="is_dl">False</field>
4062
+ <field name="is_needs_child_case">False</field>
4063
+ <field name="is_pick_refund_template">False</field>
4064
+ <field name="is_process_managed">False</field>
4065
+ <field name="is_quote_accepted">False</field>
4066
+ <field name="is_quote_sent">False</field>
4067
+ <field name="is_timeout">False</field>
4068
+ <field name="is_voidable">False</field>
4069
+ <field name="name">A0832 - Invio Richiesta Annullamento</field>
4070
+ </record>
4071
+ <record id="symple_triplet_phase_result_C3118_-_KO_AtoA_pdc_E-CC01-0044" model="symple.triplet.phase.result">
4072
+ <field name="active">True</field>
4073
+ <field name="has_message">False</field>
4074
+ <field name="is_annulment">False</field>
4075
+ <field name="is_dl_solicitation_result">False</field>
4076
+ <field name="is_hidden">False</field>
4077
+ <field name="is_quote_expired">False</field>
4078
+ <field name="name">C3118 - KO AtoA/pdc</field>
4079
+ <field name="next_phase_id" ref="symple_triplet_phase_A2562_-_verifica_avvio_gestione_manuale_annullamento"/>
4080
+ <field name="state_code">E-CC01-0044</field>
4081
+ <field name="wizard_result">SUCCESS</field>
4082
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A0832_-_Invio_Richiesta_Annullamento')])]"/>
4083
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
4084
+ </record>
4085
+ <record id="symple_triplet_phase_result_C3120_-_annullamento_da_gestire_E-CC01-00083" model="symple.triplet.phase.result">
4086
+ <field name="active">True</field>
4087
+ <field name="has_message">False</field>
4088
+ <field name="is_annulment">False</field>
4089
+ <field name="is_dl_solicitation_result">False</field>
4090
+ <field name="is_hidden">False</field>
4091
+ <field name="is_quote_expired">False</field>
4092
+ <field name="name">C3120 - annullamento da gestire</field>
4093
+ <field name="next_phase_id" ref="symple_triplet_phase_A0832_-_Invio_Richiesta_Annullamento"/>
4094
+ <field name="state_code">E-CC01-00083</field>
4095
+ <field name="wizard_result">SUCCESS</field>
4096
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A2561_-_verifica_stato_invio_pratica_da_annullare')])]"/>
4097
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
4098
+ </record>
4099
+ <record id="symple_triplet_phase_result_C2875_-_OK_-_Inviato_Annullamento_al_SII_E-CC01-00085" model="symple.triplet.phase.result">
4100
+ <field name="active">True</field>
4101
+ <field name="has_message">False</field>
4102
+ <field name="is_annulment">False</field>
4103
+ <field name="is_dl_solicitation_result">False</field>
4104
+ <field name="is_hidden">False</field>
4105
+ <field name="is_quote_expired">False</field>
4106
+ <field name="name">C2875 - OK - Inviato Annullamento al SII</field>
4107
+ <field name="next_phase_id" ref="symple_triplet_phase_A0833_-_In_attesa_ricezione_Ammissibilit__Annullamento"/>
4108
+ <field name="state_code">E-CC01-00085</field>
4109
+ <field name="wizard_result">SUCCESS</field>
4110
+ <field name="starting_phase_ids" model="symple.triplet.phase" eval="[(6, 0, [ref('symple_triplet_phase_A0832_-_Invio_Richiesta_Annullamento')])]"/>
4111
+ <field name="result_type_id" model="result.type" eval="obj().search([('name','=','Success')])" />
4112
+ </record>
4113
+ <record id="result_code_configurator_A1672_-_Recupero_dati_a_CRM_OK" model="result.code.configurator">
4114
+ <field name="code_phase_id" ref="symple_triplet_phase_A1672_-_Recupero_dati_a_CRM"/>
4115
+ <field name="result_value">OK</field>
4116
+ <field name="triplet_phase_result_id" ref="symple_triplet_phase_result_C2365_-_Recupero_Dati_OK_E-CC01-0008"/>
4117
+ </record>
4118
+ <record id="result_code_configurator_A1559_-_Invio_alla_Market_Communication_OK" model="result.code.configurator">
4119
+ <field name="code_phase_id" ref="symple_triplet_phase_A1559_-_Invio_alla_Market_Communication"/>
4120
+ <field name="result_value">OK</field>
4121
+ <field name="triplet_phase_result_id" ref="symple_triplet_phase_result_C1019_-_Inviata_E-CC01-0011"/>
4122
+ </record>
4123
+ <record id="result_code_configurator_A1590_-_Verifica_Tipologia_Apertura_Case_AUTOMATICO" model="result.code.configurator">
4124
+ <field name="code_phase_id" ref="symple_triplet_phase_A1590_-_Verifica_Tipologia_Apertura_Case"/>
4125
+ <field name="result_value">AUTOMATICO</field>
4126
+ <field name="triplet_phase_result_id" ref="symple_triplet_phase_result_C2252_-_Apertura_Case_Automatica_C"/>
4127
+ </record>
4128
+ <record id="result_code_configurator_A1590_-_Verifica_Tipologia_Apertura_Case_MANUALE" model="result.code.configurator">
4129
+ <field name="code_phase_id" ref="symple_triplet_phase_A1590_-_Verifica_Tipologia_Apertura_Case"/>
4130
+ <field name="result_value">MANUALE</field>
4131
+ <field name="triplet_phase_result_id" ref="symple_triplet_phase_result_C2251_-_Apertura_Case_Manuale_E-CC01-0001-01"/>
4132
+ </record>
4133
+ <record id="result_code_configurator_A1577_-_Chiusura_Ordine_CRM_OK" model="result.code.configurator">
4134
+ <field name="code_phase_id" ref="symple_triplet_phase_A1577_-_Chiusura_Ordine_CRM"/>
4135
+ <field name="result_value">OK</field>
4136
+ <field name="triplet_phase_result_id" ref="symple_triplet_phase_result_C2242_-_Chiusura_Ordine_OK_E-CC01-0032"/>
4137
+ </record>
4138
+ <record id="result_code_configurator_A2398_-_Invio_ordine_CRM_OK" model="result.code.configurator">
4139
+ <field name="code_phase_id" ref="symple_triplet_phase_A2398_-_Invio_ordine_CRM"/>
4140
+ <field name="result_value">OK</field>
4141
+ <field name="triplet_phase_result_id" ref="symple_triplet_phase_result_C1900_-_Integrazione_M2C_E-CC01-0035"/>
4142
+ </record>
4143
+ <record id="result_code_configurator_A0802_-_Integrazione_M2C_OK" model="result.code.configurator">
4144
+ <field name="code_phase_id" ref="symple_triplet_phase_A0802_-_Integrazione_M2C"/>
4145
+ <field name="result_value">OK</field>
4146
+ <field name="triplet_phase_result_id" ref="symple_triplet_phase_result_C1904_-_In_attesa_esito_M2C_E-CC01-0036"/>
4147
+ </record>
4148
+ <record id="result_code_configurator_A2142_-_Invio_alla_marketcom_annullamento_forzato_OK" model="result.code.configurator">
4149
+ <field name="code_phase_id" ref="symple_triplet_phase_A2142_-_Invio_alla_marketcom_annullamento_forzato"/>
4150
+ <field name="result_value">OK</field>
4151
+ <field name="triplet_phase_result_id" ref="symple_triplet_phase_result_C1019_-_Inviata_E-CC01-0053"/>
4152
+ </record>
4153
+ <record id="result_code_configurator_A1595_-_Invio_Annullamento_alla_Market_Communication_OK" model="result.code.configurator">
4154
+ <field name="code_phase_id" ref="symple_triplet_phase_A1595_-_Invio_Annullamento_alla_Market_Communication"/>
4155
+ <field name="result_value">OK</field>
4156
+ <field name="triplet_phase_result_id" ref="symple_triplet_phase_result_C1019_-_Inviata_E-CC01-0041"/>
4157
+ </record>
4158
+ <record id="result_code_configurator_A1836_-_Apertura_case_figlio_OK" model="result.code.configurator">
4159
+ <field name="code_phase_id" ref="symple_triplet_phase_A1836_-_Apertura_case_figlio"/>
4160
+ <field name="result_value">OK</field>
4161
+ <field name="triplet_phase_result_id" ref="symple_triplet_phase_result_C2550_-_case_creato_E-CC01-0040"/>
4162
+ </record>
4163
+ <record id="result_code_configurator_A1556_-_Verica_commodity_ELE" model="result.code.configurator">
4164
+ <field name="code_phase_id" ref="symple_triplet_phase_A1556_-_Verica_commodity"/>
4165
+ <field name="result_value">ELE</field>
4166
+ <field name="triplet_phase_result_id" ref="symple_triplet_phase_result_C2221_-_Commodity_Elettricit__E-CC01-0001-06"/>
4167
+ </record>
4168
+ <record id="result_code_configurator_A1556_-_Verica_commodity_GAS" model="result.code.configurator">
4169
+ <field name="code_phase_id" ref="symple_triplet_phase_A1556_-_Verica_commodity"/>
4170
+ <field name="result_value">GAS</field>
4171
+ <field name="triplet_phase_result_id" ref="symple_triplet_phase_result_C2222___Commodity_Gas_E-CC01-0001-04"/>
4172
+ </record>
4173
+ <record id="result_code_configurator_A1001___Creazione_Case_di_Risoluzione_Contrattuale_Automatica_OK" model="result.code.configurator">
4174
+ <field name="code_phase_id" ref="symple_triplet_phase_A1001___Creazione_Case_di_Risoluzione_Contrattuale_Automatica"/>
4175
+ <field name="result_value">OK</field>
4176
+ <field name="triplet_phase_result_id" ref="symple_triplet_phase_result_C1401_-_Risoluzione_contrattuale_OK_E-CC01-0001-03"/>
4177
+ </record>
4178
+ <record id="result_code_configurator_A1709_-_verifica_compatibilit__KO" model="result.code.configurator">
4179
+ <field name="code_phase_id" ref="symple_triplet_phase_A1709_-_verifica_compatibilit_"/>
4180
+ <field name="result_value">KO</field>
4181
+ <field name="triplet_phase_result_id" ref="symple_triplet_phase_result_C404_-_KO_-_Incompatibile_E-CC01-0003"/>
4182
+ </record>
4183
+ <record id="result_code_configurator_A1709_-_verifica_compatibilit__OK" model="result.code.configurator">
4184
+ <field name="code_phase_id" ref="symple_triplet_phase_A1709_-_verifica_compatibilit_"/>
4185
+ <field name="result_value">OK</field>
4186
+ <field name="triplet_phase_result_id" ref="symple_triplet_phase_result_C2654_-_Processo_Compatibile_E-CC01-0004"/>
4187
+ </record>
4188
+ <record id="result_code_configurator_A1709_-_verifica_compatibilit__PARTIAL_KO" model="result.code.configurator">
4189
+ <field name="code_phase_id" ref="symple_triplet_phase_A1709_-_verifica_compatibilit_"/>
4190
+ <field name="result_value">PARTIAL_KO</field>
4191
+ <field name="triplet_phase_result_id" ref="symple_triplet_phase_result_C2639_-_Incompatibilit__Non_bloccante_E-CC01-0005"/>
4192
+ </record>
4193
+ <record id="result_code_configurator_A2397_-_OK_RCU___verifica_data_decorrenza_RES1" model="result.code.configurator">
4194
+ <field name="code_phase_id" ref="symple_triplet_phase_A2397_-_OK_RCU___verifica_data_decorrenza"/>
4195
+ <field name="result_value">RES1</field>
4196
+ <field name="triplet_phase_result_id" ref="symple_triplet_phase_result_C1936_-_Data_raggiunta_E-CC01-0031"/>
4197
+ </record>
4198
+ <record id="result_code_configurator_A1879_-_Invio_alla_Market_Comm_Forzato_RES1" model="result.code.configurator">
4199
+ <field name="code_phase_id" ref="symple_triplet_phase_A1879_-_Invio_alla_Market_Comm_Forzato"/>
4200
+ <field name="result_value">RES1</field>
4201
+ <field name="triplet_phase_result_id" ref="symple_triplet_phase_result_C1019_-_Inviata_E-CC01-0020"/>
4202
+ </record>
4203
+
4204
+ </data>
4205
+ </odoo>
4206
+
4207
+ Processed_records: 146
4208
+ Managed records: 146