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.

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