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.

304 lines
16 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
  11. string="All positions"
  12. name="type_otherpositions"
  13. context="{'search_show_all_positions': {'is_set': True, 'set_value': True}}"
  14. help="All partner positions"
  15. />
  16. </filter>
  17. <xpath expr="/search/group[@name='group_by']" position="inside">
  18. <filter
  19. string="Person"
  20. name="group_person"
  21. context="{'group_by': 'contact_id'}"
  22. />
  23. </xpath>
  24. </field>
  25. </record>
  26. <record id="view_res_partner_tree_contact" model="ir.ui.view">
  27. <field name="name">res.partner.tree.contact</field>
  28. <field name="model">res.partner</field>
  29. <field name="inherit_id" ref="base.view_partner_tree" />
  30. <field name="arch" type="xml">
  31. <field name="parent_id" position="after">
  32. <field name="contact_id" invisible="1" />
  33. </field>
  34. </field>
  35. </record>
  36. <record model="ir.ui.view" id="view_partner_form_inherit">
  37. <field name="name">res.partner.form.contact</field>
  38. <field name="model">res.partner</field>
  39. <field name="inherit_id" ref="base.view_partner_form" />
  40. <field name="type">form</field>
  41. <field name="arch" type="xml">
  42. <field name="parent_id" position="after">
  43. <field name="contact_id" invisible="1" />
  44. </field>
  45. <xpath
  46. expr="//field[@name='child_ids']/form//field[@name='name']"
  47. position="before"
  48. >
  49. <field name='contact_type' readonly='0' />
  50. <field
  51. name="contact_id"
  52. string="Contact"
  53. attrs="{'invisible': [('contact_type','!=','attached')], 'required': [('contact_type','=','attached')]}"
  54. />
  55. </xpath>
  56. <xpath
  57. expr="//field[@name='child_ids']/form//field[@name='name']"
  58. position="attributes"
  59. >
  60. <attribute
  61. name="attrs"
  62. >{'invisible': [('contact_type','=','attached')]}</attribute>
  63. </xpath>
  64. <field name="is_company" position="after">
  65. <field name="contact_type" invisible="1" />
  66. </field>
  67. <page name='internal_notes' position="before">
  68. <page
  69. name="other_position"
  70. string="Other Positions"
  71. attrs="{'invisible': ['|',('is_company','=',True),('contact_id','!=',False)]}"
  72. >
  73. <field
  74. name="other_contact_ids"
  75. 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}"
  76. mode="kanban"
  77. >
  78. <kanban create="false">
  79. <field name="color" />
  80. <field name="name" />
  81. <field name="title" />
  82. <field name="email" />
  83. <field name="parent_id" />
  84. <field name="is_company" />
  85. <field name="function" />
  86. <field name="phone" />
  87. <field name="street" />
  88. <field name="street2" />
  89. <field name="zip" />
  90. <field name="city" />
  91. <field name="country_id" />
  92. <field name="mobile" />
  93. <field name="state_id" />
  94. <field name="image_128" />
  95. <field name="lang" />
  96. <templates>
  97. <t t-name="kanban-box">
  98. <t
  99. t-set="color"
  100. t-value="kanban_color(record.color.raw_value)"
  101. />
  102. <div
  103. t-att-class="color + (record.title.raw_value == 1 ? ' oe_kanban_color_alert' : '') + ' oe_kanban_global_click'"
  104. >
  105. <a
  106. t-if="!read_only_mode"
  107. type="delete"
  108. class="fa fa-times pull-right"
  109. title="Delete Contact"
  110. />
  111. <div class="o_kanban_image">
  112. <img
  113. alt="Contact Image"
  114. t-if="record.image_128.raw_value"
  115. t-att-src="'data:image/png;base64,' + record.image_128.raw_value"
  116. />
  117. <t t-if="!record.image_128.raw_value">
  118. <img
  119. alt="Logo"
  120. t-if="record.is_company.raw_value === true"
  121. t-att-src='_s + "/base/static/img/company_image.png"'
  122. />
  123. <img
  124. alt="Avatar"
  125. t-if="record.is_company.raw_value === false"
  126. t-att-src='_s + "/base/static/img/avatar_grey.png"'
  127. />
  128. </t>
  129. </div>
  130. <div class="oe_kanban_details">
  131. <field name="name" />
  132. <div t-if="record.function.raw_value">
  133. <field name="function" />
  134. at
  135. <field name="parent_id" />
  136. </div>
  137. <div t-if="record.email.raw_value">
  138. <field name="email" />
  139. </div>
  140. <div t-if="record.phone.raw_value">Phone:
  141. <field name="phone" />
  142. </div>
  143. <div t-if="record.mobile.raw_value">Mobile:
  144. <field name="mobile" />
  145. </div>
  146. </div>
  147. </div>
  148. </t>
  149. </templates>
  150. </kanban>
  151. <form string="Contact">
  152. <sheet>
  153. <field
  154. name="type"
  155. required="1"
  156. widget="radio"
  157. options="{'horizontal': true}"
  158. />
  159. <hr />
  160. <group>
  161. <group
  162. attrs="{'invisible': [('type','=', 'contact')]}"
  163. >
  164. <label for="street" string="Address" />
  165. <div>
  166. <div
  167. class="o_address_format"
  168. name="div_address"
  169. >
  170. <field
  171. name="street"
  172. placeholder="Street..."
  173. class="o_address_street"
  174. />
  175. <field
  176. name="street2"
  177. placeholder="Street 2..."
  178. class="o_address_street"
  179. />
  180. <field
  181. name="city"
  182. placeholder="City"
  183. class="o_address_city"
  184. />
  185. <field
  186. name="state_id"
  187. class="o_address_state"
  188. placeholder="State"
  189. options='{"no_open": True}'
  190. context="{'country_id': country_id, 'zip': zip}"
  191. />
  192. <field
  193. name="zip"
  194. placeholder="ZIP"
  195. class="o_address_zip"
  196. />
  197. <field
  198. name="country_id"
  199. placeholder="Country"
  200. class="o_address_country"
  201. options='{"no_open": True, "no_create": True}'
  202. />
  203. </div>
  204. </div>
  205. </group>
  206. <group>
  207. <field
  208. name="name"
  209. string="Contact Name"
  210. attrs="{'required' : [('type', '=', 'contact')]}"
  211. />
  212. <field
  213. name="title"
  214. placeholder="e.g. Mr."
  215. attrs="{'invisible': [('type','&lt;&gt;', 'contact')]}"
  216. />
  217. <field
  218. name="function"
  219. placeholder="e.g. Sales Director"
  220. attrs="{'invisible': [('type','&lt;&gt;', 'contact')]}"
  221. />
  222. <field name="email" />
  223. <field name="phone" widget="phone" />
  224. <field name="mobile" widget="phone" />
  225. <field
  226. name="comment"
  227. placeholder="internal note..."
  228. />
  229. </group>
  230. </group>
  231. <field name="lang" invisible="True" />
  232. </sheet>
  233. </form>
  234. </field>
  235. </page>
  236. </page>
  237. </field>
  238. </record>
  239. <record id="personal_contact_information" model="ir.ui.view">
  240. <field name="name">Contacts in several partners: personal info</field>
  241. <field name="model">res.partner</field>
  242. <field
  243. name="inherit_id"
  244. ref="partner_contact_personal_information_page.personal_information"
  245. />
  246. <field name="arch" type="xml">
  247. <xpath
  248. expr="//page[@name='personal_information_page']/group[@name='personal_information_group']"
  249. position='attributes'
  250. >
  251. <attribute
  252. name='attrs'
  253. >{'invisible': [('contact_id','!=',False)]}</attribute>
  254. </xpath>
  255. <xpath
  256. expr="//page[@name='personal_information_page']/group[@name='personal_information_group']"
  257. position='after'
  258. >
  259. <p attrs="{'invisible': [('contact_id','=',False)]}">
  260. To see personal information about this contact, please
  261. go to to the this person form:
  262. <field
  263. name="contact_id"
  264. class="oe_inline"
  265. domain="[('contact_type','!=','attached')]"
  266. context="{'show_address': 1}"
  267. options="{'always_reload': True}"
  268. />
  269. </p>
  270. </xpath>
  271. </field>
  272. </record>
  273. <record model="ir.ui.view" id="view_res_partner_kanban_contact">
  274. <field name="name">res.partner.kanban.contact</field>
  275. <field name="model">res.partner</field>
  276. <field name="inherit_id" ref="base.res_partner_kanban_view" />
  277. <field name="arch" type="xml">
  278. <field name="is_company" position="after">
  279. <field name="other_contact_ids">
  280. <tree>
  281. <field name="parent_id" />
  282. <field name="function" />
  283. </tree>
  284. </field>
  285. </field>
  286. <xpath
  287. expr="//t[@t-name='kanban-box']//div[hasclass('oe_kanban_details')]/ul/li[3]"
  288. position="after"
  289. >
  290. <t t-if="record.other_contact_ids.raw_value.length &gt; 0">
  291. <li>+
  292. <t t-esc="record.other_contact_ids.raw_value.length" />
  293. <t
  294. t-if="record.other_contact_ids.raw_value.length == 1"
  295. >other position</t>
  296. <t
  297. t-if="record.other_contact_ids.raw_value.length &gt; 1"
  298. >other positions</t>
  299. </li>
  300. </t>
  301. </xpath>
  302. </field>
  303. </record>
  304. </odoo>