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.

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