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.

526 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. domain="[('id', 'in', parent.function_ids[0][2])]"
  358. string="Function"/>
  359. </group>
  360. </xpath>
  361. <xpath expr="//field[@name='child_ids']/form//label[@for='use_parent_address']"
  362. position="replace">
  363. <label for="use_parent_address"/>
  364. </xpath>
  365. <xpath expr="//field[@name='child_ids']/kanban//field[@name='function']"
  366. position="replace">
  367. <group colspan="4">
  368. <field name="function_id" string="Function"/>
  369. </group>
  370. </xpath>
  371. <xpath expr="//field[@name='other_contact_ids']/kanban//field[@name='has_image']"
  372. position="after">
  373. <templates>
  374. <t t-name="kanban-box">
  375. <div class="oe_kanban_vignette oe_semantic_html_override">
  376. <a type="open">
  377. <t t-if="record.has_image.raw_value === true">
  378. <img t-att-src="kanban_image('res.partner', 'image_small', record.id.value)"
  379. class="oe_kanban_image"/>
  380. </t>
  381. <t t-if="record.has_image.raw_value === false">
  382. <t t-if="record.is_company.raw_value === true">
  383. <img t-att-src='_s + "/base/static/src/img/company_image.png"'
  384. class="oe_kanban_image"/>
  385. </t>
  386. <t t-if="record.is_company.raw_value === false">
  387. <img t-att-src='_s + "/base/static/src/img/avatar.png"'
  388. class="oe_kanban_image"/>
  389. </t>
  390. </t>
  391. </a>
  392. <div class="oe_kanban_details">
  393. <h4 class="oe_partner_heading">
  394. <a type="open">
  395. <field name="name"/>
  396. </a>
  397. </h4>
  398. <div class="oe_kanban_partner_categories"/>
  399. <div class="oe_kanban_partner_links"/>
  400. <ul>
  401. <li t-if="record.parent_id.raw_value and !record.function_id.raw_value">
  402. <field name="parent_id"/>
  403. </li>
  404. <li t-if="!record.parent_id.raw_value and record.function_id.raw_value">
  405. <field name="function_id"/>
  406. </li>
  407. <li t-if="record.parent_id.raw_value and record.function_id.raw_value">
  408. <field name="function_id"/>
  409. ,
  410. <field name="parent_id"/>
  411. </li>
  412. <li t-if="record.city.raw_value and !record.country.raw_value">
  413. <field name="city"/>
  414. </li>
  415. <li t-if="!record.city.raw_value and record.country.raw_value">
  416. <field name="country"/>
  417. </li>
  418. <li t-if="record.city.raw_value and record.country.raw_value">
  419. <field name="city"/>
  420. ,
  421. <field name="country"/>
  422. </li>
  423. <li t-if="record.email.raw_value">
  424. <a t-attf-href="mailto:#{record.email.raw_value}">
  425. <field name="email"/>
  426. </a>
  427. </li>
  428. </ul>
  429. </div>
  430. </div>
  431. </t>
  432. </templates>
  433. </xpath>
  434. </field>
  435. </record>
  436. <!-- Actions for Organisation -->
  437. <record id="action_partner_customer_form" model="ir.actions.act_window">
  438. <field name="name">Company</field>
  439. <field name="type">ir.actions.act_window</field>
  440. <field name="res_model">res.partner</field>
  441. <field name="view_type">form</field>
  442. <field name="view_mode">kanban,tree,form</field>
  443. <field name="domain">[('is_company','=',1)]</field>
  444. <field name="context" eval="{'default_is_company': True}"/>
  445. <field name="filter" eval="True"/>
  446. </record>
  447. <!-- Actions for Contacts -->
  448. <record id="action_partner_contact_form" model="ir.actions.act_window">
  449. <field name="name">Contacts</field>
  450. <field name="type">ir.actions.act_window</field>
  451. <field name="res_model">res.partner</field>
  452. <field name="view_type">form</field>
  453. <field name="view_mode">kanban,tree,form</field>
  454. <field name="domain">[('is_company','=',0)]</field>
  455. <field name="filter" eval="True"/>
  456. </record>
  457. <!--Add country,street fields in tree partner view-->
  458. <record model="ir.ui.view" id="view_partner_tree_country_address">
  459. <field name="model">res.partner</field>
  460. <field name="inherit_id" ref="base.view_partner_tree"/>
  461. <field name="arch" type="xml">
  462. <field name="country_id" position="replace"/>
  463. <field name="name" position="after">
  464. <field name="country_id"/>
  465. </field>
  466. <field name="email" position="after">
  467. <field name="street" string="Address"/>
  468. </field>
  469. </field>
  470. </record>
  471. <!-- Inherit Categories adding functions -->
  472. <record id="view_partner_category_functions_form" model="ir.ui.view">
  473. <field name="name">Partner Categories Functions</field>
  474. <field name="model">res.partner.category</field>
  475. <field name="inherit_id" ref="base.view_partner_category_form"/>
  476. <field name="arch" type="xml">
  477. <xpath expr="//form[@string='Partner Category']/group[1]"
  478. position="after">
  479. <notebook position="inside">
  480. <page string="Functions">
  481. <separator string="Add function"/>
  482. <group col="2" colspan="4">
  483. <field name="category_function_ids" nolabel="1">
  484. <tree string="Functions">
  485. <field name="sequence"/>
  486. <field name="function_id"/>
  487. </tree>
  488. <form string="Function">
  489. <field name="function_id"/>
  490. <field name="sequence"/>
  491. </form>
  492. </field>
  493. </group>
  494. </page>
  495. </notebook>
  496. </xpath>
  497. </field>
  498. </record>
  499. <!--Replace company by Organisation-->
  500. <record id="view_partner_simple_form" model="ir.ui.view">
  501. <field name="name">res.partner.simplified.form</field>
  502. <field name="model">res.partner</field>
  503. <field name="arch" type="xml">
  504. <label for="is_company" position="replace">
  505. <label for="is_company" string="Is an Organism"/>
  506. </label>
  507. <field name="parent_id" position="replace">
  508. <field name="parent_id"
  509. placeholder="Organism"
  510. domain="[('is_company', '=', True)]"
  511. context="{'default_is_company': True, 'default_supplier': supplier}"
  512. attrs="{'invisible': [('is_company','=', True),('parent_id', '=', False)]}"
  513. on_change="onchange_address(use_parent_address, parent_id)"/>
  514. </field>
  515. </field>
  516. </record>
  517. </data>
  518. </openerp>