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.

372 lines
20 KiB

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