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.

191 lines
11 KiB

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