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.

359 lines
20 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
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
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 string="Agreements" default_order='name'>
  9. <field name="name"/>
  10. <field name="partner_id"/>
  11. <field name="company_partner_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_button_box" name="button_box">
  32. </div>
  33. <div class="oe_title">
  34. <label for="name" class="oe_edit_only" string="Agreement Name"/>
  35. <h1>
  36. <field name="name"/>
  37. </h1>
  38. </div>
  39. <group string="General">
  40. <group>
  41. <field name="reference" readonly="1"/>
  42. <field name="parent_agreement_id"
  43. domain="[('partner_id', '=', partner_id)]"/>
  44. <field name="is_template"/>
  45. </group>
  46. <group>
  47. <field name="agreement_type_id"
  48. widget="selection"
  49. required="True"/>
  50. <field name="agreement_subtype_id"
  51. widget="selection"
  52. domain="[('agreement_type_id', '=', agreement_type_id)]"/>
  53. <field name="assigned_user_id"
  54. attrs="{'invisible': [('is_template', '=', True)], 'readonly':[('is_template', '=', True)]}"/>
  55. <field name="active" invisible="1"/>
  56. <field name="state" invisible="1"/>
  57. </group>
  58. </group>
  59. <group string="Description">
  60. <field name="description"
  61. required="True"
  62. nolabel="1"/>
  63. </group>
  64. <group name="parties" string="Parties">
  65. <group name="partner"
  66. string="Partner">
  67. <div class="o_address_format">
  68. <field name="partner_id"
  69. domain="[('customer', '=', True)]"
  70. context="{'show_address': 1}"
  71. options="{&quot;always_reload&quot;: True}"/>
  72. </div>
  73. </group>
  74. <group name="company"
  75. string="Company">
  76. <div class="o_address_format">
  77. <field name="company_partner_id"
  78. readonly="1"
  79. context="{'show_address': 1}"
  80. options="{&quot;always_reload&quot;: True}"/>
  81. </div>
  82. </group>
  83. <group name="partner_left" string="Primary Contact">
  84. <field name="partner_contact_id" domain="[('parent_id', '=', partner_id)]" nolabel="1"/>
  85. <field name="partner_contact_phone" widget="phone" readonly="1" nolabel="1"/>
  86. <field name="partner_contact_email" widget="email" readonly="1" nolabel="1"/>
  87. </group>
  88. <group name="contact_right" string="Primary Contact">
  89. <field name="company_contact_id" domain="[('parent_id', '=', company_partner_id)]" nolabel="1"/>
  90. <field name="company_contact_phone" widget="phone" readonly="1" nolabel="1"/>
  91. <field name="company_contact_email" widget="email" readonly="1" nolabel="1"/>
  92. </group>
  93. </group>
  94. <group name="term_information">
  95. <group name="termdates_left" string="Term Dates">
  96. <field name="start_date" required="True" attrs="{'required': [('is_template', '=', False)], 'readonly':[('is_template', '=', True)]}"/>
  97. <field name="end_date" required="True" attrs="{'required': [('is_template', '=', False)], 'readonly':[('is_template', '=', True)]}"/>
  98. <field name="expiration_notice"/>
  99. <field name="change_notice"/>
  100. <field name="notification_address_id" domain="['|', ('parent_id', '=', partner_id), ('parent_id', '=', company_partner_id)]"/>
  101. <field name="termination_requested"/>
  102. <field name="termination_date"/>
  103. </group>
  104. <group name="paymentterm_right" string="Payment Terms">
  105. <field name="term" attrs="{'invisible': [('partner_id', '=', False)]}"/>
  106. <field name="payment_term_id" widget="selection"/>
  107. <field name="renewal_type_id" widget="selection"/>
  108. <field name="increase_type_id" widget="selection"/>
  109. </group>
  110. </group>
  111. <group string="Special Terms">
  112. <field name="special_terms"
  113. nolabel="1"/>
  114. </group>
  115. <notebook>
  116. <page name="structure" string="Structure">
  117. <div>
  118. <button name="%(partner_agreement_contract_document_preview)d" string="Preview" type="action" class="oe_highlight"/>
  119. <button name="%(partner_agreement_contract_document)d" string="Print" type="action" class="oe_highlight"/>
  120. </div>
  121. <separator string="Recitals"/>
  122. <field name="recital_ids"
  123. default_order="sequence"
  124. nolabel="1"
  125. context="{'default_agreement': active_id}"/>
  126. <separator string="Sections"/>
  127. <field name="sections_ids"
  128. default_order='sequence'
  129. nolabel="1"
  130. context="{'default_agreement': active_id}"/>
  131. <separator string="Clauses"/>
  132. <field name="clauses_ids"
  133. default_order='clause_id, sequence'
  134. nolabel="1"
  135. context="{'default_agreement': active_id}"/>
  136. <separator string="Appendices"/>
  137. <field name="appendix_ids"
  138. default_order='sequence'
  139. nolabel="1"
  140. context="{'default_agreement': active_id}"/>
  141. </page>
  142. <page name="signature" string="Signatures">
  143. <group>
  144. <group string="Partner">
  145. <field name="partner_signed_date"/>
  146. <field name="partner_signed_user_id" domain="[('parent_id', '=', partner_id)]"/>
  147. </group>
  148. <group string="Company">
  149. <field name="company_signed_date"/>
  150. <field name="company_signed_user_id"/>
  151. <field name="signed_contract" filename="signed_contract_filename"/>
  152. <field name="signed_contract_filename" invisible="1"/>
  153. </group>
  154. </group>
  155. </page>
  156. <page name="products" string="Products/Services">
  157. <group string="Products/Services">
  158. <field name="product_ids" nolabel="1"/>
  159. </group>
  160. </page>
  161. <page name="serviceprofiles" string="Service Profiles">
  162. <field name="serviceprofile_ids" nolabel="1"/>
  163. </page>
  164. <page name="financials" string="Financials">
  165. <group>
  166. <group>
  167. <field name="analytic_id"/>
  168. </group>
  169. <group></group>
  170. </group>
  171. <group string="Revenues and Costs">
  172. <field name="analytic_line_ids"
  173. readonly="1"
  174. nolabel="1"/>
  175. </group>
  176. </page>
  177. <page name="child_agreements" string="Child Agreements">
  178. <field name="child_agreements_ids">
  179. <tree default_order='version desc'>
  180. <field name="name"/>
  181. <field name="version"/>
  182. <field name="revision"/>
  183. </tree>
  184. </field>
  185. </page>
  186. <page name="old_versions" string="Revisions">
  187. <field name="previous_version_agreements_ids" string="Previouse Versions">
  188. <tree default_order='version desc'>
  189. <field name="name"/>
  190. <field name="version"/>
  191. <field name="revision"/>
  192. </tree>
  193. </field>
  194. </page>
  195. <page name="performance" string="Performance">
  196. <p>This section is a place where financial records will show the current performance of this agreement.</p>
  197. <p>Perhaps include invoices with total vs costs? </p>
  198. </page>
  199. </notebook>
  200. <group string="Administration">
  201. <div>
  202. <p>Reviewed by <field name="reviewed_user_id" class="oe_inline"/> on <field name="reviewed_date" class="oe_inline"/>.</p>
  203. <p>Approved by <field name="approved_user_id" class="oe_inline"/> on <field name="approved_date" class="oe_inline"/>.</p>
  204. </div>
  205. </group>
  206. <footer>
  207. Version: <field name="version" readonly="True"/>.<field name="revision" readonly="True"/>
  208. | Created By: <field name="create_uid" readonly="True"/>
  209. | Created On: <field name="create_date" readonly="True"/>
  210. </footer>
  211. </sheet>
  212. <div class="oe_chatter">
  213. <field name="message_follower_ids" widget="mail_followers"/>
  214. <field name="message_ids" widget="mail_thread"/>
  215. </div>
  216. </form>
  217. </field>
  218. </record>
  219. <!-- Agreement Kanban View -->
  220. <record id="view_project_agreement_kanban" model="ir.ui.view">
  221. <field name="name">Agreement Kanban</field>
  222. <field name="model">agreement</field>
  223. <field name="arch" type="xml">
  224. <kanban default_group_by="stage_id">
  225. <field name="color"/>
  226. <field name="assigned_user_id"/>
  227. <templates>
  228. <t t-name="kanban-box">
  229. <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
  230. <div class="oe_kanban_content">
  231. <div class="o_kanban_record_top">
  232. <div class="o_kanban_record_headings">
  233. <strong class="o_kanban_record_title">
  234. <field name="name"/>
  235. </strong><br/>
  236. <div class="o_kanban_record_subtitle text-muted">
  237. <field name="partner_id" invisible="context.get('default_partner_id', False)"/>
  238. <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>
  239. <div t-attf-class="#{red || ''}">
  240. <i><field name="start_date"/></i>
  241. </div>
  242. </div>
  243. </div>
  244. <div class="o_dropdown_kanban dropdown" groups="base.group_user">
  245. <a class="dropdown-toggle btn" data-toggle="dropdown" href="#">
  246. <span class="fa fa-ellipsis-v" aria-hidden="true"/>
  247. </a>
  248. <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
  249. <li t-if="widget.editable"><a type="edit">Edit</a></li>
  250. <li class="divider"/>
  251. <li class="dropdown-header">Record's Colour</li>
  252. <li>
  253. <ul class="oe_kanban_colorpicker" data-field="color"/>
  254. </li>
  255. </ul>
  256. </div>
  257. </div>
  258. <div class="o_kanban_record_body">
  259. <field name="agreement_type_id"/> - <field name="agreement_subtype_id"/>
  260. </div>
  261. <div class="o_kanban_record_bottom">
  262. <div class="oe_kanban_bottom_left">
  263. V: <field name="version"/>
  264. </div>
  265. <div class="oe_kanban_bottom_right">
  266. <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"/>
  267. </div>
  268. </div>
  269. </div>
  270. <div class="oe_clear"/>
  271. </div>
  272. </t>
  273. </templates>
  274. </kanban>
  275. </field>
  276. </record>
  277. <!-- Agreement Search View -->
  278. <record model="ir.ui.view" id="partner_agreement_search_view">
  279. <field name="name">Agreement Search</field>
  280. <field name="model">agreement</field>
  281. <field name="arch" type="xml">
  282. <search string="Agreement Search">
  283. <filter name="filter_non_template" string="Non-Templates" domain="[('active','=',True),('is_template', '=', False)]"/>
  284. <filter name="filter_inactive" string="Archived" domain="[('active','=',False)]"/>
  285. <filter name="filter_templates" string="Templates" domain="[('active','=',True),('is_template', '=', True)]"/>
  286. <filter name="group_partner_id" string="Partners" icon="terp-partner" context="{'group_by':'partner_id'}"/>
  287. <filter name="group_status" string="Status" icon="terp-partner" context="{'group_by':'state'}"/>
  288. </search>
  289. </field>
  290. </record>
  291. <!-- Agreement Reporting -->
  292. <record id="agreement_graph_view" model="ir.ui.view">
  293. <field name="name">agreement.graph</field>
  294. <field name="model">agreement</field>
  295. <field name="arch" type="xml">
  296. <graph string="Agreements" type="bar">
  297. <field name="stage_id" type="row"/>
  298. </graph>
  299. </field>
  300. </record>
  301. <record id="agreement_pivot_view" model="ir.ui.view">
  302. <field name="name">agreement.pivot</field>
  303. <field name="model">agreement</field>
  304. <field name="arch" type="xml">
  305. <pivot string="Agreements" display_quantity="true">
  306. <field name="stage_id" type="row"/>
  307. </pivot>
  308. </field>
  309. </record>
  310. <record id="action_agreement_report_order" model="ir.actions.act_window">
  311. <field name="name">Agreements</field>
  312. <field name="res_model">agreement</field>
  313. <field name="view_type">form</field>
  314. <field name="view_mode">graph,pivot</field>
  315. </record>
  316. <!-- Adding a new filter to the order line search view -->
  317. <record id="order_lines_search_view" model="ir.ui.view">
  318. <field name="name">Order Lines Search</field>
  319. <field name="model">sale.order.line</field>
  320. <field name="type">search</field>
  321. <field name="inherit_id" ref="sale.view_sales_order_line_filter"/>
  322. <field name="arch" type="xml">
  323. <xpath expr="/search/filter[1]" position="after">
  324. <filter name="filter_service_product_type" string="Service Type" domain="[('type', '=', 'service')]"/>
  325. </xpath>
  326. </field>
  327. </record>
  328. <!-- actions opening views on models -->
  329. <record model="ir.actions.act_window" id="agreement_dashboard_agreement">
  330. <field name="name">Agreements</field>
  331. <field name="res_model">agreement</field>
  332. <field name="domain">[('is_template', '=', False)]</field>
  333. <field name="view_mode">kanban,tree,form</field>
  334. </record>
  335. <record model="ir.actions.act_window" id="agreement_operations_agreement">
  336. <field name="name">Agreements</field>
  337. <field name="res_model">agreement</field>
  338. <field name="domain">[('is_template', '=', False)]</field>
  339. <field name="view_mode">tree,form</field>
  340. </record>
  341. <record model="ir.actions.act_window" id="partner_agreement_agreement_templates">
  342. <field name="name">Templates</field>
  343. <field name="res_model">agreement</field>
  344. <field name="domain">[('is_template', '=', True)]</field>
  345. <field name="view_mode">tree,kanban,form</field>
  346. </record>
  347. </odoo>