Skip to content

Commit

Permalink
T1061 Migrate group_visit data into website_switzerland module
Browse files Browse the repository at this point in the history
  • Loading branch information
dcruz authored and ecino committed Apr 22, 2024
1 parent 6fb8c1d commit 2d5c32f
Show file tree
Hide file tree
Showing 18 changed files with 1,769 additions and 55 deletions.
Empty file added __init__.py
Empty file.
22 changes: 22 additions & 0 deletions website_event_compassion/migrations/14.0.1.1.0/pre-migrate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
def migrate(cr, version):
cr.execute(
"""
UPDATE ir_model_data
SET module= 'website_switzerland'
WHERE module = 'website_event_compassion'
AND (model IN ('mail.template', 'partner.communication.config',
'event.registration.task', 'event.type.mail')
OR name like 'stage_group_%'
OR name = 'event_type_group_visit'
OR model like 'survey.%'
)
"""
)
# Force module install
cr.execute(
"""
UPDATE ir_module_module
SET state = 'to install'
WHERE name = 'website_switzerland'
"""
)
7 changes: 7 additions & 0 deletions website_switzerland/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,15 @@
"theme_compassion",
"partner_communication_switzerland",
"website_crm_request",
"website_event_compassion",
],
"data": [
"data/group_visit_emails.xml",
"data/communication_config.xml",
"data/event_type_mail.xml",
"data/event_registration_stage.xml",
"data/event_registration_task.xml",
"data/survey.xml",
"data/res_lang.xml",
"data/website_rewrite.xml",
"templates/footer.xml",
Expand Down
226 changes: 226 additions & 0 deletions website_switzerland/data/communication_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
<odoo>
<data noupdate="1">
<!-- Group visit e-mails -->
<record
id="group_visit_step1_config"
model="partner.communication.config"
>
<field
name="name"
>Group visit: step1 registration confirmation</field>
<field name="send_mode">auto_digital</field>
<field name="email_template_id" ref="group_visit_step1_email" />
<field
name="report_id"
ref="partner_communication.report_a4_communication"
/>
<field
name="model_id"
ref="website_event_compassion.model_event_registration"
/>
<field name="user_id" search="[('login', 'like', 'nhanggi')]" />
</record>
<record
id="group_visit_step2_config"
model="partner.communication.config"
>
<field name="name">Group visit: step2 confirmation</field>
<field name="send_mode">auto_digital</field>
<field name="email_template_id" ref="group_visit_step2_email" />
<field
name="report_id"
ref="partner_communication.report_a4_communication"
/>
<field
name="model_id"
ref="website_event_compassion.model_event_registration"
/>
<field name="user_id" search="[('login', 'like', 'nhanggi')]" />
<field
name="attachments_function"
>get_trip_down_payment_attachment</field>
</record>
<record
id="group_visit_step3_config"
model="partner.communication.config"
>
<field name="name">Group visit: step3 confirmation</field>
<field name="send_mode">auto_digital</field>
<field name="email_template_id" ref="group_visit_step3_email" />
<field
name="report_id"
ref="partner_communication.report_a4_communication"
/>
<field
name="model_id"
ref="website_event_compassion.model_event_registration"
/>
<field name="user_id" search="[('login', 'like', 'nhanggi')]" />
</record>
<record
id="group_visit_medical_survey_config"
model="partner.communication.config"
>
<field name="name">Group visit: medical survey invitation</field>
<field name="send_mode">auto_digital</field>
<field
name="email_template_id"
ref="group_visit_medical_survey_email"
/>
<field
name="report_id"
ref="partner_communication.report_a4_communication"
/>
<field
name="model_id"
ref="website_event_compassion.model_event_registration"
/>
<field name="user_id" search="[('login', 'like', 'nhanggi')]" />
</record>
<record
id="group_visit_medical_discharge_config"
model="partner.communication.config"
>
<field name="name">Group visit: medical discharge request</field>
<field name="send_mode">digital</field>
<field
name="email_template_id"
ref="group_visit_medical_discharge_email"
/>
<field
name="report_id"
ref="partner_communication.report_a4_communication"
/>
<field
name="model_id"
ref="website_event_compassion.model_event_registration"
/>
<field name="user_id" search="[('login', 'like', 'nhanggi')]" />
</record>
<record
id="group_visit_travel_documents_config"
model="partner.communication.config"
>
<field name="name">Group visit: travel documents request</field>
<field name="send_mode">auto_digital</field>
<field
name="email_template_id"
ref="group_visit_travel_documents_email"
/>
<field
name="report_id"
ref="partner_communication.report_a4_communication"
/>
<field
name="model_id"
ref="website_event_compassion.model_event_registration"
/>
<field name="user_id" search="[('login', 'like', 'nhanggi')]" />
<field
name="attachments_function"
>get_trip_payment_attachment</field>
</record>
<record
id="group_visit_information_day_config"
model="partner.communication.config"
>
<field name="name">Group visit: info day invitation</field>
<field name="send_mode">auto_digital</field>
<field
name="email_template_id"
ref="group_visit_information_day_email"
/>
<field
name="report_id"
ref="partner_communication.report_a4_communication"
/>
<field
name="model_id"
ref="website_event_compassion.model_event_registration"
/>
<field name="user_id" search="[('login', 'like', 'nhanggi')]" />
</record>
<record
id="group_visit_after_party_config"
model="partner.communication.config"
>
<field name="name">Group visit: after trip party invitation</field>
<field name="send_mode">auto_digital</field>
<field
name="email_template_id"
ref="group_visit_after_trip_party_email"
/>
<field
name="report_id"
ref="partner_communication.report_a4_communication"
/>
<field
name="model_id"
ref="website_event_compassion.model_event_registration"
/>
<field name="user_id" search="[('login', 'like', 'nhanggi')]" />
</record>
<record
id="group_visit_detailed_config"
model="partner.communication.config"
>
<field name="name">Group visit: detailed information</field>
<field name="send_mode">auto_digital</field>
<field
name="email_template_id"
ref="group_visit_detailed_info_email"
/>
<field
name="report_id"
ref="partner_communication.report_a4_communication"
/>
<field
name="model_id"
ref="website_event_compassion.model_event_registration"
/>
<field name="user_id" search="[('login', 'like', 'nhanggi')]" />
</record>
<record
id="group_visit_before_sharing_config"
model="partner.communication.config"
>
<field
name="name"
>Group visit: before trip sharing information</field>
<field name="send_mode">auto_digital</field>
<field
name="email_template_id"
ref="group_visit_before_sharing_email"
/>
<field
name="report_id"
ref="partner_communication.report_a4_communication"
/>
<field
name="model_id"
ref="website_event_compassion.model_event_registration"
/>
<field name="user_id" search="[('login', 'like', 'nhanggi')]" />
</record>
<record
id="group_visit_after_trip_feedback_config"
model="partner.communication.config"
>
<field name="name">Group visit: after trip feedback</field>
<field name="send_mode">auto_digital</field>
<field
name="email_template_id"
ref="group_visit_after_trip_feedback_email"
/>
<field
name="report_id"
ref="partner_communication.report_a4_communication"
/>
<field
name="model_id"
ref="website_event_compassion.model_event_registration"
/>
<field name="user_id" search="[('login', 'like', 'nhanggi')]" />
</record>
</data>
</odoo>
63 changes: 63 additions & 0 deletions website_switzerland/data/event_registration_stage.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data noupdate="1">
<!-- Specific stages for group visit -->
<record id="stage_group_unconfirmed" model="event.registration.stage">
<field name="name">Sign Agreements</field>
<field name="sequence">1</field>
<field name="duration">7</field>
<field name="requirements">
* Sign child protection agreement
* Sign travel agreement
* Send a passport copy
* Send certificate of criminal record
</field>
<field
name="event_type_ids"
eval="[(6, 0, [ref('event_type_group_visit'),
ref('event_type_youth_trip')])]"
/>
</record>
<record id="stage_group_pay" model="event.registration.stage">
<field name="name">Down payment</field>
<field name="sequence">2</field>
<field name="duration">7</field>
<field name="requirements">
* Pay registration down payment fee
</field>
<field
name="event_type_ids"
eval="[(6, 0, [ref('event_type_group_visit'),
ref('event_type_youth_trip')])]"
/>
</record>
<record id="stage_group_medical" model="event.registration.stage">
<field name="name">Medical survey</field>
<field name="sequence">3</field>
<field name="duration">7</field>
<field name="requirements">
* Fill medical survey
* Sign medical discharge if needed
</field>
<field
name="event_type_ids"
eval="[(6, 0, [ref('event_type_group_visit'),
ref('event_type_youth_trip')])]"
/>
</record>
<record id="stage_group_documents" model="event.registration.stage">
<field name="name">Payment</field>
<field name="sequence">4</field>
<field name="duration">7</field>
<field name="requirements">
* Fill urgency contact information
* Pay the whole trip fees
</field>
<field
name="event_type_ids"
eval="[(6, 0, [ref('event_type_group_visit'),
ref('event_type_youth_trip')])]"
/>
</record>
</data>
</odoo>
51 changes: 51 additions & 0 deletions website_switzerland/data/event_registration_task.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data noupdate="1">
<!-- Group visit tasks -->
<record id="task_sign_child_protection" model="event.registration.task">
<field name="name">Sign child protection agreement</field>
<field name="sequence">0</field>
<field name="stage_id" ref="stage_group_unconfirmed" />
</record>
<record id="task_sign_travel" model="event.registration.task">
<field name="name">Sign travel agreement</field>
<field name="sequence">1</field>
<field name="stage_id" ref="stage_group_unconfirmed" />
</record>
<record id="task_passport" model="event.registration.task">
<field name="name">Send a passport copy</field>
<field name="sequence">2</field>
<field name="stage_id" ref="stage_group_unconfirmed" />
</record>
<record id="task_criminal" model="event.registration.task">
<field name="name">Send certificate of criminal record</field>
<field name="sequence">3</field>
<field name="stage_id" ref="stage_group_unconfirmed" />
</record>
<record id="task_urgency_contact" model="event.registration.task">
<field name="name">Fill urgency contact information</field>
<field name="sequence">1</field>
<field name="stage_id" ref="stage_group_unconfirmed" />
</record>
<record id="task_down_payment" model="event.registration.task">
<field name="name">Pay fees</field>
<field name="sequence">0</field>
<field name="stage_id" ref="stage_group_pay" />
</record>
<record id="task_medical_survey" model="event.registration.task">
<field name="name">Fill medical survey</field>
<field name="sequence">0</field>
<field name="stage_id" ref="stage_group_medical" />
</record>
<record id="task_medical_discharge" model="event.registration.task">
<field name="name">Sign medical discharge</field>
<field name="sequence">1</field>
<field name="stage_id" ref="stage_group_medical" />
</record>
<record id="task_full_payment" model="event.registration.task">
<field name="name">Pay the trip</field>
<field name="sequence">2</field>
<field name="stage_id" ref="stage_group_documents" />
</record>
</data>
</odoo>
Loading

0 comments on commit 2d5c32f

Please sign in to comment.