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.

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