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.

180 lines
10 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="view_res_partner_filter_contact" model="ir.ui.view">
  4. <field name="name">res.partner.select.contact</field>
  5. <field name="model">res.partner</field>
  6. <field name="inherit_id" ref="base.view_res_partner_filter"/>
  7. <field name="arch" type="xml">
  8. <filter name="type_company" position="after">
  9. <separator/>
  10. <filter string="All positions" name="type_otherpositions"
  11. context="{'search_show_all_positions': {'is_set': True, 'set_value': True}}"
  12. help="All partner positions"/>
  13. </filter>
  14. <xpath expr="/search/group[@name='group_by']" position="inside">
  15. <filter string="Person" name="group_person" context="{'group_by': 'contact_id'}"/>
  16. </xpath>
  17. </field>
  18. </record>
  19. <record id="view_res_partner_tree_contact" model="ir.ui.view">
  20. <field name="name">res.partner.tree.contact</field>
  21. <field name="model">res.partner</field>
  22. <field name="inherit_id" ref="base.view_partner_tree"/>
  23. <field name="arch" type="xml">
  24. <field name="parent_id" position="after">
  25. <field name="contact_id" invisible="1"/>
  26. </field>
  27. </field>
  28. </record>
  29. <record model="ir.ui.view" id="view_partner_form_inherit">
  30. <field name="name">res.partner.form.contact</field>
  31. <field name="model">res.partner</field>
  32. <field name="inherit_id" ref="base.view_partner_form"/>
  33. <field name="type">form</field>
  34. <field name="arch" type="xml">
  35. <field name="is_company" position="after">
  36. <field name="contact_type" invisible="1"/>
  37. </field>
  38. <page name='internal_notes' position="before">
  39. <page string="Other Positions" attrs="{'invisible': ['|',('is_company','=',True),('contact_id','!=',False)]}">
  40. <field name="other_contact_ids" context="{'default_contact_id': active_id, 'default_name': name, 'default_street': street, 'default_street2': street2, 'default_city': city, 'default_state_id': state_id, 'default_zip': zip, 'default_country_id': country_id, 'default_supplier': supplier}}" mode="kanban">
  41. <kanban>
  42. <field name="color"/>
  43. <field name="name"/>
  44. <field name="title"/>
  45. <field name="email"/>
  46. <field name="parent_id"/>
  47. <field name="is_company"/>
  48. <field name="function"/>
  49. <field name="phone"/>
  50. <field name="street"/>
  51. <field name="street2"/>
  52. <field name="zip"/>
  53. <field name="city"/>
  54. <field name="country_id"/>
  55. <field name="mobile"/>
  56. <field name="fax"/>
  57. <field name="state_id"/>
  58. <field name="image"/>
  59. <field name="lang"/>
  60. <templates>
  61. <t t-name="kanban-box">
  62. <t t-set="color" t-value="kanban_color(record.color.raw_value)"/>
  63. <div t-att-class="color + (record.title.raw_value == 1 ? ' oe_kanban_color_alert' : '') + ' oe_kanban_global_click'">
  64. <a t-if="!read_only_mode" type="delete" class="fa fa-times pull-right"/>
  65. <div class="o_kanban_image">
  66. <img t-if="record.image.raw_value" t-att-src="'data:image/png;base64,'+record.image.raw_value"/>
  67. <t t-if="!record.image.raw_value">
  68. <img t-if="record.is_company.raw_value === true" t-att-src='_s + "/base/static/src/img/company_image.png"'/>
  69. <img t-if="record.is_company.raw_value === false" t-att-src='_s + "/base/static/src/img/avatar.png"'/>
  70. </t>
  71. </div>
  72. <div class="oe_kanban_details">
  73. <field name="name"/>
  74. <div t-if="record.function.raw_value"><field name="function"/> at <field name="parent_id"/></div>
  75. <div t-if="record.email.raw_value"><field name="email"/></div>
  76. <div t-if="record.phone.raw_value">Phone: <field name="phone"/></div>
  77. <div t-if="record.mobile.raw_value">Mobile: <field name="mobile"/></div>
  78. <div t-if="record.fax.raw_value">Fax: <field name="fax"/></div>
  79. </div>
  80. </div>
  81. </t>
  82. </templates>
  83. </kanban>
  84. <form string="Contact">
  85. <sheet>
  86. <field name="type" required="1" widget="radio" options="{'horizontal': true}"/>
  87. <hr/>
  88. <group>
  89. <group attrs="{'invisible': [('type','=', 'contact')]}">
  90. <label for="street" string="Address"/>
  91. <div>
  92. <div class="o_address_format" name="div_address">
  93. <field name="street" placeholder="Street..." class="o_address_street"/>
  94. <field name="street2" placeholder="Street 2..." class="o_address_street"/>
  95. <field name="city" placeholder="City" class="o_address_city"/>
  96. <field name="state_id" class="o_address_state" placeholder="State" options='{"no_open": True}' context="{'country_id': country_id, 'zip': zip}"/>
  97. <field name="zip" placeholder="ZIP" class="o_address_zip"/>
  98. <field name="country_id" placeholder="Country" class="o_address_country" options='{"no_open": True, "no_create": True}'/>
  99. </div>
  100. </div>
  101. </group>
  102. <group>
  103. <field name="name" string="Contact Name" attrs="{'required' : [('type', '=', 'contact')]}"/>
  104. <field name="title" placeholder="e.g. Mr."
  105. attrs="{'invisible': [('type','&lt;&gt;', 'contact')]}"/>
  106. <field name="function" placeholder="e.g. Sales Director"
  107. attrs="{'invisible': [('type','&lt;&gt;', 'contact')]}"/>
  108. <field name="email"/>
  109. <field name="phone" widget="phone"/>
  110. <field name="mobile" widget="phone"/>
  111. <field name="comment" placeholder="internal note..."/>
  112. </group>
  113. </group>
  114. <field name="supplier" invisible="True"/>
  115. <field name="customer" invisible="True"/>
  116. <field name="lang" invisible="True"/>
  117. </sheet>
  118. </form>
  119. </field>
  120. </page>
  121. </page>
  122. <xpath expr="//field[@name='child_ids']/form//field[@name='name']" position="before">
  123. <field name='contact_type' readonly='0'/>
  124. <field name="contact_id" string="Contact"
  125. attrs="{'invisible': [('contact_type','!=','attached')], 'required': [('contact_type','=','attached')]}"/>
  126. </xpath>
  127. <xpath expr="//field[@name='child_ids']/form//field[@name='name']" position="attributes">
  128. <attribute name="attrs">{'invisible': [('contact_type','=','attached')]}</attribute>
  129. </xpath>
  130. </field>
  131. </record>
  132. <record id="personal_contact_information" model="ir.ui.view">
  133. <field name="name">Contacts in several partners: personal info</field>
  134. <field name="model">res.partner</field>
  135. <field name="inherit_id" ref="partner_contact_personal_information_page.personal_information"/>
  136. <field name="arch" type="xml">
  137. <xpath expr="//page[@name='personal_information_page']/group[@name='personal_information_group']"
  138. position='attributes'>
  139. <attribute name='attrs'>{'invisible': [('contact_id','!=',False)]}</attribute>
  140. </xpath>
  141. <xpath expr="//page[@name='personal_information_page']/group[@name='personal_information_group']"
  142. position='after'>
  143. <p attrs="{'invisible': [('contact_id','=',False)]}">
  144. To see personal information about this contact, please
  145. go to to the this person form:
  146. <field name="contact_id" class="oe_inline"
  147. domain="[('contact_type','!=','attached')]"
  148. context="{'show_address': 1}"
  149. options="{'always_reload': True}"/>
  150. </p>
  151. </xpath>
  152. </field>
  153. </record>
  154. <record model="ir.ui.view" id="view_res_partner_kanban_contact">
  155. <field name="name">res.partner.kanban.contact</field>
  156. <field name="model">res.partner</field>
  157. <field name="inherit_id" ref="base.res_partner_kanban_view"/>
  158. <field name="arch" type="xml">
  159. <field name="is_company" position="after">
  160. <field name="other_contact_ids">
  161. <tree>
  162. <field name="parent_id"/>
  163. <field name="function"/>
  164. </tree>
  165. </field>
  166. </field>
  167. <xpath expr="//t[@t-name='kanban-box']//div[@class='oe_kanban_details']/ul/li[3]" position="after">
  168. <t t-if="record.other_contact_ids.raw_value.length &gt; 0">
  169. <li>+<t t-esc="record.other_contact_ids.raw_value.length"/>
  170. <t t-if="record.other_contact_ids.raw_value.length == 1">other position</t>
  171. <t t-if="record.other_contact_ids.raw_value.length &gt; 1">other positions</t></li>
  172. </t>
  173. </xpath>
  174. </field>
  175. </record>
  176. </odoo>