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.

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