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.

130 lines
7.4 KiB

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <odoo>
  3. <!-- Show always parent_id plus add affiliates -->
  4. <record id="view_partner_form_add_affiliate" model="ir.ui.view">
  5. <field name="model">res.partner</field>
  6. <field eval="1" name="priority" />
  7. <field name="inherit_id" ref="base.view_partner_form" />
  8. <field name="arch" type="xml">
  9. <xpath
  10. expr="/form/sheet//div[hasclass('o_row')]/field[@name='parent_id']"
  11. position="attributes"
  12. >
  13. <attribute name="attrs" />
  14. </xpath>
  15. <xpath expr='//page[@name="internal_notes"]' position="before">
  16. <page
  17. string="Affiliates"
  18. attrs="{'invisible': [('is_company','=',False)]}"
  19. >
  20. <field
  21. name="affiliate_ids"
  22. context="{'default_parent_id': active_id, 'default_is_company': True, 'default_type':'other'}"
  23. mode="kanban"
  24. >
  25. <kanban on_create="base.view_partner_form">
  26. <field name="id" />
  27. <field name="color" />
  28. <field name="name" />
  29. <field name="title" />
  30. <field name="type" />
  31. <field name="email" />
  32. <field name="parent_id" />
  33. <field name="is_company" />
  34. <field name="function" />
  35. <field name="phone" />
  36. <field name="street" />
  37. <field name="street2" />
  38. <field name="zip" />
  39. <field name="city" />
  40. <field name="country_id" />
  41. <field name="mobile" />
  42. <field name="state_id" />
  43. <field name="image_128" />
  44. <field name="lang" />
  45. <!-- fields in form x2many view to diminish requests -->
  46. <field name="comment" />
  47. <field name="display_name" />
  48. <templates>
  49. <t t-name="kanban-box">
  50. <t
  51. t-set="color"
  52. t-value="kanban_color(record.color.raw_value)"
  53. />
  54. <div
  55. t-att-class="color + (record.title.raw_value == 1 ? ' oe_kanban_color_alert' : '') + ' oe_kanban_global_click'"
  56. >
  57. <div class="o_kanban_image">
  58. <img
  59. alt="Contact image"
  60. t-if="record.image_128.raw_value"
  61. t-att-src="kanban_image('res.partner', 'image_128', record.id.raw_value)"
  62. />
  63. <t t-if="!record.image_128.raw_value">
  64. <img
  65. alt="Delivery"
  66. t-if="record.type.raw_value === 'delivery'"
  67. t-att-src='_s + "/base/static/img/truck.png"'
  68. />
  69. <img
  70. alt="Invoice"
  71. t-if="record.type.raw_value === 'invoice'"
  72. t-att-src='_s + "/base/static/img/money.png"'
  73. />
  74. <t
  75. t-if="record.type.raw_value !== 'invoice' &amp;&amp; record.type.raw_value !== 'delivery'"
  76. >
  77. <img
  78. alt="Logo"
  79. t-if="record.is_company.raw_value === true"
  80. t-att-src='_s + "/base/static/img/company_image.png"'
  81. />
  82. <img
  83. alt="Avatar"
  84. t-if="record.is_company.raw_value === false"
  85. t-att-src='_s + "/base/static/img/avatar_grey.png"'
  86. />
  87. </t>
  88. </t>
  89. </div>
  90. <div class="oe_kanban_details">
  91. <field name="name" />
  92. <div t-if="record.function.raw_value"><field
  93. name="function"
  94. /></div>
  95. <div t-if="record.email.raw_value"><field
  96. name="email"
  97. widget="email"
  98. /></div>
  99. <div
  100. t-if="record.type.raw_value != 'contact'"
  101. >
  102. <div>
  103. <field name="zip" />
  104. <field name="city" />
  105. </div>
  106. <field
  107. t-if="record.state_id.raw_value"
  108. name="state_id"
  109. />
  110. <field name="country_id" />
  111. </div>
  112. <div t-if="record.phone.raw_value">Phone: <t
  113. t-esc="record.phone.value"
  114. /></div>
  115. <div
  116. t-if="record.mobile.raw_value"
  117. >Mobile: <t
  118. t-esc="record.mobile.value"
  119. /></div>
  120. </div>
  121. </div>
  122. </t>
  123. </templates>
  124. </kanban>
  125. </field>
  126. </page>
  127. </xpath>
  128. </field>
  129. </record>
  130. </odoo>