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.

202 lines
13 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  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': True}"
  13. help="All partner positions"/>
  14. </filter>
  15. <xpath expr="/search/group/filter[@string='Company']" position="before">
  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 string="Contacts" position="after">
  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="has_image"/>
  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' : '')" style="position: relative">
  64. <a t-if="! read_only_mode" type="delete" style="position: absolute; right: 0; padding: 4px; diplay: inline-block">X</a>
  65. <div class="oe_module_vignette">
  66. <a type="open">
  67. <t t-if="record.has_image.raw_value === true">
  68. <img t-att-src="kanban_image('res.partner', 'image', record.id.value, {'preview_image': 'image_small'})" class="oe_avatar oe_kanban_avatar_smallbox"/>
  69. </t>
  70. <t t-if="record.image and record.image.raw_value !== false">
  71. <img t-att-src="'data:image/png;base64,'+record.image.raw_value" class="oe_avatar oe_kanban_avatar_smallbox"/>
  72. </t>
  73. <t t-if="record.has_image.raw_value === false and (!record.image or record.image.raw_value === false)">
  74. <t t-if="record.is_company.raw_value === true">
  75. <img t-att-src='_s + "/base/static/src/img/company_image.png"' class="oe_kanban_image oe_kanban_avatar_smallbox"/>
  76. </t>
  77. <t t-if="record.is_company.raw_value === false">
  78. <img t-att-src='_s + "/base/static/src/img/avatar.png"' class="oe_kanban_image oe_kanban_avatar_smallbox"/>
  79. </t>
  80. </t>
  81. </a>
  82. <div class="oe_module_desc">
  83. <div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_color_border">
  84. <table class="oe_kanban_table">
  85. <tr>
  86. <td class="oe_kanban_title1" align="left" valign="middle">
  87. <h4><a type="open"><field name="name"/></a></h4>
  88. <i>
  89. <t t-if="record.parent_id.raw_value and !record.function.raw_value"><field name="parent_id"/></t>
  90. <t t-if="!record.parent_id.raw_value and record.function.raw_value"><field name="function"/></t>
  91. <t t-if="record.parent_id.raw_value and record.function.raw_value"><field name="function"/> at <field name="parent_id"/></t>
  92. </i>
  93. <div><a t-if="record.email.raw_value" title="Mail" t-att-href="'mailto:'+record.email.value">
  94. <field name="email"/>
  95. </a></div>
  96. <div t-if="record.phone.raw_value">Phone: <field name="phone"/></div>
  97. <div t-if="record.mobile.raw_value">Mobile: <field name="mobile"/></div>
  98. <div t-if="record.fax.raw_value">Fax: <field name="fax"/></div>
  99. </td>
  100. </tr>
  101. </table>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </t>
  107. </templates>
  108. </kanban>
  109. <form string="Contact" version="7.0">
  110. <sheet>
  111. <field name="image" widget='image' class="oe_avatar oe_left" options='{"preview_image": "image_medium"}'/>
  112. <div class="oe_title">
  113. <label for="name" class="oe_edit_only"/>
  114. <h1><field name="name" style="width: 70%%"/></h1>
  115. </div>
  116. <group>
  117. <!-- inherited part -->
  118. <field name="category_id" widget="many2many_tags" placeholder="Tags..." style="width: 70%%"/>
  119. <field name="parent_id" placeholder="Company" domain="[('is_company','=',True)]"/>
  120. <!-- inherited part end -->
  121. <field name="function" placeholder="e.g. Sales Director"/>
  122. <field name="email"/>
  123. <field name="phone"/>
  124. <field name="mobile"/>
  125. </group>
  126. <div>
  127. <field name="use_parent_address"/><label for="use_parent_address"/>
  128. </div>
  129. <group>
  130. <label for="type"/>
  131. <div name="div_type">
  132. <field class="oe_inline" name="type"/>
  133. </div>
  134. <label for="street" string="Address" attrs="{'invisible': [('use_parent_address','=', True)]}"/>
  135. <div attrs="{'invisible': [('use_parent_address','=', True)]}" name="div_address">
  136. <field name="street" placeholder="Street..."/>
  137. <field name="street2"/>
  138. <div class="address_format">
  139. <field name="city" placeholder="City" style="width: 40%%"/>
  140. <field name="state_id" class="oe_no_button" placeholder="State" style="width: 37%%" options='{"no_open": True}' on_change="onchange_state(state_id)"/>
  141. <field name="zip" placeholder="ZIP" style="width: 20%%"/>
  142. </div>
  143. <field name="country_id" placeholder="Country" class="oe_no_button" options='{"no_open": True}'/>
  144. </div>
  145. </group>
  146. <field name="supplier" invisible="True"/>
  147. </sheet>
  148. </form>
  149. </field>
  150. </page>
  151. <page name="personal-info" string="Personal Information" attrs="{'invisible': ['|',('is_company','=',True)]}">
  152. <p attrs="{'invisible': [('contact_id','=',False)]}">
  153. To see personal information about this contact, please go to to the his person form: <field name="contact_id" class="oe_inline" domain="[('contact_type','!=','attached')]" context="{'show_address': 1}"
  154. on_change="onchange_contact_id(contact_id)" options="{'always_reload': True}"/>
  155. </p>
  156. <group attrs="{'invisible': [('contact_id','!=',False)]}">
  157. <field name="birthdate_date"/>
  158. <field name="nationality_id"/>
  159. </group>
  160. </page>
  161. </page>
  162. <xpath expr="//field[@name='child_ids']/form//field[@name='name']/.." position="before">
  163. <field name="contact_type" readonly="0" on_change="onchange_contact_type(contact_type)"/>
  164. </xpath>
  165. <xpath expr="//field[@name='child_ids']/form//field[@name='name']" position="after">
  166. <field name="contact_id" on_change="onchange_contact_id(contact_id)" string="Contact"
  167. attrs="{'invisible': [('contact_type','!=','attached')], 'required': [('contact_type','=','attached')]}"/>
  168. </xpath>
  169. <xpath expr="//field[@name='child_ids']/form//field[@name='name']" position="attributes">
  170. <attribute name="attrs">{'invisible': [('contact_type','=','attached')]}</attribute>
  171. </xpath>
  172. </field>
  173. </record>
  174. <record model="ir.ui.view" id="view_res_partner_kanban_contact">
  175. <field name="name">res.partner.kanban.contact</field>
  176. <field name="model">res.partner</field>
  177. <field name="inherit_id" ref="base.res_partner_kanban_view"/>
  178. <field name="arch" type="xml">
  179. <field name="is_company" position="after">
  180. <field name="other_contact_ids">
  181. <tree>
  182. <field name="parent_id"/>
  183. <field name="function"/>
  184. </tree>
  185. </field>
  186. </field>
  187. <xpath expr="//t[@t-name='kanban-box']//div[@class='oe_kanban_details']/ul/li[3]" position="after">
  188. <t t-if="record.other_contact_ids.raw_value.length &gt; 0">
  189. <li>+<t t-esc="record.other_contact_ids.raw_value.length"/>
  190. <t t-if="record.other_contact_ids.raw_value.length == 1">other position</t>
  191. <t t-if="record.other_contact_ids.raw_value.length &gt; 1">other positions</t></li>
  192. </t>
  193. </xpath>
  194. </field>
  195. </record>
  196. </data>
  197. </openerp>