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
21 KiB

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