Guest User

Untitled

a guest
Mar 29th, 2019
173
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?xml version="1.0"?>
  2. <form string="Partners">
  3. <sheet>
  4. <div class="oe_button_box" name="button_box">
  5. <button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive">
  6. <field name="active" widget="boolean_button" options="{&quot;terminology&quot;: &quot;archive&quot;}"/>
  7. </button>
  8. </div>
  9. <field name="image" widget="image" class="oe_avatar" options="{&quot;preview_image&quot;: &quot;image_medium&quot;, &quot;size&quot;: [90, 90]}"/>
  10. <div class="oe_title">
  11. <field name="is_company" invisible="1"/>
  12. <field name="commercial_partner_id" invisible="1"/>
  13. <field name="company_type" widget="radio" class="oe_edit_only" options="{'horizontal': true}"/>
  14. <h1>
  15. <field name="name" default_focus="1" placeholder="Name" attrs="{'required' : [('type', '=', 'contact')]}"/>
  16. </h1>
  17. <div class="o_row">
  18. <field name="parent_id" widget="res_partner_many2one" placeholder="Company" domain="[('is_company', '=', True)]" context="{'default_is_company': True, 'default_supplier': supplier, 'default_customer': customer, 'show_vat': True}" attrs="{'invisible': ['|', '&amp;', ('is_company','=', True),('parent_id', '=', False),('company_name', '!=', False),('company_name', '!=', '')]}"/>
  19. <field name="company_name" attrs="{'invisible': ['|', '|', ('company_name', '=', False), ('company_name', '=', ''), ('is_company', '=', True)]}"/>
  20. <button name="create_company" type="object" class="oe_edit_only btn-link" attrs="{'invisible': ['|', '|', ('is_company','=', True), ('company_name', '=', ''), ('company_name', '=', False)]}">
  21. <span class="fa fa-plus-square"/>
  22. Create company
  23. </button>
  24. </div>
  25. </div>
  26.  
  27. <group>
  28. <group>
  29. <field name="type" attrs="{'invisible': [('parent_id','=', False)]}" groups="base.group_no_one"/>
  30. <label for="street" string="Address"/>
  31. <div class="o_address_format">
  32. <div attrs="{'invisible': ['|', ('parent_id', '=', False), ('type', '!=', 'contact')]}" class="oe_edit_only"><b>Company Address:</b></div>
  33. <field name="street" placeholder="Street..." class="o_address_street" attrs="{'readonly': [('type', '=', 'contact'),('parent_id', '!=', False)]}"/>
  34. <field name="street2" placeholder="Street 2..." class="o_address_street" attrs="{'readonly': [('type', '=', 'contact'),('parent_id', '!=', False)]}"/>
  35. <field name="city" placeholder="City" class="o_address_city" attrs="{'readonly': [('type', '=', 'contact'),('parent_id', '!=', False)]}"/>
  36. <field name="state_id" class="o_address_state" placeholder="State" options="{&quot;no_open&quot;: True}" attrs="{'readonly': [('type', '=', 'contact'),('parent_id', '!=', False)]}" context="{'country_id': country_id, 'zip': zip}"/>
  37. <field name="zip" placeholder="ZIP" class="o_address_zip" attrs="{'readonly': [('type', '=', 'contact'),('parent_id', '!=', False)]}"/>
  38. <field name="country_id" placeholder="Country" class="o_address_country" options="{&quot;no_open&quot;: True, &quot;no_create&quot;: True}" attrs="{'readonly': [('type', '=', 'contact'),('parent_id', '!=', False)]}"/>
  39. </div>
  40. <field name="vat" placeholder="e.g. BE0477472701" attrs="{'readonly': [('parent_id','!=',False)]}"/>
  41. </group>
  42. <group>
  43. <field name="function" placeholder="e.g. Sales Director" attrs="{'invisible': [('is_company','=', True)]}"/>
  44. <field name="phone" widget="phone"/>
  45. <field name="mobile" widget="phone"/>
  46. <field name="user_ids" invisible="1"/>
  47. <field name="email" widget="email" context="{'gravatar_image': True}" attrs="{'required': [('user_ids','!=', [])]}"/>
  48. <field name="website" widget="url" placeholder="e.g. www.odoo.com"/>
  49. <field name="title" options="{&quot;no_open&quot;: True}" attrs="{'invisible': [('is_company', '=', True)]}"/>
  50. <field name="lang"/>
  51. <field name="category_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}" placeholder="Tags..."/>
  52. </group>
  53. </group>
  54.  
  55. <notebook colspan="4">
  56. <page string="Contacts &amp; Addresses" autofocus="autofocus">
  57. <field name="child_ids" mode="kanban" context="{'default_parent_id': active_id, 'default_street': street, 'default_street2': street2, 'default_city': city, 'default_state_id': state_id, 'default_zip': zip, 'default_country_id': country_id, 'default_supplier': supplier, 'default_customer': customer, 'default_lang': lang, 'default_user_id': user_id}">
  58. <kanban>
  59. <field name="id"/>
  60. <field name="color"/>
  61. <field name="name"/>
  62. <field name="title"/>
  63. <field name="type"/>
  64. <field name="email"/>
  65. <field name="parent_id"/>
  66. <field name="is_company"/>
  67. <field name="function"/>
  68. <field name="phone"/>
  69. <field name="street"/>
  70. <field name="street2"/>
  71. <field name="zip"/>
  72. <field name="city"/>
  73. <field name="country_id"/>
  74. <field name="mobile"/>
  75. <field name="state_id"/>
  76. <field name="image_small"/>
  77. <field name="lang"/>
  78. <!-- fields in form x2many view to diminish requests -->
  79. <field name="comment"/>
  80. <field name="customer"/>
  81. <field name="display_name"/>
  82. <field name="supplier"/>
  83. <templates>
  84. <t t-name="kanban-box">
  85. <t t-set="color" t-value="kanban_color(record.color.raw_value)"/>
  86. <div t-att-class="color + (record.title.raw_value == 1 ? ' oe_kanban_color_alert' : '') + ' oe_kanban_global_click'">
  87. <div class="o_kanban_image">
  88. <img alt="" t-if="record.image_small.raw_value" t-att-src="kanban_image('res.partner', 'image_small', record.id.raw_value)"/>
  89. <t t-if="!record.image_small.raw_value">
  90. <img alt="Delivery" t-if="record.type.raw_value === 'delivery'" t-att-src="_s + &quot;/base/static/img/truck.png&quot;"/>
  91. <img alt="Invoice" t-if="record.type.raw_value === 'invoice'" t-att-src="_s + &quot;/base/static/img/money.png&quot;"/>
  92. <t t-if="record.type.raw_value !== 'invoice' &amp;&amp; record.type.raw_value !== 'delivery'">
  93. <img alt="Logo" t-if="record.is_company.raw_value === true" t-att-src="_s + &quot;/base/static/img/company_image.png&quot;"/>
  94. <img alt="Avatar" t-if="record.is_company.raw_value === false" t-att-src="_s + &quot;/base/static/img/avatar.png&quot;"/>
  95. </t>
  96. </t>
  97. </div>
  98. <div class="oe_kanban_details">
  99. <field name="name"/>
  100. <div t-if="record.function.raw_value"><field name="function"/></div>
  101. <div t-if="record.email.raw_value"><field name="email" widget="email"/></div>
  102. <div t-if="record.type.raw_value != 'contact'">
  103. <div>
  104. <field name="zip"/>
  105. <field name="city"/>
  106. </div>
  107. <field t-if="record.state_id.raw_value" name="state_id"/>
  108. <field name="country_id"/>
  109. </div>
  110. <div t-if="record.phone.raw_value">Phone: <field name="phone"/></div>
  111. <div t-if="record.mobile.raw_value">Mobile: <field name="mobile"/></div>
  112. </div>
  113. </div>
  114. </t>
  115. </templates>
  116. </kanban>
  117. <form string="Contact / Address">
  118. <sheet>
  119. <!-- parent_id and type fields needed in attrs in base_address_city module which overwrites
  120. _fields_view_get() of partner. It would be better to put those fields there but the web client
  121. dosen't support when a field is displayed several times in the same view.-->
  122. <field name="type" required="1" widget="radio" options="{'horizontal': true}"/>
  123. <field name="parent_id" invisible="1"/>
  124. <hr/>
  125. <group>
  126. <group attrs="{'invisible': [('type','=', 'contact')]}">
  127. <label for="street" string="Address"/>
  128. <div>
  129. <div class="o_address_format" name="div_address">
  130. <field name="street" placeholder="Street..." class="o_address_street"/>
  131. <field name="street2" placeholder="Street 2..." class="o_address_street"/>
  132. <field name="city" placeholder="City" class="o_address_city"/>
  133. <field name="state_id" class="o_address_state" placeholder="State" options="{&quot;no_open&quot;: True}" context="{'country_id': country_id, 'zip': zip}"/>
  134. <field name="zip" placeholder="ZIP" class="o_address_zip"/>
  135. <field name="country_id" placeholder="Country" class="o_address_country" options="{&quot;no_open&quot;: True, &quot;no_create&quot;: True}"/>
  136. </div>
  137. </div>
  138. </group>
  139. <group>
  140. <field name="name" string="Contact Name" attrs="{'required' : [('type', '=', 'contact')]}"/>
  141. <field name="title" placeholder="e.g. Mr." attrs="{'invisible': [('type','!=', 'contact')]}"/>
  142. <field name="function" placeholder="e.g. Sales Director" attrs="{'invisible': [('type','!=', 'contact')]}"/>
  143. <field name="email"/>
  144. <field name="phone" widget="phone"/>
  145. <field name="mobile" widget="phone"/>
  146. <field name="comment" placeholder="internal note..."/>
  147. </group>
  148. </group>
  149. <field name="supplier" invisible="True"/>
  150. <field name="customer" invisible="True"/>
  151. <field name="lang" invisible="True"/>
  152. <field name="image" invisible="True"/>
  153. <field name="user_id" invisible="True"/>
  154. </sheet>
  155. </form>
  156. </field>
  157. </page>
  158. <page name="internal_notes" string="Internal Notes">
  159. <field name="comment" placeholder="Internal note..."/>
  160. </page>
  161. <page name="sales_purchases" string="Sales &amp; Purchases">
  162. <group name="container_row_2">
  163. <group string="Sales" name="sale" priority="1">
  164. <field name="customer"/>
  165. <field name="user_id"/>
  166. </group>
  167. <group string="Purchase" name="purchase" priority="2">
  168. <field name="supplier"/>
  169. </group>
  170. <group string="Misc">
  171. <field name="ref"/>
  172. <field name="barcode"/>
  173. <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
  174. <field name="industry_id" attrs="{'invisible': [('is_company', '=', False)]}" options="{'no_create': True}"/>
  175. </group>
  176. </group>
  177. </page>
  178. </notebook>
  179. </sheet>
  180. </form>
RAW Paste Data