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.

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