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.

141 lines
6.5 KiB

13 years ago
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. Asterisk Click2dial module for OpenERP
  4. Copyright (C) 2010-2012 Alexis de Lattre <alexis@via.ecp.fr>
  5. The licence is in the file __openerp__.py
  6. Inherit partner_address views to add 'Dial' button next to 'phone'
  7. and 'mobile' fields
  8. -->
  9. <openerp>
  10. <data>
  11. <record id="asterisk_res_partner_address_dial1" model="ir.ui.view">
  12. <field name="name">asterisk.res.partner.address.dial1</field>
  13. <field name="model">res.partner.address</field>
  14. <field name="priority">15</field>
  15. <field name="inherit_id" ref="base.view_partner_address_form1"/>
  16. <field name="arch" type="xml">
  17. <data>
  18. <field name="phone" position="replace">
  19. <group colspan="2" col="8">
  20. <field name="phone" colspan="7" />
  21. <button name="action_dial_phone" string="Dial" type="object"/>
  22. </group>
  23. </field>
  24. <field name="mobile" position="replace">
  25. <group colspan="2" col="8">
  26. <field name="mobile" colspan="7" />
  27. <button name="action_dial_mobile" string="Dial" type="object"/>
  28. </group>
  29. </field>
  30. </data>
  31. </field>
  32. </record>
  33. <record id="asterisk_res_partner_address_dial2" model="ir.ui.view">
  34. <field name="name">asterisk.res.partner.address.dial2</field>
  35. <field name="model">res.partner.address</field>
  36. <field name="priority">15</field>
  37. <field name="inherit_id" ref="base.view_partner_address_form2"/>
  38. <field name="arch" type="xml">
  39. <data>
  40. <field name="phone" position="replace">
  41. <group colspan="2" col="8">
  42. <field name="phone" colspan="7" />
  43. <button name="action_dial_phone" string="Dial" type="object"/>
  44. </group>
  45. </field>
  46. <field name="mobile" position="replace">
  47. <group colspan="2" col="8">
  48. <field name="mobile" colspan="7" />
  49. <button name="action_dial_mobile" string="Dial" type="object"/>
  50. </group>
  51. </field>
  52. </data>
  53. </field>
  54. </record>
  55. <record id="asterisk_res_partner_dial" model="ir.ui.view">
  56. <field name="name">asterisk.res.partner.dial</field>
  57. <field name="model">res.partner</field>
  58. <field name="priority">15</field>
  59. <field name="inherit_id" ref="base.view_partner_form"/>
  60. <field name="arch" type="xml">
  61. <data>
  62. <field name="phone" position="replace">
  63. <group colspan="2" col="8">
  64. <field name="phone" colspan="7" />
  65. <button name="action_dial_phone" string="Dial" type="object"/>
  66. </group>
  67. </field>
  68. <field name="mobile" position="replace">
  69. <group colspan="2" col="8">
  70. <field name="mobile" colspan="7" />
  71. <button name="action_dial_mobile" string="Dial" type="object"/>
  72. </group>
  73. </field>
  74. </data>
  75. </field>
  76. </record>
  77. <!-- Get partner from incoming phone call -->
  78. <record id="view_open_calling_partner" model="ir.ui.view">
  79. <field name="name">view_open_calling_partner</field>
  80. <field name="model">wizard.open.calling.partner</field>
  81. <field name="type">form</field>
  82. <field name="arch" type="xml">
  83. <form string="Open calling partner">
  84. <field name="calling_number" colspan="4"/>
  85. <field name="partner_address_id" attrs="{'invisible':[('partner_address_id','=',False)]}"/>
  86. <field name="partner_id" attrs="{'invisible':[('partner_address_id','=',False)]}" /> <!-- I want it visible when partner_address_id != False and partner_id = False, so that the user can see that this partner_address doesn't have a partner -->
  87. <newline />
  88. <group colspan="4" attrs="{'invisible':[('partner_id','=',False)]}">
  89. <button name="open_partner" icon="gtk-go-forward" string="Partner form" type="object" />
  90. <button name="open_sale_orders" icon="gtk-go-forward" string="Related sale orders" type="object" />
  91. <button name="open_invoices" icon="gtk-go-forward" string="Related invoices" type="object" />
  92. <button special="cancel" icon="gtk-cancel" string="Cancel" />
  93. </group>
  94. <!-- I display the button "Contact form" when the partner address exists but not the partner -->
  95. <group colspan="4" attrs="{'invisible':['|', '&amp;', ('partner_address_id','!=',False), ('partner_id','!=',False), ('partner_address_id','=',False)]}">
  96. <button name="open_partner_address" icon="gtk-go-forward" string="Contact form" type="object" colspan="2"/>
  97. <button special="cancel" icon="gtk-cancel" string="Cancel" colspan="2"/>
  98. </group>
  99. <group attrs="{'invisible':[('partner_address_id','!=',False)]}" colspan="4" col="8">
  100. <label string="No partner contact found in OpenERP with this number" colspan="8" />
  101. <separator string="Create a new contact" colspan="8" />
  102. <button name="create_partner_address_phone" icon="gtk-new" string="with calling number as phone" type="object" colspan="4"/>
  103. <button name="create_partner_address_mobile" icon="gtk-new" string="with calling number as mobile" type="object" colspan="4"/>
  104. <newline />
  105. <separator string="Update an existing contact" colspan="8" />
  106. <field name="to_update_partner_address_id" colspan="8" on_change="onchange_to_update_partner_address(to_update_partner_address_id)"/>
  107. <field name="current_phone" colspan="6"/>
  108. <button name="update_partner_address_phone" icon="gtk-convert" string="Update phone" type="object" colspan="2"/>
  109. <field name="current_mobile" colspan="6"/>
  110. <button name="update_partner_address_mobile" icon="gtk-convert" string="Update mobile" type="object" colspan="2"/>
  111. <newline />
  112. <button special="cancel" icon="gtk-cancel" string="Cancel" colspan="8" />
  113. </group>
  114. <!-- I repeat the cancel button for layout reasons -->
  115. </form>
  116. </field>
  117. </record>
  118. <record id="action_open_calling_partner" model="ir.actions.act_window">
  119. <field name="name">Open calling partner</field>
  120. <field name="res_model">wizard.open.calling.partner</field>
  121. <field name="view_type">form</field>
  122. <field name="view_mode">form</field>
  123. <field name="target">new</field>
  124. </record>
  125. <menuitem id="menu_open_calling_partner_sales" parent="base.menu_address_book" action="action_open_calling_partner" sequence="50" />
  126. </data>
  127. </openerp>