|
| 1 | +<odoo> |
| 2 | + <data> |
| 3 | + <!-- Summary Exchange --> |
| 4 | + <record id="email_template_exchange_validation" model="mail.template"> |
| 5 | + <field name="name">Exchange validation</field> |
| 6 | + <field |
| 7 | + name="model_id" |
| 8 | + ref="beesdoo_shift_swap.model_beesdoo_shift_exchange_request" |
| 9 | + /> |
| 10 | + <field name="auto_delete" eval="False" /> |
| 11 | + <field name="partner_to">${object.worker_id.id}</field> |
| 12 | + <field name="email_cc"> |
| 13 | + ${(object.exchanged_tmpl_dated_id.template_id.super_coop_id or '')} |
| 14 | + </field> |
| 15 | + <field name="subject">Exchange validation</field> |
| 16 | + <field name="body_html"> |
| 17 | + <![CDATA[ |
| 18 | + <div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
| 19 | + Hello ${(object.worker_id.name)}, |
| 20 | + <br/><br/> |
| 21 | + <p> |
| 22 | + You shift exchange has been confirmed. |
| 23 | + </p> |
| 24 | + <p> |
| 25 | + Here is a summary of the exchange : |
| 26 | + <ul> |
| 27 | + <li> |
| 28 | + Your old Shift : ${(object.exchanged_tmpl_dated_id.template_id.name)}, |
| 29 | + ${(object.exchanged_tmpl_dated_id.date.date())}, |
| 30 | + ${(object.exchanged_tmpl_dated_id.template_id.task_type_id.name)} |
| 31 | + </li> |
| 32 | + <li> |
| 33 | + Your new Shift : ${(object.validate_request_id.exchanged_tmpl_dated_id.template_id.name)}, |
| 34 | + ${(object.validate_request_id.exchanged_tmpl_dated_id.date.date())}, |
| 35 | + ${(object.validate_request_id.exchanged_tmpl_dated_id.template_id.task_type_id.name)} |
| 36 | + </li> |
| 37 | + </ul> |
| 38 | + </p> |
| 39 | + <br/><br/> |
| 40 | + Regards, |
| 41 | + </div> |
| 42 | + ]]> |
| 43 | + </field> |
| 44 | + </record> |
| 45 | + |
| 46 | + <!--Send mail to coop same days of the week same hours--> |
| 47 | + <record id="email_template_contact_coop" model="mail.template"> |
| 48 | + <field name="name">Contact Coop Same days of the week same hours</field> |
| 49 | + <field name="model_id" ref="beesdoo_shift_swap.model_res_partner" /> |
| 50 | + <field name="auto_delete" eval="False" /> |
| 51 | + <field name="subject">Exchange request</field> |
| 52 | + <field name="body_html"> |
| 53 | + <![CDATA[ |
| 54 | + <div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
| 55 | + Hello ${ctx.get('worker_id').name}, |
| 56 | + <br/><br/> |
| 57 | + <p> |
| 58 | + A cooperator working on the shift : ${ctx.get('my_tmpl_dated').template_id.name}, ${ctx.get('my_tmpl_dated').date.date()}, ${ctx.get('my_tmpl_dated').template_id.task_type_id.name}<br/> |
| 59 | + would like to exchange his shift with yours : ${ctx.get('asked_tmpl_dated').template_id.name}, ${ctx.get('asked_tmpl_dated').date.date()}, ${ctx.get('asked_tmpl_dated').template_id.task_type_id.name}. |
| 60 | + </p> |
| 61 | + <p> |
| 62 | + If you are willing to help by accepting this exchange, please |
| 63 | + <a href="/my/shift/swaping/${ctx.get('asked_tmpl_dated').template_id.id}/${ctx.get('asked_tmpl_dated').date.strftime('%Y-%m-%d %H:%M:%S')}?from_mail=1"> |
| 64 | + click here |
| 65 | + </a>. |
| 66 | + </p> |
| 67 | + <br/><br/> |
| 68 | + Regards, |
| 69 | + </div> |
| 70 | + ]]> |
| 71 | + </field> |
| 72 | + </record> |
| 73 | + |
| 74 | + <!-- Send mail when match --> |
| 75 | + <record id="email_template_contact_match_coop" model="mail.template"> |
| 76 | + <field name="name">Contact Coop When Match</field> |
| 77 | + <field |
| 78 | + name="model_id" |
| 79 | + ref="beesdoo_shift_swap.model_beesdoo_shift_exchange_request" |
| 80 | + /> |
| 81 | + <field name="auto_delete" eval="False" /> |
| 82 | + <field name="partner_to">${object.worker_id.id}</field> |
| 83 | + <field name="subject">Match with your exchange request !</field> |
| 84 | + <field name="body_html"> |
| 85 | + <![CDATA[ |
| 86 | + <div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
| 87 | + Hello ${(object.worker_id.name)}, |
| 88 | + <br/><br/> |
| 89 | + <p> |
| 90 | + You asked to exchange your following shift : |
| 91 | + ${(object.exchanged_tmpl_dated_id.template_id.name)}, |
| 92 | + ${(object.exchanged_tmpl_dated_id.date.date())}, |
| 93 | + ${(object.exchanged_tmpl_dated_id.template_id.task_type_id.name)} |
| 94 | + </p> |
| 95 | + <p> |
| 96 | + Another cooperator offered to exchange it with his/her shift : |
| 97 | + ${ctx.get('matching_request').exchanged_tmpl_dated_id.template_id.name}, |
| 98 | + ${ctx.get('matching_request').exchanged_tmpl_dated_id.date.date()}, |
| 99 | + ${ctx.get('matching_request').exchanged_tmpl_dated_id.template_id.task_type_id.name} |
| 100 | + </p> |
| 101 | + <p> |
| 102 | + To confirm this match, please <a href="/my/request">click here</a> and validate the exchange. |
| 103 | + </p> |
| 104 | + <br/><br/> |
| 105 | + Regards, |
| 106 | + </div> |
| 107 | + ]]> |
| 108 | + </field> |
| 109 | + </record> |
| 110 | + |
| 111 | + <!-- Contact coop for planned exchange --> |
| 112 | + <record id="planned_exchange_contact_coop" model="mail.template"> |
| 113 | + <field name="name">Contact coop if an exchange is planned</field> |
| 114 | + <field name="model_id" ref="beesdoo_shift_swap.model_res_partner" /> |
| 115 | + <field name="partner_to">${ctx.get('partner_to').id}</field> |
| 116 | + <field name="auto_delete" eval="False" /> |
| 117 | + <field name="subject">Confirm your planned exchange</field> |
| 118 | + <field name="body_html"> |
| 119 | + <![CDATA[ |
| 120 | + <div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
| 121 | + Hello ${ctx.get('partner_to').name}, |
| 122 | + <br/><br/> |
| 123 | + <p> |
| 124 | + ${object.name} has planned to exchange the following shift with you: |
| 125 | + ${ctx.get('template_id').name}, |
| 126 | + ${ctx.get('exchanged_shift_date').date()}, |
| 127 | + ${ctx.get('template_id').task_type_id.name} |
| 128 | + </p> |
| 129 | + <p> |
| 130 | + To confirm and select the shift you want to exchange, please |
| 131 | + <a href="/my/shift/exchange/${object.id}/${ctx.get('template_id').id}/${ctx.get('exchanged_shift_date')}/validate/${ctx.get('asked_shift_date').date()}"> |
| 132 | + click here |
| 133 | + </a>. |
| 134 | + </p> |
| 135 | + <br/><br/> |
| 136 | + Regards, |
| 137 | + </div> |
| 138 | + ]]> |
| 139 | + </field> |
| 140 | + </record> |
| 141 | + |
| 142 | + <!-- Contact coop if his/her exchange request has been cancelled --> |
| 143 | + <record id="email_template_cancel_exchange_request" model="mail.template"> |
| 144 | + <field |
| 145 | + name="name" |
| 146 | + >Contact coop if his/her exchange request has been cancelled</field> |
| 147 | + <field |
| 148 | + name="model_id" |
| 149 | + ref="beesdoo_shift_swap.model_beesdoo_shift_exchange_request" |
| 150 | + /> |
| 151 | + <field name="partner_to">${object.worker_id.id}</field> |
| 152 | + <field name="auto_delete" eval="False" /> |
| 153 | + <field name="subject">You exchange request has been cancelled</field> |
| 154 | + <field name="body_html"> |
| 155 | + <![CDATA[ |
| 156 | + <div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
| 157 | + Hello ${object.worker_id.name}, |
| 158 | + <br/><br/> |
| 159 | + <p> |
| 160 | + The exchange request that you accepted has been cancelled by the other cooperator before his/her validation. |
| 161 | + Consequently, your exchange request has been cancelled. You can consult the details <a href="/my/request">here</a>. |
| 162 | + </p> |
| 163 | + <p> |
| 164 | + Please feel free to create a new request if you still want to exchange your shift. |
| 165 | + </p> |
| 166 | + <br/><br/> |
| 167 | + Regards, |
| 168 | + </div> |
| 169 | + ]]> |
| 170 | + </field> |
| 171 | + </record> |
| 172 | + |
| 173 | + </data> |
| 174 | +</odoo> |
0 commit comments