birthday_calendar.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <record id="calendar_birthday_search_view" model="ir.ui.view">
  5. <field name="name">calendar_birthday_search_view</field>
  6. <field name="model">res.partner.birthday</field>
  7. <field name="arch" type="xml">
  8. <search>
  9. <field name="partner_id" string="Socio"/>
  10. <field name="birthday_date" string="Fecha"/>
  11. <filter string="Mes pasado" domain="[('birthday_date','&gt;=',(context_today()-relativedelta(months=1)).strftime('%%Y-%%m-01')),('birthday_date','&lt;',time.strftime('%%Y-%%m-01'))]"/>
  12. <filter string="Mes actual" domain="[('birthday_date','&lt;',(context_today()+relativedelta(months=1)).strftime('%%Y-%%m-01')), ('birthday_date','&gt;=',time.strftime('%%Y-%%m-01'))]"/>
  13. <filter string="Mes siguiente" domain="[('birthday_date','&gt;=', (context_today()+relativedelta(months=1)).strftime('%%Y-%%m-01')),('birthday_date','&lt;=',(context_today()+relativedelta(months=2)).strftime('%%Y-%%m-01'))]"/>
  14. <filter string="Este año" name="this_year" domain="[('birthday_date','&lt;',(context_today()+relativedelta(years=1)).strftime('%%Y-01-01')), ('birthday_date','&gt;=',time.strftime('%%Y-01-01'))]"/>
  15. <group expand="0" string="Agrupar por:">
  16. <filter name="group_by_customer" string="Socio" context="{'group_by':'partner_id'}"/>
  17. <filter string="Mes" context="{'group_by':'birthday_date:month'}" help="Mes Creado"/>
  18. <filter string="Dia" context="{'group_by':'birthday_date:day'}" help="Dia Creado"/>
  19. </group>
  20. </search>
  21. </field>
  22. </record>
  23. <record id="birthday_calendar_form_view" model="ir.ui.view">
  24. <field name="name">birthday_calendar_form_view</field>
  25. <field name="model">res.partner.birthday</field>
  26. <field name="type">form</field>
  27. <field name="target">inline</field>
  28. <field name="flags">{'form': {'action_buttons': False}}</field>
  29. <field name="arch" type="xml">
  30. <form create="false" edit="false" delete="false">
  31. <script>
  32. $(document).ready(function(){
  33. $(".modal-footer").hide();
  34. });
  35. </script>
  36. <div class="row" style="margin-bottom:20px;">
  37. <div class="col-md-3" style="text-align:center;">
  38. <field name="partner_picture" widget="image"/>
  39. </div>
  40. <div class="col-md-6" style="text-align:center; font-size:large">
  41. <group>
  42. <field name="partner_id"/>
  43. <field name="partner_birthday" string="Fecha de nacimiento"/>
  44. <field name="partner_year_string"/>
  45. <button name="send_whatsapp_msg" type="object" class="oe_highlight" string="Enviar whatsapp"/>
  46. </group>
  47. </div>
  48. <div class="col-md-3" style="text-align:center;">
  49. <field name="photo" widget="image"/>
  50. </div>
  51. </div>
  52. </form>
  53. </field>
  54. </record>
  55. <record id="birthday_calendar" model="ir.ui.view">
  56. <field name="name">Calendario de Cumpleaños</field>
  57. <field name="model">res.partner.birthday</field>
  58. <field name="type">calendar</field>
  59. <field name="arch" type="xml">
  60. <calendar color="partner_id" quick_add="false" date_start="birthday_date" date_stop="birthday_date" string="Cumpleaños" avatar_model="res.partner" event_open_popup="%(birthday_calendar.birthday_calendar_form_view)s">
  61. <field name="partner_id"/>
  62. <field name="partner_year_string"/>
  63. </calendar>
  64. </field>
  65. </record>
  66. <record id="birthday_calendar_tree_view" model="ir.ui.view">
  67. <field name="name">birthday_calendar_tree_view</field>
  68. <field name="model">res.partner.birthday</field>
  69. <field name="type">tree</field>
  70. <field name="arch" type="xml">
  71. <tree create="false">
  72. <field name="partner_id"/>
  73. <field name="birthday_date"/>
  74. <field name="partner_year_string"/>
  75. </tree>
  76. </field>
  77. </record>
  78. <record id="action_birthday_calendar" model="ir.actions.act_window">
  79. <field name="name">Calendario de Cumpleaños</field>
  80. <field name="res_model">res.partner.birthday</field>
  81. <field name="view_mode">calendar</field>
  82. <field name="context">{'search_default_this_year':1}</field>
  83. <field name="help" type="html">
  84. <p class="oe_view_nocontent_create">
  85. </p>
  86. </field>
  87. </record>
  88. <record model="ir.actions.act_window.view" id="action_view_birthday_calendar">
  89. <field name="sequence" eval="2"/>
  90. <field name="view_mode">calendar</field>
  91. <field name="view_id" ref="birthday_calendar"/>
  92. <field name="act_window_id" ref="action_birthday_calendar"/>
  93. </record>
  94. <record model="ir.actions.act_window.view" id="action_view_birthday_tree">
  95. <field name="sequence" eval="3"/>
  96. <field name="view_mode">tree</field>
  97. <field name="view_id" ref="birthday_calendar_tree_view"/>
  98. <field name="act_window_id" ref="action_birthday_calendar"/>
  99. </record>
  100. <menuitem name="Calendario de Cumpleaños" id="menu_birthday_calendar" parent="base.menu_sales" action="birthday_calendar.action_birthday_calendar" sequence="100"/>
  101. </data>
  102. </openerp>