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.

64 lines
3.4 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_id" attrs="{'invisible':[('partner_id','=',False)]}"/>
  18. <field name="parent_partner_id" attrs="{'invisible':[('partner_id','=',False)]}" /> <!-- I want it visible when partner_id != False and partner_id = False, so that the user can see that this partner doesn't have a parent partner -->
  19. <newline />
  20. <group colspan="4" col="5" attrs="{'invisible':[('partner_id','=',False)]}">
  21. <button name="open_partner" icon="gtk-go-forward" string="Partner form" type="object" />
  22. <button name="open_parent_partner" icon="gtk-go-forward" string="Parent Partner form" type="object" attrs="{'invisible':[('parent_partner_id','=',False)]}"/>
  23. <button name="open_sale_orders" icon="gtk-go-forward" string="Related sale orders" type="object" />
  24. <button name="open_invoices" icon="gtk-go-forward" string="Related invoices" type="object" />
  25. <button special="cancel" icon="gtk-cancel" string="Cancel" />
  26. </group>
  27. <group attrs="{'invisible':[('partner_id','!=',False)]}" colspan="4" col="8">
  28. <label string="No partner found in OpenERP with this number" colspan="8" />
  29. <separator string="Create a new partner" colspan="8" />
  30. <button name="create_partner_phone" icon="gtk-new" string="with calling number as phone" type="object" colspan="4"/>
  31. <button name="create_partner_mobile" icon="gtk-new" string="with calling number as mobile" type="object" colspan="4"/>
  32. <newline />
  33. <separator string="Update an existing partner" colspan="8" />
  34. <field name="to_update_partner_id" colspan="8" on_change="onchange_to_update_partner(to_update_partner_id)"/>
  35. <field name="current_phone" colspan="6"/>
  36. <button name="update_partner_phone" icon="gtk-convert" string="Update phone" type="object" colspan="2"/>
  37. <field name="current_mobile" colspan="6"/>
  38. <button name="update_partner_mobile" icon="gtk-convert" string="Update mobile" type="object" colspan="2"/>
  39. <newline />
  40. <button special="cancel" icon="gtk-cancel" string="Cancel" colspan="8" />
  41. </group>
  42. <!-- I repeat the cancel button for layout reasons -->
  43. </form>
  44. </field>
  45. </record>
  46. <record id="action_open_calling_partner" model="ir.actions.act_window">
  47. <field name="name">Open calling partner</field>
  48. <field name="res_model">wizard.open.calling.partner</field>
  49. <field name="view_type">form</field>
  50. <field name="view_mode">form</field>
  51. <field name="target">new</field>
  52. </record>
  53. <menuitem id="menu_open_calling_partner_sales" parent="base.menu_sales" action="action_open_calling_partner" sequence="50" />
  54. </data>
  55. </openerp>