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.

298 lines
18 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. <?xml version="1.0"?>
  2. <odoo>
  3. <!-- Agreement List View-->
  4. <record model="ir.ui.view" id="partner_agreement_list_view">
  5. <field name="name">Agreement List</field>
  6. <field name="model">agreement</field>
  7. <field name="arch" type="xml">
  8. <tree default_order='name'>
  9. <field name="name"/>
  10. <field name="customer_id"/>
  11. <field name="vendor_id"/>
  12. <field name="parent_agreement_id"/>
  13. <field name="agreement_type_id"/>
  14. <field name="agreement_subtype_id"/>
  15. <field name="active" invisible="1"/>
  16. </tree>
  17. </field>
  18. </record>
  19. <!-- Agreement Form View -->
  20. <record model="ir.ui.view" id="partner_agreement_form_view">
  21. <field name="name">Agreement Form</field>
  22. <field name="model">agreement</field>
  23. <field name="arch" type="xml">
  24. <form string="Agreements Form">
  25. <header>
  26. <button string="New Version" type="object" name="create_new_version" class="oe_highlight" attrs="{'invisible': [('state', '=', 'active')]}"/>
  27. <button string="New Agreement" type="object" name="create_new_agreement" class="oe_highlight" attrs="{'invisible': [('is_template', '=', False)]}"/>
  28. <field name="state" widget="statusbar" clickable="True" options="{'fold_field': 'fold'}"/>
  29. </header>
  30. <sheet>
  31. <div class="oe_title">
  32. <label for="name" class="oe_edit_only" string="Agreement Name"/>
  33. <h1>
  34. <field name="name"/>
  35. </h1>
  36. </div>
  37. <group string="General" colspan="2" col="4">
  38. <field name="contract_id" string="Internal ID"/>
  39. <field name="stage_id" widget="selection" requried="True"/>
  40. <field name="parent_agreement_id" domain="[('customer_id', '=', customer_id)]"/>
  41. <field name="agreement_type_id" widget="selection" requried="True"/>
  42. <field name="assigned_user_id" attrs="{'invisible': [('is_template', '=', True)], 'readonly':[('is_template', '=', True)]}"/>
  43. <field name="agreement_subtype_id" widget="selection" domain="[('agreement_type_id', '=', agreement_type_id)]"/>
  44. <field name="active" invisible="1"/>
  45. </group>
  46. <group>
  47. <field name="description" string="Description" requried="True"/>
  48. </group>
  49. <group name="customer_vendor_information">
  50. <group name="customer_left" string="Customer Information">
  51. <div class="o_address_format">
  52. <field name="customer_id" domain="[('customer', '=', True)]"/>
  53. <field name="customer_street" placeholder="Street..." class="o_address_street" readonly="1"/>
  54. <field name="customer_street2" placeholder="Street 2..." class="o_address_street" readonly="1"/>
  55. <field name="customer_city" placeholder="City" class="o_address_city" readonly="1"/>
  56. <field name="customer_state_id" class="o_address_state" placeholder="State" options="{&quot;no_open&quot;: True}" readonly="1"/>
  57. <field name="customer_zip" placeholder="ZIP" class="o_address_zip" readonly="1"/>
  58. </div>
  59. </group>
  60. <group name="vendor_right" string="Vendor Information">
  61. <div class="o_address_format">
  62. <field name="vendor_id" domain="[('supplier', '=', True)]"/>
  63. <field name="vendor_street" placeholder="Street..." class="o_address_street" readonly="1"/>
  64. <field name="vendor_street2" placeholder="Street 2..." class="o_address_street" readonly="1"/>
  65. <field name="vendor_city" placeholder="City" class="o_address_city" readonly="1"/>
  66. <field name="vendor_state_id" class="o_address_state" placeholder="State" options="{&quot;no_open&quot;: True}" readonly="1"/>
  67. <field name="vendor_zip" placeholder="ZIP" class="o_address_zip" readonly="1"/>
  68. </div>
  69. </group>
  70. <group name="contact_left" string="Primary Contact">
  71. <field name="customer_contact_id" domain="[('parent_id', '=', customer_id)]" nolabel="1"/>
  72. <field name="customer_contact_phone" widget="phone" readonly="1" nolabel="1"/>
  73. <field name="customer_contact_email" widget="email" readonly="1" nolabel="1"/>
  74. </group>
  75. <group name="contact_right" string="Primary Contact">
  76. <field name="vendor_contact_id" domain="[('parent_id', '=', vendor_id)]" nolabel="1"/>
  77. <field name="vendor_contact_phone" widget="phone" readonly="1" nolabel="1"/>
  78. <field name="vendor_contact_email" widget="email" readonly="1" nolabel="1"/>
  79. </group>
  80. </group>
  81. <group name="term_information">
  82. <group name="termdates_left" string="Term Dates">
  83. <field name="start_date" requried="True" attrs="{'required': [('is_template', '=', False)], 'readonly':[('is_template', '=', True)]}"/>
  84. <field name="end_date" requried="True" attrs="{'required': [('is_template', '=', False)], 'readonly':[('is_template', '=', True)]}"/>
  85. <field name="expiration_notice"/>
  86. <field name="change_notice"/>
  87. <field name="notification_address_id" domain="['|',('parent_id','=',customer_id),('parent_id','=',vendor_id)]"/>
  88. <field name="termination_requested"/>
  89. <field name="termination_date"/>
  90. </group>
  91. <group name="paymentterm_right" string="Payment Terms">
  92. <field name="customer_term" attrs="{'invisible': [('customer_id', '=', False)]}"/>
  93. <field name="vendor_term" attrs="{'invisible': [('vendor_id', '=', False)]}"/>
  94. <field name="payment_term_id" widget="selection"/>
  95. <field name="renewal_type_id" widget="selection"/>
  96. <field name="increase_type_id" widget="selection"/>
  97. </group>
  98. </group>
  99. <group>
  100. <field name="special_terms"/>
  101. </group>
  102. <notebook>
  103. <page name="contract_document" string="Contract Document">
  104. <div>
  105. <button name="%(partner_agreement_contract_document_preview)d" string="Preview" type="action" class="oe_highlight"/>
  106. <button name="%(partner_agreement_contract_document)d" string="Print" type="action" class="oe_highlight"/>
  107. </div>
  108. <group colspan="2" col="4">
  109. <field name="customer_signed_date"/>
  110. <field name="company_signed_date"/>
  111. <field name="customer_signed_user_id" domain="[('parent_id', '=', customer_id)]"/>
  112. <field name="company_signed_user_id"/>
  113. <field name="signed_contract" filename="signed_contract_filename"/>
  114. <field name="signed_contract_filename" invisible="1"/>
  115. </group>
  116. <group colspan="2" col="2" default_order='section_sequence'>
  117. <field name="sections_ids" string="Contract Sections" context="{'default_agreement': active_id}">
  118. <tree default_order='section_sequence'>
  119. <field name="section_sequence" widget="handle"/>
  120. <field name="name"/>
  121. </tree>
  122. </field>
  123. </group>
  124. <group colspan="2" col="2" default_order='section_id, clause_sequence'>
  125. <field name="clauses_ids" string="Contract Clauses" context="{'default_agreement': active_id}">
  126. <tree default_order='section_id, clause_sequence'>
  127. <field name="clause_sequence" widget="handle"/>
  128. <field name="section_id"/>
  129. <field name="name"/>
  130. </tree>
  131. </field>
  132. </group>
  133. </page>
  134. <page name="products" string="MRC and NRC Products">
  135. <group string="Financial Details" colspan="2" col="4">
  136. <field name="total_company_mrc"/>
  137. <field name="total_customer_mrc"/>
  138. <field name="total_company_nrc"/>
  139. <field name="total_customer_nrc"/>
  140. <field name="currency_id"/>
  141. <field name="contract_value" readonly="1"/>
  142. </group>
  143. <group>
  144. <field name="sale_order_id" domain="[('partner_id', '=', customer_id)]"/>
  145. </group>
  146. <group string="Sales Order Lines">
  147. <field name="order_lines_services_ids" nolabel="1" readonly="1"/>
  148. </group>
  149. </page>
  150. <page colspan="2" col="4" name="child_agreements" string="Child Agreements">
  151. <field name="child_agreements_ids">
  152. <tree default_order='version desc'>
  153. <field name="name"/>
  154. <field name="version"/>
  155. <field name="revision"/>
  156. </tree>
  157. </field>
  158. </page>
  159. <page colspan="2" col="4" name="old_versions" string="Revisions">
  160. <field name="previous_version_agreements_ids" string="Previouse Versions">
  161. <tree default_order='version desc'>
  162. <field name="name"/>
  163. <field name="version"/>
  164. <field name="revision"/>
  165. </tree>
  166. </field>
  167. </page>
  168. <page colspan="2" col="4" name="peformance" string="Performance">
  169. <p>This section is a place where finincial records will show the current performance of this agreement. </p>
  170. <p>Perhaps include invoices with total vs costs? </p>
  171. </page>
  172. </notebook>
  173. <group colspan="2" col="4" string="Administration">
  174. <field name="reviewed_date"/>
  175. <field name="approved_date"/>
  176. <field name="reviewed_user_id"/>
  177. <field name="approved_user_id"/>
  178. <field name="is_template"/>
  179. </group>
  180. <footer>
  181. Version: <field name="version" readonly="True"/>.<field name="revision" readonly="True"/>
  182. | Created By: <field name="create_uid" readonly="True"/>
  183. | Created On: <field name="create_date" readonly="True"/>
  184. </footer>
  185. </sheet>
  186. <div class="oe_chatter">
  187. <field name="message_follower_ids" widget="mail_followers"/>
  188. <field name="message_ids" widget="mail_thread"/>
  189. </div>
  190. </form>
  191. </field>
  192. </record>
  193. <!-- Agreement Kanban View -->
  194. <record id="view_project_agreement_kanban" model="ir.ui.view">
  195. <field name="name">Agreement Kanban</field>
  196. <field name="model">agreement</field>
  197. <field name="arch" type="xml">
  198. <kanban default_group_by="stage_id">
  199. <field name="color"/>
  200. <field name="assigned_user_id"/>
  201. <templates>
  202. <t t-name="kanban-box">
  203. <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
  204. <div class="oe_kanban_content">
  205. <div class="o_kanban_record_top">
  206. <div class="o_kanban_record_headings">
  207. <strong class="o_kanban_record_title">
  208. <field name="name"/>
  209. </strong><br/>
  210. <div class="o_kanban_record_subtitle text-muted">
  211. <field name="customer_id" invisible="context.get('default_customer_id', False)"/>
  212. <t t-if="record.start_date.raw_value and record.start_date.raw_value lt (new Date())" t-set="red">oe_kanban_text_red</t>
  213. <div t-attf-class="#{red || ''}">
  214. <i><field name="start_date"/></i>
  215. </div>
  216. </div>
  217. </div>
  218. <div class="o_dropdown_kanban dropdown" groups="base.group_user">
  219. <a class="dropdown-toggle btn" data-toggle="dropdown" href="#">
  220. <span class="fa fa-ellipsis-v" aria-hidden="true"/>
  221. </a>
  222. <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
  223. <li t-if="widget.editable"><a type="edit">Edit</a></li>
  224. <li class="divider"/>
  225. <li class="dropdown-header">Record's Colour</li>
  226. <li>
  227. <ul class="oe_kanban_colorpicker" data-field="color"/>
  228. </li>
  229. </ul>
  230. </div>
  231. </div>
  232. <div class="o_kanban_record_body">
  233. <field name="agreement_type_id"/> - <field name="agreement_subtype_id"/>
  234. </div>
  235. <div class="o_kanban_record_bottom">
  236. <div class="oe_kanban_bottom_left">
  237. V: <field name="version"/>
  238. </div>
  239. <div class="oe_kanban_bottom_right">
  240. <img t-att-src="kanban_image('res.users', 'image_small', record.assigned_user_id.raw_value)" t-att-title="record.assigned_user_id.value" width="36" height="36" class="oe_kanban_avatar"/>
  241. </div>
  242. </div>
  243. </div>
  244. <div class="oe_clear"/>
  245. </div>
  246. </t>
  247. </templates>
  248. </kanban>
  249. </field>
  250. </record>
  251. <!-- Agreement Search View -->
  252. <record model="ir.ui.view" id="partner_agreement_search_view">
  253. <field name="name">Agreement Search</field>
  254. <field name="model">agreement</field>
  255. <field name="arch" type="xml">
  256. <search string="Agreement Search">
  257. <filter name="filter_non_template" string="Non-Templates" domain="[('active','=',True),('is_template', '=', False)]"/>
  258. <filter name="filter_inactive" string="Archived" domain="[('active','=',False)]"/>
  259. <filter name="filter_templates" string="Templates" domain="[('active','=',True),('is_template', '=', True)]"/>
  260. <filter name="group_customer_id" string="customers" icon="terp-partner" context="{'group_by':'customer_id'}"/>
  261. <filter name="group_status" string="Status" icon="terp-partner" context="{'group_by':'state'}"/>
  262. </search>
  263. </field>
  264. </record>
  265. <!-- Adding a new filter to the order line search view -->
  266. <record id="order_lines_search_view" model="ir.ui.view">
  267. <field name="name">Order Lines Search</field>
  268. <field name="model">sale.order.line</field>
  269. <field name="type">search</field>
  270. <field name="inherit_id" ref="sale.view_sales_order_line_filter"/>
  271. <field name="arch" type="xml">
  272. <xpath expr="/search/filter[1]" position="after">
  273. <filter name="filter_service_product_type" string="Service Type" domain="[('type', '=', 'service')]"/>
  274. </xpath>
  275. </field>
  276. </record>
  277. <!-- actions opening views on models -->
  278. <record model="ir.actions.act_window" id="partner_agreement_agreement">
  279. <field name="name">Agreements</field>
  280. <field name="res_model">agreement</field>
  281. <field name="context">{"search_default_filter_non_template":1}</field>
  282. <field name="view_mode">kanban,tree,form</field>
  283. </record>
  284. <record model="ir.actions.act_window" id="partner_agreement_agreement_templates">
  285. <field name="name">Agreements</field>
  286. <field name="res_model">agreement</field>
  287. <field name="context">{"search_default_filter_templates":1}</field>
  288. <field name="view_mode">tree,kanban,form</field>
  289. </record>
  290. </odoo>