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.

527 lines
24 KiB

  1. <?xml version = "1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <!--Add list of functions in partner view-->
  5. <record id="view_contact_by_function_form" model="ir.ui.view">
  6. <field name="name">contact.functions.form.inherit</field>
  7. <field name="model">res.partner</field>
  8. <field name="inherit_id" ref="base.view_partner_form"/>
  9. <field name="arch" type="xml">
  10. <field name="use_parent_address" position="replace">
  11. <field name="use_parent_address"
  12. class="oe_edit_only oe_inline"
  13. on_change="onchange_address(use_parent_address, parent_id)"
  14. attrs="{'invisible': [('parent_id','=', False),('use_parent_address','=',False)]}"
  15. string="Use Organisation Address"/>
  16. </field>
  17. <label for="use_parent_address" position="replace">
  18. <label for="use_parent_address"
  19. class="oe_edit_only"
  20. attrs="{'invisible': [('parent_id','=', False),('use_parent_address','=',False)]}"
  21. string="Use Organisation Address"/>
  22. </label>
  23. <!--Add ')' at the end of 'Is an Organism?'-->
  24. <label for="is_company" position="replace">
  25. <label for="is_company" string="Is an Organism"/>)
  26. </label>
  27. <!--Replace Street placeholder by No, Street, Apartment/Office-->
  28. <field name="street" position="attributes">
  29. <attribute name="placeholder">No, Street, Apartment/Office</attribute>
  30. </field>
  31. <field name="fax" position="attributes">
  32. <attribute name="string">Fax</attribute>
  33. </field>
  34. <notebook position="inside">
  35. <page string="Functions"
  36. attrs="{'invisible': [('is_company','=',False), ('child_ids', '=', [])]}"
  37. autofocus="autofocus">
  38. <separator string="Select Functions for this Organisation"/>
  39. <field name="function_ids"/>
  40. </page>
  41. <page string="History (Functions)" attrs="{'invisible': ['|','|',('is_company','=',True),('contact_id','!=',False),('other_contact_history_ids','=',[])]}">
  42. <separator string="History"/>
  43. <field name="other_contact_history_ids" mode="kanban"
  44. attrs="{'invisible': [('other_contact_history_ids','=',False)]}">
  45. <kanban>
  46. <field name="color"/>
  47. <field name="name"/>
  48. <field name="title"/>
  49. <field name="email"/>
  50. <field name="parent_id" string="Organism"/>
  51. <field name="is_company"/>
  52. <field name="function_id" string="Function"/>
  53. <field name="phone"/>
  54. <field name="street"/>
  55. <field name="street2"/>
  56. <field name="zip"/>
  57. <field name="city"/>
  58. <field name="country_id"/>
  59. <field name="mobile"/>
  60. <field name="fax"/>
  61. <field name="state_id"/>
  62. <field name="has_image"/>
  63. <templates>
  64. <t t-name="kanban-box">
  65. <div class="oe_kanban_vignette oe_semantic_html_override">
  66. <a type="open">
  67. <t t-if="record.has_image.raw_value === true">
  68. <img t-att-src="kanban_image('res.partner', 'image_small', record.id.value)"
  69. class="oe_kanban_image"/>
  70. </t>
  71. <t t-if="record.has_image.raw_value === false">
  72. <t t-if="record.is_company.raw_value === true">
  73. <img t-att-src='_s + "/base/static/src/img/company_image.png"'
  74. class="oe_kanban_image"/>
  75. </t>
  76. <t t-if="record.is_company.raw_value === false">
  77. <img t-att-src='_s + "/base/static/src/img/avatar.png"'
  78. class="oe_kanban_image"/>
  79. </t>
  80. </t>
  81. </a>
  82. <div class="oe_kanban_details">
  83. <h4 class="oe_partner_heading">
  84. <a type="open">
  85. <field name="name"/>
  86. </a>
  87. </h4>
  88. <div class="oe_kanban_partner_categories"/>
  89. <div class="oe_kanban_partner_links"/>
  90. <ul>
  91. <li t-if="!record.parent_id.raw_value and record.function_id.raw_value">
  92. <field name="function_id"/>
  93. </li>
  94. <li t-if="record.parent_id.raw_value and record.function_id.raw_value">
  95. <field name="function_id"/>
  96. ,
  97. <field name="parent_id"/>
  98. </li>
  99. <li t-if="record.city.raw_value and !record.country.raw_value">
  100. <field name="city"/>
  101. </li>
  102. <li t-if="!record.city.raw_value and record.country.raw_value">
  103. <field name="country"/>
  104. </li>
  105. <li t-if="record.city.raw_value and record.country.raw_value">
  106. <field name="city"/>
  107. ,
  108. <field name="country"/>
  109. </li>
  110. <li t-if="record.email.raw_value">
  111. <a t-attf-href="mailto:#{record.email.raw_value}">
  112. <field name="email"/>
  113. </a>
  114. </li>
  115. </ul>
  116. </div>
  117. </div>
  118. </t>
  119. </templates>
  120. </kanban>
  121. <form string="Contact" version="7.0">
  122. <sheet>
  123. <field name="image" widget='image' class="oe_avatar oe_left"
  124. options='{"preview_image": "image_medium"}'/>
  125. <div class="oe_title">
  126. <label for="name" class="oe_edit_only"/>
  127. <h1>
  128. <field name="name" style="width: 70%%"/>
  129. </h1>
  130. </div>
  131. <group>
  132. <!-- inherited part -->
  133. <field name="category_id" widget="many2many_tags"
  134. placeholder="Tags..." style="width: 70%%" string="Tag"/>
  135. <field name="parent_id"
  136. placeholder="Organism"
  137. domain="[('is_company','=',True)]"
  138. string="Parent Organism"/>
  139. <!-- inherited part end -->
  140. <field name="function_id" placeholder="e.g. Sales Director"/>
  141. <group colspan="4">
  142. <field name="start_date" />
  143. <field name="end_date"/>
  144. <field name="naming"/>
  145. </group>
  146. <field name="email"/>
  147. <field name="phone"/>
  148. <field name="mobile"/>
  149. </group>
  150. <div>
  151. <field name="use_parent_address"/>
  152. <label for="use_parent_address" string="Use Organisation Address"/>
  153. </div>
  154. <group>
  155. <label for="type"/>
  156. <div name="div_type">
  157. <field class="oe_inline" name="type"/>
  158. </div>
  159. <label for="street" string="Address"
  160. attrs="{'invisible': [('use_parent_address','=', True)]}"/>
  161. <div attrs="{'invisible': [('use_parent_address','=', True)]}"
  162. name="div_address">
  163. <field name="street" placeholder="Street..."/>
  164. <field name="street2"/>
  165. <div class="address_format">
  166. <field name="city" placeholder="City" style="width: 40%%"/>
  167. <field name="state_id" class="oe_no_button"
  168. placeholder="State" style="width: 37%%"
  169. options='{"no_open": True}' on_change="onchange_state(state_id)"/>
  170. <field name="zip" placeholder="ZIP" style="width: 20%%"/>
  171. </div>
  172. <field name="country_id" placeholder="Country"
  173. class="oe_no_button" options='{"no_open": True}'/>
  174. </div>
  175. </group>
  176. <field name="supplier" invisible="True"/>
  177. <group string="Bank Accounts">
  178. <field name="bank_ids" nolabel="1">
  179. <tree string="Bank Details">
  180. <field name="state" invisible="1"/>
  181. <field name="sequence" invisible="1"/>
  182. <field name="acc_number"/>
  183. <field name="bank_name"/>
  184. <field name="owner_name"/>
  185. </tree>
  186. </field>
  187. </group>
  188. </sheet>
  189. </form>
  190. </field>
  191. </page>
  192. </notebook>
  193. <!--Replace function by function_id defined by Organisation-->
  194. <field name="function" position="replace"/>
  195. </field>
  196. </record>
  197. <!--Add start_date, end_date, naming and account bank in partner view-->
  198. <record id="view_position_info_form" model="ir.ui.view">
  199. <field name="name">position.info.form.inherit</field>
  200. <field name="model">res.partner</field>
  201. <field name="inherit_id" ref="base_contact.view_partner_form_inherit"/>
  202. <field name="arch" type="xml">
  203. <xpath expr="//field[@name='other_contact_ids']/form//field[@name='category_id']"
  204. position="attributes">
  205. <attribute name="string">Tag</attribute>
  206. </xpath>
  207. <xpath expr="//field[@name='other_contact_ids']/form//field[@name='function']"
  208. position="after">
  209. <group colspan="4">
  210. <field name="start_date" />
  211. <field name="end_date"/>
  212. <field name="naming"/>
  213. </group>
  214. </xpath>
  215. <xpath expr="//field[@name='other_contact_ids']/form//field[@name='supplier']"
  216. position="after">
  217. <group string="Bank Accounts">
  218. <field name="bank_ids" nolabel="1"/>
  219. </group>
  220. </xpath>
  221. <xpath expr="//field[@name='other_contact_ids']/form//field[@name='parent_id']"
  222. position="replace">
  223. <group colspan="4">
  224. <field name="parent_id" placeholder="Organism"
  225. domain="[('is_company','=',True)]"
  226. on_change="onchange_partner_function(parent_id)"
  227. string="Parent Organism"/>
  228. </group>
  229. </xpath>
  230. <xpath expr="//field[@name='other_contact_ids']/form//field[@name='function']"
  231. position="replace">
  232. <group colspan="4">
  233. <field name="function_id" string="Function"/>
  234. </group>
  235. </xpath>
  236. <xpath expr="//field[@name='other_contact_ids']/form//label[@for='use_parent_address']"
  237. position="replace">
  238. <label for="use_parent_address"/>
  239. </xpath>
  240. <xpath expr="//field[@name='other_contact_ids']/kanban//field[@name='function']"
  241. position="replace">
  242. <group colspan="4">
  243. <field name="function_id" string="Function"/>
  244. </group>
  245. </xpath>
  246. <xpath expr="//field[@name='other_contact_ids']/kanban//field[@name='has_image']"
  247. position="after">
  248. <templates>
  249. <t t-name="kanban-box">
  250. <t t-set="color" t-value="kanban_color(record.color.raw_value)"/>
  251. <div t-att-class="color + (record.title.raw_value == 1 ? ' oe_kanban_color_alert' : '')"
  252. style="position: relative">
  253. <a t-if="! read_only_mode" type="delete"
  254. style="position: absolute; right: 0; padding: 4px; diplay: inline-block">
  255. X
  256. </a>
  257. <div class="oe_module_vignette">
  258. <a type="open">
  259. <t t-if="record.has_image.raw_value === true">
  260. <img t-att-src="kanban_image('res.partner', 'image',
  261. record.id.value, {'preview_image': 'image_small'})"
  262. class="oe_avatar oe_kanban_avatar_smallbox"/>
  263. </t>
  264. <t t-if="record.image and record.image.raw_value !== false">
  265. <img t-att-src="'data:image/png;base64,'+record.image.raw_value"
  266. class="oe_avatar oe_kanban_avatar_smallbox"/>
  267. </t>
  268. <t t-if="record.has_image.raw_value === false
  269. and (!record.image or record.image.raw_value === false)">
  270. <t t-if="record.is_company.raw_value === true">
  271. <img t-att-src='_s + "/base/static/src/img/company_image.png"'
  272. class="oe_kanban_image oe_kanban_avatar_smallbox"/>
  273. </t>
  274. <t t-if="record.is_company.raw_value === false">
  275. <img t-att-src='_s + "/base/static/src/img/avatar.png"'
  276. class="oe_kanban_image oe_kanban_avatar_smallbox"/>
  277. </t>
  278. </t>
  279. </a>
  280. <div class="oe_module_desc">
  281. <div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_color_border">
  282. <table class="oe_kanban_table">
  283. <tr>
  284. <td class="oe_kanban_title1" align="left" valign="middle">
  285. <h4>
  286. <a type="open">
  287. <field name="name"/>
  288. </a>
  289. </h4>
  290. <i>
  291. <t t-if="record.parent_id.raw_value and !record.function_id.raw_value">
  292. <field name="parent_id"/>
  293. </t>
  294. <t t-if="!record.parent_id.raw_value and record.function_id.raw_value">
  295. <field name="function_id"/>
  296. </t>
  297. <t t-if="record.parent_id.raw_value and record.function_id.raw_value">
  298. <field name="function_id"/>
  299. ,
  300. <field name="parent_id"/>
  301. </t>
  302. </i>
  303. <div>
  304. <a t-if="record.email.raw_value" title="Mail"
  305. t-att-href="'mailto:'+record.email.value">
  306. <field name="email"/>
  307. </a>
  308. </div>
  309. <div t-if="record.phone.raw_value">
  310. Phone: <field name="phone"/>
  311. </div>
  312. <div t-if="record.mobile.raw_value">
  313. Mobile: <field name="mobile"/>
  314. </div>
  315. <div t-if="record.fax.raw_value">
  316. Fax: <field name="fax"/>
  317. </div>
  318. </td>
  319. </tr>
  320. </table>
  321. </div>
  322. </div>
  323. </div>
  324. </div>
  325. </t>
  326. </templates>
  327. </xpath>
  328. have the same form for contact and other postions
  329. <field name="parent_id" position="replace">
  330. <field name="parent_id" placeholder="Parent Organisation"
  331. domain="[('is_company','=',True)]"
  332. attrs="{'invisible': [('is_company','=', False)]}"/>
  333. </field>
  334. <xpath expr="//field[@name='child_ids']/form//field[@name='supplier']"
  335. position="after">
  336. <group string="Bank Accounts">
  337. <field name="bank_ids" nolabel="1"/>
  338. </group>
  339. </xpath>
  340. <xpath expr="//field[@name='child_ids']/form//field[@name='function']"
  341. position="after">
  342. <group colspan="4">
  343. <field name="start_date" />
  344. <field name="end_date"/>
  345. <field name="naming"/>
  346. </group>
  347. </xpath>
  348. <xpath expr="//field[@name='child_ids']/form//field[@name='function']"
  349. position="replace">
  350. <group colspan="4">
  351. <field name="parent_id"
  352. placeholder="Organism"
  353. domain="[('is_company','=',True)]"
  354. string="Parent Organisation" />
  355. <field name="function_id"
  356. readonly="False"
  357. options="{'create': false, 'create_edit': false}"
  358. domain="[('id', 'in', parent.function_ids[0][2])]"
  359. string="Function"/>
  360. </group>
  361. </xpath>
  362. <xpath expr="//field[@name='child_ids']/form//label[@for='use_parent_address']"
  363. position="replace">
  364. <label for="use_parent_address"/>
  365. </xpath>
  366. <xpath expr="//field[@name='child_ids']/kanban//field[@name='function']"
  367. position="replace">
  368. <group colspan="4">
  369. <field name="function_id" string="Function"/>
  370. </group>
  371. </xpath>
  372. <xpath expr="//field[@name='other_contact_ids']/kanban//field[@name='has_image']"
  373. position="after">
  374. <templates>
  375. <t t-name="kanban-box">
  376. <div class="oe_kanban_vignette oe_semantic_html_override">
  377. <a type="open">
  378. <t t-if="record.has_image.raw_value === true">
  379. <img t-att-src="kanban_image('res.partner', 'image_small', record.id.value)"
  380. class="oe_kanban_image"/>
  381. </t>
  382. <t t-if="record.has_image.raw_value === false">
  383. <t t-if="record.is_company.raw_value === true">
  384. <img t-att-src='_s + "/base/static/src/img/company_image.png"'
  385. class="oe_kanban_image"/>
  386. </t>
  387. <t t-if="record.is_company.raw_value === false">
  388. <img t-att-src='_s + "/base/static/src/img/avatar.png"'
  389. class="oe_kanban_image"/>
  390. </t>
  391. </t>
  392. </a>
  393. <div class="oe_kanban_details">
  394. <h4 class="oe_partner_heading">
  395. <a type="open">
  396. <field name="name"/>
  397. </a>
  398. </h4>
  399. <div class="oe_kanban_partner_categories"/>
  400. <div class="oe_kanban_partner_links"/>
  401. <ul>
  402. <li t-if="record.parent_id.raw_value and !record.function_id.raw_value">
  403. <field name="parent_id"/>
  404. </li>
  405. <li t-if="!record.parent_id.raw_value and record.function_id.raw_value">
  406. <field name="function_id"/>
  407. </li>
  408. <li t-if="record.parent_id.raw_value and record.function_id.raw_value">
  409. <field name="function_id"/>
  410. ,
  411. <field name="parent_id"/>
  412. </li>
  413. <li t-if="record.city.raw_value and !record.country.raw_value">
  414. <field name="city"/>
  415. </li>
  416. <li t-if="!record.city.raw_value and record.country.raw_value">
  417. <field name="country"/>
  418. </li>
  419. <li t-if="record.city.raw_value and record.country.raw_value">
  420. <field name="city"/>
  421. ,
  422. <field name="country"/>
  423. </li>
  424. <li t-if="record.email.raw_value">
  425. <a t-attf-href="mailto:#{record.email.raw_value}">
  426. <field name="email"/>
  427. </a>
  428. </li>
  429. </ul>
  430. </div>
  431. </div>
  432. </t>
  433. </templates>
  434. </xpath>
  435. </field>
  436. </record>
  437. <!-- Actions for Organisation -->
  438. <record id="action_partner_customer_form" model="ir.actions.act_window">
  439. <field name="name">Company</field>
  440. <field name="type">ir.actions.act_window</field>
  441. <field name="res_model">res.partner</field>
  442. <field name="view_type">form</field>
  443. <field name="view_mode">kanban,tree,form</field>
  444. <field name="domain">[('is_company','=',1)]</field>
  445. <field name="context" eval="{'default_is_company': True}"/>
  446. <field name="filter" eval="True"/>
  447. </record>
  448. <!-- Actions for Contacts -->
  449. <record id="action_partner_contact_form" model="ir.actions.act_window">
  450. <field name="name">Contacts</field>
  451. <field name="type">ir.actions.act_window</field>
  452. <field name="res_model">res.partner</field>
  453. <field name="view_type">form</field>
  454. <field name="view_mode">kanban,tree,form</field>
  455. <field name="domain">[('is_company','=',0)]</field>
  456. <field name="filter" eval="True"/>
  457. </record>
  458. <!--Add country,street fields in tree partner view-->
  459. <record model="ir.ui.view" id="view_partner_tree_country_address">
  460. <field name="model">res.partner</field>
  461. <field name="inherit_id" ref="base.view_partner_tree"/>
  462. <field name="arch" type="xml">
  463. <field name="country_id" position="replace"/>
  464. <field name="name" position="after">
  465. <field name="country_id"/>
  466. </field>
  467. <field name="email" position="after">
  468. <field name="street" string="Address"/>
  469. </field>
  470. </field>
  471. </record>
  472. <!-- Inherit Categories adding functions -->
  473. <record id="view_partner_category_functions_form" model="ir.ui.view">
  474. <field name="name">Partner Categories Functions</field>
  475. <field name="model">res.partner.category</field>
  476. <field name="inherit_id" ref="base.view_partner_category_form"/>
  477. <field name="arch" type="xml">
  478. <xpath expr="//form[@string='Partner Category']/group[1]"
  479. position="after">
  480. <notebook position="inside">
  481. <page string="Functions">
  482. <separator string="Add function"/>
  483. <group col="2" colspan="4">
  484. <field name="category_function_ids" nolabel="1">
  485. <tree string="Functions">
  486. <field name="sequence"/>
  487. <field name="function_id"/>
  488. </tree>
  489. <form string="Function">
  490. <field name="function_id"/>
  491. <field name="sequence"/>
  492. </form>
  493. </field>
  494. </group>
  495. </page>
  496. </notebook>
  497. </xpath>
  498. </field>
  499. </record>
  500. <!--Replace company by Organisation-->
  501. <record id="view_partner_simple_form" model="ir.ui.view">
  502. <field name="name">res.partner.simplified.form</field>
  503. <field name="model">res.partner</field>
  504. <field name="arch" type="xml">
  505. <label for="is_company" position="replace">
  506. <label for="is_company" string="Is an Organism"/>
  507. </label>
  508. <field name="parent_id" position="replace">
  509. <field name="parent_id"
  510. placeholder="Organism"
  511. domain="[('is_company', '=', True)]"
  512. context="{'default_is_company': True, 'default_supplier': supplier}"
  513. attrs="{'invisible': [('is_company','=', True),('parent_id', '=', False)]}"
  514. on_change="onchange_address(use_parent_address, parent_id)"/>
  515. </field>
  516. </field>
  517. </record>
  518. </data>
  519. </openerp>