You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

170 lines
8.8 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <!-- Mail template are declared in a NOUPDATE block
  4. so users can freely customize/delete them -->
  5. <data noupdate="1">
  6. <record id="email_template_non_attendance" model="mail.template">
  7. <field name="name">Shift Non-attendance</field>
  8. <field name="subject">Non-attendance to your last shift.</field>
  9. <field name="partner_to">${object.replaced_id.id or object.worker_id.id|safe}</field>
  10. <field name="model_id" ref="model_beesdoo_shift_shift"/>
  11. <field name="auto_delete" eval="True"/>
  12. <field name="lang">${object.worker_id.lang}</field>
  13. <field name="body_html"><![CDATA[
  14. <div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
  15. % if object.replaced_id:
  16. <p>Hello ${object.replaced_id.name},
  17. <br><br>You have been recorded as non-attended during your last shift (${format_tz(object.start_time,object.replaced_id.tz or 'Europe/Brussels','%d.%m.%Y - %H:%M')}),
  18. and you were supposed to replace ${object.worker_id.name}.
  19. <br><br>Your current status is "${object.worker_id.cooperative_status_ids.get_status_value()}".
  20. % endif
  21. % if not object.replaced_id:
  22. </p><p>Hello ${object.worker_id.name},</p>
  23. <p>You have been recorded as non-attended during your last shift (${format_tz(object.start_time,object.worker_id.tz or 'Europe/Brussels','%d.%m.%Y - %H:%M')}).
  24. <br><br>Your current status is "${object.worker_id.cooperative_status_ids.get_status_value()}".
  25. % endif
  26. % if object.worker_id.working_mode == 'regular':
  27. % if object.state == 'absent_0':
  28. <br><br>Super-cooperator assigned you 0 compensation, so you won't have any additionnal shift to do before your next regular shift.
  29. % endif
  30. % if object.state == 'absent_1':
  31. <br><br>Super-cooperator assigned you 1 compensation, so you have to attend one additionnal shift before your next regular shift.
  32. % endif
  33. % if object.state == 'absent_2':
  34. <br><br>Super-cooperator assigned you 2 compensations, so you have to attend two additionnal shifts before your next regular shift.
  35. % endif
  36. % if object.replaced_id:
  37. You were supposed to replace ${object.worker_id.name}.
  38. You have to do ${(object.replaced_id.cooperative_status_ids.sr + object.replaced_id.cooperative_status_ids.sc) * -1 } shifts before your next regular shift.<br>
  39. % else:
  40. You have to do ${(object.worker_id.cooperative_status_ids.sr + object.worker_id.cooperative_status_ids.sc) * -1 } shifts before your next regular shift.<br>
  41. % endif
  42. % endif
  43. % if object.worker_id.working_mode == 'irregular':
  44. Your shift counter is at ${object.worker_id.cooperative_status_ids.sr}.
  45. % if object.worker_id.cooperative_status_ids.future_alert_date:
  46. It should be superior or equal to 1 before the
  47. ${object.worker_id.cooperative_status_ids.future_alert_date}.
  48. % endif
  49. <br>
  50. % endif
  51. % if object.replaced_id:
  52. Your current status is "${object.replaced_id.cooperative_status_ids.get_status_value()}".
  53. % else:
  54. <br><br>Your current status is "${object.worker_id.cooperative_status_ids.get_status_value()}".
  55. % endif
  56. <br>If you have any question regarding this non-attendance, just answer this e-mail.
  57. </p>
  58. <br>
  59. <p>Cooperatively yours,<br>
  60. The Members' office volunteers</p>
  61. <p>${object.worker_id.company_id.name}.</p>
  62. % if object.worker_id.company_id.street:
  63. ${object.worker_id.company_id.street}
  64. % endif
  65. % if object.worker_id.company_id.street2:
  66. ${object.worker_id.company_id.street2}<br>
  67. % endif
  68. % if object.worker_id.company_id.city or object.worker_id.company_id.zip:
  69. ${object.worker_id.company_id.zip} ${object.worker_id.company_id.city}<br>
  70. % endif
  71. % if object.worker_id.company_id.country_id:
  72. ${object.worker_id.company_id.state_id and ('%s, ' % object.worker_id.company_id.state_id.name) or ''} ${object.worker_id.company_id.country_id.name or ''}<br>
  73. % endif
  74. % if object.worker_id.company_id.phone:
  75. Phone:&nbsp; ${object.worker_id.company_id.phone}
  76. % endif
  77. % if object.worker_id.company_id.website:
  78. <div>
  79. Web :&nbsp;<a href="${object.worker_id.company_id.website}">${object.worker_id.company_id.website}</a>
  80. </div>
  81. %endif
  82. % if object.worker_id.company_id.logo_url:
  83. <div>
  84. <img src="${object.worker_id.company_id.logo_url}">
  85. </div>
  86. %endif
  87. </div>
  88. ]]></field>
  89. </record>
  90. <record id="email_template_non_validated_sheet" model="mail.template">
  91. <field name="name">Non-validated sheet</field>
  92. <field name="subject">[${object.day}] Non-validated sheet ${object.time_slot}</field>
  93. <field name="model_id" ref="model_beesdoo_shift_sheet"/>
  94. <field name="auto_delete" eval="True"/>
  95. <field name="body_html"><![CDATA[
  96. <div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
  97. <p>${object.day}
  98. <br/><br/>The attendance sheet for ${object.time_slot} is not validated.
  99. <br/><br/>Please, do it as soon as possible so as to update workers' status.
  100. </p>
  101. </div>
  102. ]]></field>
  103. </record>
  104. <record id="email_template_shift_summary" model="mail.template">
  105. <field name="name">Shift Summary</field>
  106. <field name="subject">Your next shift (${format_tz(object.start_time,object.worker_id.tz or 'Europe/Brussels','%d.%m.%Y - %H:%M')})</field>
  107. <field name="email_from">${object.worker_id.company_id.email}</field>
  108. <field name="partner_to">${object.replaced_id.id or object.worker_id.id|safe}</field>
  109. <field name="model_id" ref="model_beesdoo_shift_shift"/>
  110. <field name="auto_delete" eval="True"/>
  111. <field name="lang">${object.worker_id.lang}</field>
  112. <field name="body_html"><![CDATA[
  113. <div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
  114. <p>Hello ${object.worker_id.name},</p>
  115. <p>You are awaited the ${format_tz(object.start_time,object.worker_id.tz or 'Europe/Brussels','%d.%m.%Y')}
  116. for the shift starting at ${format_tz(object.start_time,object.worker_id.tz or 'Europe/Brussels','%H:%M')}.
  117. <br/><br/>Please contact us at ${object.worker_id.company_id.email} if you have any trouble attending the shift.
  118. </p>
  119. <br/>
  120. <p>Sustainably yours,</p>
  121. <p>${object.worker_id.company_id.name}.</p>
  122. % if object.worker_id.company_id.street:
  123. ${object.worker_id.company_id.street}
  124. % endif
  125. % if object.worker_id.company_id.street2:
  126. ${object.worker_id.company_id.street2}<br/>
  127. % endif
  128. % if object.worker_id.company_id.city or object.worker_id.company_id.zip:
  129. ${object.worker_id.company_id.zip} ${object.worker_id.company_id.city}<br/>
  130. % endif
  131. % if object.worker_id.company_id.country_id:
  132. ${object.worker_id.company_id.state_id and ('%s, ' % object.worker_id.company_id.state_id.name) or ''} ${object.worker_id.company_id.country_id.name or ''}<br/>
  133. % endif
  134. % if object.worker_id.company_id.phone:
  135. Phone:&nbsp; ${object.worker_id.company_id.phone}
  136. % endif
  137. % if object.worker_id.company_id.website:
  138. <div>
  139. Web :&nbsp;<a href="${object.worker_id.company_id.website}">${object.worker_id.company_id.website}</a>
  140. </div>
  141. %endif
  142. % if object.worker_id.company_id.logo_url:
  143. <div>
  144. <img src=${object.worker_id.company_id.logo_url}>
  145. </div>
  146. %endif
  147. </div>
  148. ]]></field>
  149. </record>
  150. </data>
  151. </odoo>