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.

83 lines
5.3 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 expr="/form/sheet//div[hasclass('o_row')]/field[@name='parent_id']" position="attributes">
  10. <attribute name="attrs"></attribute>
  11. </xpath>
  12. <xpath expr='//page[@name="internal_notes"]' position="before">
  13. <page string="Affiliates" attrs="{'invisible': [('is_company','=',False)]}">
  14. <field name="affiliate_ids"
  15. context="{'default_parent_id': active_id, 'default_is_company': True, 'default_type':'other'}" mode="kanban">
  16. <kanban on_create="base.view_partner_form">
  17. <field name="id"/>
  18. <field name="color"/>
  19. <field name="name"/>
  20. <field name="title"/>
  21. <field name="type"/>
  22. <field name="email"/>
  23. <field name="parent_id"/>
  24. <field name="is_company"/>
  25. <field name="function"/>
  26. <field name="phone"/>
  27. <field name="street"/>
  28. <field name="street2"/>
  29. <field name="zip"/>
  30. <field name="city"/>
  31. <field name="country_id"/>
  32. <field name="mobile"/>
  33. <field name="state_id"/>
  34. <field name="image_small"/>
  35. <field name="lang"/>
  36. <!-- fields in form x2many view to diminish requests -->
  37. <field name="comment"/>
  38. <field name="customer"/>
  39. <field name="display_name"/>
  40. <field name="supplier"/>
  41. <templates>
  42. <t t-name="kanban-box">
  43. <t t-set="color" t-value="kanban_color(record.color.raw_value)"/>
  44. <div t-att-class="color + (record.title.raw_value == 1 ? ' oe_kanban_color_alert' : '') + ' oe_kanban_global_click'">
  45. <a t-if="!read_only_mode" type="delete" class="fa fa-times pull-right"/>
  46. <div class="o_kanban_image">
  47. <img alt="" t-if="record.image_small.raw_value" t-att-src="kanban_image('res.partner', 'image_small', record.id.raw_value)"/>
  48. <t t-if="!record.image_small.raw_value">
  49. <img alt="Delivery" t-if="record.type.raw_value === 'delivery'" t-att-src='_s + "/base/static/img/truck.png"'/>
  50. <img alt="Invoice" t-if="record.type.raw_value === 'invoice'" t-att-src='_s + "/base/static/img/money.png"'/>
  51. <t t-if="record.type.raw_value !== 'invoice' &amp;&amp; record.type.raw_value !== 'delivery'">
  52. <img alt="Logo" t-if="record.is_company.raw_value === true" t-att-src='_s + "/base/static/img/company_image.png"'/>
  53. <img alt="Avatar" t-if="record.is_company.raw_value === false" t-att-src='_s + "/base/static/img/avatar.png"'/>
  54. </t>
  55. </t>
  56. </div>
  57. <div class="oe_kanban_details">
  58. <field name="name"/>
  59. <div t-if="record.function.raw_value"><field name="function"/></div>
  60. <div t-if="record.email.raw_value"><field name="email" widget="email"/></div>
  61. <div t-if="record.type.raw_value != 'contact'">
  62. <div>
  63. <field name="zip"/>
  64. <field name="city"/>
  65. </div>
  66. <field t-if="record.state_id.raw_value" name="state_id"/>
  67. <field name="country_id"/>
  68. </div>
  69. <div t-if="record.phone.raw_value">Phone: <field name="phone"/></div>
  70. <div t-if="record.mobile.raw_value">Mobile: <field name="mobile"/></div>
  71. </div>
  72. </div>
  73. </t>
  74. </templates>
  75. </kanban>
  76. </field>
  77. </page>
  78. </xpath>
  79. </field>
  80. </record>
  81. </odoo>