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.

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