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.

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