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.

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