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.

68 lines
3.8 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. Asterisk Click2dial module for OpenERP
  4. Copyright (C) 2012 Alexis de Lattre <alexis@via.ecp.fr>
  5. The licence is in the file __openerp__.py
  6. -->
  7. <openerp>
  8. <data>
  9. <!-- Get partner from incoming phone call -->
  10. <record id="view_open_calling_partner" model="ir.ui.view">
  11. <field name="name">view_open_calling_partner</field>
  12. <field name="model">wizard.open.calling.partner</field>
  13. <field name="type">form</field>
  14. <field name="arch" type="xml">
  15. <form string="Open calling partner">
  16. <field name="calling_number" colspan="4"/>
  17. <field name="partner_address_id" attrs="{'invisible':[('partner_address_id','=',False)]}"/>
  18. <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 -->
  19. <newline />
  20. <group colspan="4" attrs="{'invisible':[('partner_id','=',False)]}">
  21. <button name="open_partner" icon="gtk-go-forward" string="Partner form" type="object" />
  22. <button name="open_sale_orders" icon="gtk-go-forward" string="Related sale orders" type="object" />
  23. <button name="open_invoices" icon="gtk-go-forward" string="Related invoices" type="object" />
  24. <button special="cancel" icon="gtk-cancel" string="Cancel" />
  25. </group>
  26. <!-- I display the button "Contact form" when the partner address exists but not the partner -->
  27. <group colspan="4" attrs="{'invisible':['|', '&amp;', ('partner_address_id','!=',False), ('partner_id','!=',False), ('partner_address_id','=',False)]}">
  28. <button name="open_partner_address" icon="gtk-go-forward" string="Contact form" type="object" colspan="2"/>
  29. <button special="cancel" icon="gtk-cancel" string="Cancel" colspan="2"/>
  30. </group>
  31. <group attrs="{'invisible':[('partner_address_id','!=',False)]}" colspan="4" col="8">
  32. <label string="No partner contact found in OpenERP with this number" colspan="8" />
  33. <separator string="Create a new contact" colspan="8" />
  34. <button name="create_partner_address_phone" icon="gtk-new" string="with calling number as phone" type="object" colspan="4"/>
  35. <button name="create_partner_address_mobile" icon="gtk-new" string="with calling number as mobile" type="object" colspan="4"/>
  36. <newline />
  37. <separator string="Update an existing contact" colspan="8" />
  38. <field name="to_update_partner_address_id" colspan="8" on_change="onchange_to_update_partner_address(to_update_partner_address_id)"/>
  39. <field name="current_phone" colspan="6"/>
  40. <button name="update_partner_address_phone" icon="gtk-convert" string="Update phone" type="object" colspan="2"/>
  41. <field name="current_mobile" colspan="6"/>
  42. <button name="update_partner_address_mobile" icon="gtk-convert" string="Update mobile" type="object" colspan="2"/>
  43. <newline />
  44. <button special="cancel" icon="gtk-cancel" string="Cancel" colspan="8" />
  45. </group>
  46. <!-- I repeat the cancel button for layout reasons -->
  47. </form>
  48. </field>
  49. </record>
  50. <record id="action_open_calling_partner" model="ir.actions.act_window">
  51. <field name="name">Open calling partner</field>
  52. <field name="res_model">wizard.open.calling.partner</field>
  53. <field name="view_type">form</field>
  54. <field name="view_mode">form</field>
  55. <field name="target">new</field>
  56. </record>
  57. <menuitem id="menu_open_calling_partner_sales" parent="base.menu_address_book" action="action_open_calling_partner" sequence="50" />
  58. </data>
  59. </openerp>