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.

370 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
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="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. <group string="Sections" default_order='section_sequence'>
  122. <field name="sections_ids"
  123. nolabel="1"
  124. context="{'default_agreement': active_id}">
  125. <tree default_order='section_sequence'>
  126. <field name="section_sequence" widget="handle"/>
  127. <field name="name"/>
  128. </tree>
  129. </field>
  130. </group>
  131. <group string="Clauses" default_order='section_id, clause_sequence'>
  132. <field name="clauses_ids"
  133. nolabel="1"
  134. context="{'default_agreement': active_id}">
  135. <tree default_order='section_id, clause_sequence'>
  136. <field name="clause_sequence" widget="handle"/>
  137. <field name="section_id"/>
  138. <field name="name"/>
  139. </tree>
  140. </field>
  141. </group>
  142. </page>
  143. <page name="signature" string="Signatures">
  144. <group>
  145. <group string="Partner">
  146. <field name="partner_signed_date"/>
  147. <field name="partner_signed_user_id" domain="[('parent_id', '=', partner_id)]"/>
  148. </group>
  149. <group string="Company">
  150. <field name="company_signed_date"/>
  151. <field name="company_signed_user_id"/>
  152. <field name="signed_contract" filename="signed_contract_filename"/>
  153. <field name="signed_contract_filename" invisible="1"/>
  154. </group>
  155. </group>
  156. </page>
  157. <page name="products" string="Products/Services">
  158. <group string="Products/Services">
  159. <field name="product_ids" nolabel="1"/>
  160. </group>
  161. </page>
  162. <page name="financials" string="Financials">
  163. <group>
  164. <group>
  165. <field name="analytic_id"/>
  166. </group>
  167. <group></group>
  168. </group>
  169. <group string="Revenues and Costs">
  170. <field name="analytic_line_ids"
  171. readonly="1"
  172. nolabel="1"/>
  173. </group>
  174. <!--
  175. <group string="Financial Details>
  176. <group string="Company">
  177. <field name="total_company_mrc"/>
  178. <field name="total_company_nrc"/>
  179. <field name="currency_id"/>
  180. <field name="contract_value" readonly="1"/>
  181. </group>
  182. <group string="Customer">
  183. <field name="total_customer_mrc"/>
  184. <field name="total_customer_nrc"/>
  185. </group>
  186. </group> -->
  187. </page>
  188. <page name="child_agreements" string="Child Agreements">
  189. <field name="child_agreements_ids">
  190. <tree default_order='version desc'>
  191. <field name="name"/>
  192. <field name="version"/>
  193. <field name="revision"/>
  194. </tree>
  195. </field>
  196. </page>
  197. <page name="old_versions" string="Revisions">
  198. <field name="previous_version_agreements_ids" string="Previouse Versions">
  199. <tree default_order='version desc'>
  200. <field name="name"/>
  201. <field name="version"/>
  202. <field name="revision"/>
  203. </tree>
  204. </field>
  205. </page>
  206. <page name="peformance" string="Performance">
  207. <p>This section is a place where financial records will show the current performance of this agreement.</p>
  208. <p>Perhaps include invoices with total vs costs? </p>
  209. </page>
  210. </notebook>
  211. <group string="Administration">
  212. <div>
  213. <p>Reviewed by <field name="reviewed_user_id" class="oe_inline"/> on <field name="reviewed_date" class="oe_inline"/>.</p>
  214. <p>Approved by <field name="approved_user_id" class="oe_inline"/> on <field name="approved_date" class="oe_inline"/>.</p>
  215. </div>
  216. </group>
  217. <footer>
  218. Version: <field name="version" readonly="True"/>.<field name="revision" readonly="True"/>
  219. | Created By: <field name="create_uid" readonly="True"/>
  220. | Created On: <field name="create_date" readonly="True"/>
  221. </footer>
  222. </sheet>
  223. <div class="oe_chatter">
  224. <field name="message_follower_ids" widget="mail_followers"/>
  225. <field name="message_ids" widget="mail_thread"/>
  226. </div>
  227. </form>
  228. </field>
  229. </record>
  230. <!-- Agreement Kanban View -->
  231. <record id="view_project_agreement_kanban" model="ir.ui.view">
  232. <field name="name">Agreement Kanban</field>
  233. <field name="model">agreement</field>
  234. <field name="arch" type="xml">
  235. <kanban default_group_by="stage_id">
  236. <field name="color"/>
  237. <field name="assigned_user_id"/>
  238. <templates>
  239. <t t-name="kanban-box">
  240. <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
  241. <div class="oe_kanban_content">
  242. <div class="o_kanban_record_top">
  243. <div class="o_kanban_record_headings">
  244. <strong class="o_kanban_record_title">
  245. <field name="name"/>
  246. </strong><br/>
  247. <div class="o_kanban_record_subtitle text-muted">
  248. <field name="partner_id" invisible="context.get('default_partner_id', False)"/>
  249. <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>
  250. <div t-attf-class="#{red || ''}">
  251. <i><field name="start_date"/></i>
  252. </div>
  253. </div>
  254. </div>
  255. <div class="o_dropdown_kanban dropdown" groups="base.group_user">
  256. <a class="dropdown-toggle btn" data-toggle="dropdown" href="#">
  257. <span class="fa fa-ellipsis-v" aria-hidden="true"/>
  258. </a>
  259. <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
  260. <li t-if="widget.editable"><a type="edit">Edit</a></li>
  261. <li class="divider"/>
  262. <li class="dropdown-header">Record's Colour</li>
  263. <li>
  264. <ul class="oe_kanban_colorpicker" data-field="color"/>
  265. </li>
  266. </ul>
  267. </div>
  268. </div>
  269. <div class="o_kanban_record_body">
  270. <field name="agreement_type_id"/> - <field name="agreement_subtype_id"/>
  271. </div>
  272. <div class="o_kanban_record_bottom">
  273. <div class="oe_kanban_bottom_left">
  274. V: <field name="version"/>
  275. </div>
  276. <div class="oe_kanban_bottom_right">
  277. <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"/>
  278. </div>
  279. </div>
  280. </div>
  281. <div class="oe_clear"/>
  282. </div>
  283. </t>
  284. </templates>
  285. </kanban>
  286. </field>
  287. </record>
  288. <!-- Agreement Search View -->
  289. <record model="ir.ui.view" id="partner_agreement_search_view">
  290. <field name="name">Agreement Search</field>
  291. <field name="model">agreement</field>
  292. <field name="arch" type="xml">
  293. <search string="Agreement Search">
  294. <filter name="filter_non_template" string="Non-Templates" domain="[('active','=',True),('is_template', '=', False)]"/>
  295. <filter name="filter_inactive" string="Archived" domain="[('active','=',False)]"/>
  296. <filter name="filter_templates" string="Templates" domain="[('active','=',True),('is_template', '=', True)]"/>
  297. <filter name="group_partner_id" string="Partners" icon="terp-partner" context="{'group_by':'partner_id'}"/>
  298. <filter name="group_status" string="Status" icon="terp-partner" context="{'group_by':'state'}"/>
  299. </search>
  300. </field>
  301. </record>
  302. <!-- Agreement Reporting -->
  303. <record id="agreement_graph_view" model="ir.ui.view">
  304. <field name="name">agreement.graph</field>
  305. <field name="model">agreement</field>
  306. <field name="arch" type="xml">
  307. <graph string="Agreements" type="bar">
  308. <field name="stage_id" type="row"/>
  309. </graph>
  310. </field>
  311. </record>
  312. <record id="agreement_pivot_view" model="ir.ui.view">
  313. <field name="name">agreement.pivot</field>
  314. <field name="model">agreement</field>
  315. <field name="arch" type="xml">
  316. <pivot string="Agreements" display_quantity="true">
  317. <field name="stage_id" type="row"/>
  318. </pivot>
  319. </field>
  320. </record>
  321. <record id="action_agreement_report_order" model="ir.actions.act_window">
  322. <field name="name">Agreements</field>
  323. <field name="res_model">agreement</field>
  324. <field name="view_type">form</field>
  325. <field name="view_mode">graph,pivot</field>
  326. </record>
  327. <!-- Adding a new filter to the order line search view -->
  328. <record id="order_lines_search_view" model="ir.ui.view">
  329. <field name="name">Order Lines Search</field>
  330. <field name="model">sale.order.line</field>
  331. <field name="type">search</field>
  332. <field name="inherit_id" ref="sale.view_sales_order_line_filter"/>
  333. <field name="arch" type="xml">
  334. <xpath expr="/search/filter[1]" position="after">
  335. <filter name="filter_service_product_type" string="Service Type" domain="[('type', '=', 'service')]"/>
  336. </xpath>
  337. </field>
  338. </record>
  339. <!-- actions opening views on models -->
  340. <record model="ir.actions.act_window" id="agreement_dashboard_agreement">
  341. <field name="name">Agreements</field>
  342. <field name="res_model">agreement</field>
  343. <field name="domain">[('is_template', '=', False)]</field>
  344. <field name="view_mode">kanban,tree,form</field>
  345. </record>
  346. <record model="ir.actions.act_window" id="agreement_operations_agreement">
  347. <field name="name">Agreements</field>
  348. <field name="res_model">agreement</field>
  349. <field name="domain">[('is_template', '=', False)]</field>
  350. <field name="view_mode">tree,form</field>
  351. </record>
  352. <record model="ir.actions.act_window" id="partner_agreement_agreement_templates">
  353. <field name="name">Templates</field>
  354. <field name="res_model">agreement</field>
  355. <field name="domain">[('is_template', '=', True)]</field>
  356. <field name="view_mode">tree,kanban,form</field>
  357. </record>
  358. </odoo>