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.

361 lines
20 KiB

6 years ago
  1. <?xml version="1.0" encoding="utf-8"?>
  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="code" 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 class="oe_edit_only">
  65. <group>
  66. <field name="field_id"
  67. domain="[('model_id', '=', active_model),
  68. ('ttype', '!=', 'one2many'),
  69. ('ttype', '!=', 'many2many')]"/>
  70. <field name="sub_object_id" readonly="1"/>
  71. <field name="sub_model_object_field_id"
  72. domain="[('model_id', '=', sub_object_id),
  73. ('ttype', '!=', 'one2many'),
  74. ('ttype', '!=', 'many2many')]"
  75. attrs="{'readonly':[('sub_object_id', '=', False)],
  76. 'required':[('sub_object_id', '!=', False)]}"/>
  77. <field name="default_value"/>
  78. <field name="copyvalue"/>
  79. </group>
  80. <p>
  81. This section (on the left) allows you to add dynamic fields inside the description and special terms.
  82. <ol>
  83. <li>Select the agreement field</li>
  84. <li>Select the sub-field</li>
  85. <li>Enter the default value if the field is empty</li>
  86. <li>Copy and paste the placeholder expression in the description or the special terms</li>
  87. </ol>
  88. </p>
  89. </group>
  90. <group name="parties" string="Parties">
  91. <group name="partner"
  92. string="Partner">
  93. <div class="o_address_format">
  94. <field name="partner_id"
  95. domain="[('customer', '=', True)]"
  96. context="{'show_address': 1}"
  97. options="{&quot;always_reload&quot;: True}"/>
  98. </div>
  99. </group>
  100. <group name="company"
  101. string="Company">
  102. <div class="o_address_format">
  103. <field name="company_partner_id"
  104. readonly="1"
  105. context="{'show_address': 1}"
  106. options="{&quot;always_reload&quot;: True}"/>
  107. </div>
  108. </group>
  109. <group name="partner_left" string="Primary Contact">
  110. <field name="partner_contact_id" domain="[('parent_id', '=', partner_id)]" nolabel="1"/>
  111. <field name="partner_contact_phone" widget="phone" readonly="1" nolabel="1"/>
  112. <field name="partner_contact_email" widget="email" readonly="1" nolabel="1"/>
  113. </group>
  114. <group name="contact_right" string="Primary Contact">
  115. <field name="company_contact_id" domain="[('parent_id', '=', company_partner_id)]" nolabel="1"/>
  116. <field name="company_contact_phone" widget="phone" readonly="1" nolabel="1"/>
  117. <field name="company_contact_email" widget="email" readonly="1" nolabel="1"/>
  118. </group>
  119. </group>
  120. <group name="term_information">
  121. <group name="termdates_left" string="Term Dates">
  122. <field name="start_date" attrs="{'required': [('is_template', '=', False)], 'invisible': [('is_template', '=', True)]}"/>
  123. <field name="end_date" attrs="{'required': [('is_template', '=', False)], 'invisible': [('is_template', '=', True)]}"/>
  124. <field name="expiration_notice"/>
  125. <field name="change_notice"/>
  126. <field name="notification_address_id" domain="['|', ('parent_id', '=', partner_id), ('parent_id', '=', company_partner_id)]"/>
  127. <field name="termination_requested"/>
  128. <field name="termination_date"/>
  129. </group>
  130. </group>
  131. <group string="Special Terms">
  132. <field name="special_terms"
  133. nolabel="1"/>
  134. </group>
  135. <notebook>
  136. <page name="structure" string="Structure">
  137. <div>
  138. <button name="%(partner_agreement_contract_document_preview)d" string="Preview" type="action" class="oe_highlight"/>
  139. <button name="%(partner_agreement_contract_document)d" string="Print" type="action" class="oe_highlight"/>
  140. </div>
  141. <separator string="Recitals"/>
  142. <field name="recital_ids"
  143. default_order="sequence"
  144. nolabel="1"
  145. context="{'default_agreement': active_id}"/>
  146. <separator string="Sections"/>
  147. <field name="sections_ids"
  148. default_order='sequence'
  149. nolabel="1"
  150. context="{'default_agreement': active_id}"/>
  151. <separator string="Clauses"/>
  152. <field name="clauses_ids"
  153. default_order='clause_id, sequence'
  154. nolabel="1"
  155. context="{'default_agreement': active_id}"/>
  156. <separator string="Appendices"/>
  157. <field name="appendix_ids"
  158. default_order='sequence'
  159. nolabel="1"
  160. context="{'default_agreement': active_id}"/>
  161. </page>
  162. <page name="signature" string="Signatures">
  163. <group>
  164. <group string="Partner">
  165. <field name="partner_signed_date"/>
  166. <field name="partner_signed_user_id" domain="[('parent_id', '=', partner_id)]"/>
  167. </group>
  168. <group string="Company">
  169. <field name="company_signed_date"/>
  170. <field name="company_signed_user_id"/>
  171. <field name="signed_contract" filename="signed_contract_filename"/>
  172. <field name="signed_contract_filename" invisible="1"/>
  173. </group>
  174. </group>
  175. </page>
  176. <page name="products" string="Products/Services">
  177. <field name="line_ids" nolabel="1">
  178. <tree editable="top">
  179. <field name="product_id"/>
  180. <field name="name"/>
  181. <field name="qty"/>
  182. <field name="uom_id" groups="uom.group_uom"/>
  183. </tree>
  184. </field>
  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="performance" 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.end_date.raw_value and record.end_date.raw_value lt (new Date())" t-set="red">oe_kanban_text_red</t>
  248. <div t-attf-class="#{red || ''}">
  249. <i><field name="end_date"/></i>
  250. </div>
  251. </div>
  252. </div>
  253. <div class="o_dropdown_kanban dropdown" groups="base.group_user">
  254. <a role="button" 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" alt="user &amp; picture"/>
  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. <field name="name"/>
  293. <field name="partner_id"/>
  294. <field name="agreement_type_id"/>
  295. <field name="agreement_subtype_id"/>
  296. <filter name="filter_non_template" string="Non-Templates" domain="[('active','=',True),('is_template', '=', False)]"/>
  297. <filter name="filter_inactive" string="Archived" domain="[('active','=',False)]"/>
  298. <filter name="filter_templates" string="Templates" domain="[('active','=',True),('is_template', '=', True)]"/>
  299. <filter name="group_partner_id" string="Partners" icon="terp-partner" context="{'group_by':'partner_id'}"/>
  300. <filter name="group_status" string="Status" icon="terp-partner" context="{'group_by':'state'}"/>
  301. </search>
  302. </field>
  303. </record>
  304. <!-- Agreement Reporting -->
  305. <record id="agreement_graph_view" model="ir.ui.view">
  306. <field name="name">agreement.graph</field>
  307. <field name="model">agreement</field>
  308. <field name="arch" type="xml">
  309. <graph string="Agreements" type="bar">
  310. <field name="stage_id" type="row"/>
  311. </graph>
  312. </field>
  313. </record>
  314. <record id="agreement_pivot_view" model="ir.ui.view">
  315. <field name="name">agreement.pivot</field>
  316. <field name="model">agreement</field>
  317. <field name="arch" type="xml">
  318. <pivot string="Agreements" display_quantity="true">
  319. <field name="stage_id" type="row"/>
  320. </pivot>
  321. </field>
  322. </record>
  323. <record id="action_agreement_report_order" model="ir.actions.act_window">
  324. <field name="name">Agreements</field>
  325. <field name="res_model">agreement</field>
  326. <field name="view_type">form</field>
  327. <field name="view_mode">graph,pivot</field>
  328. </record>
  329. <!-- actions opening views on models -->
  330. <record model="ir.actions.act_window" id="agreement_dashboard_agreement">
  331. <field name="name">Agreements</field>
  332. <field name="res_model">agreement</field>
  333. <field name="domain">[('is_template', '=', False)]</field>
  334. <field name="view_mode">kanban,tree,form</field>
  335. </record>
  336. <record model="ir.actions.act_window" id="agreement_operations_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">tree,form</field>
  341. </record>
  342. <record model="ir.actions.act_window" id="partner_agreement_agreement_templates">
  343. <field name="name">Templates</field>
  344. <field name="res_model">agreement</field>
  345. <field name="domain">[('is_template', '=', True)]</field>
  346. <!-- <field name="context">[('is_template', '=', True)]</field> -->
  347. <field name="view_mode">tree,kanban,form</field>
  348. </record>
  349. </odoo>