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.

210 lines
11 KiB

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