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.

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