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.

399 lines
22 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. <?xml version="1.0"?>
  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="reference" 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 name="paymentterm_right" string="Payment Terms">
  131. <field name="term" attrs="{'invisible': [('partner_id', '=', False)]}"/>
  132. <field name="payment_term_id" widget="selection"/>
  133. <field name="renewal_type_id" widget="selection"/>
  134. <field name="increase_type_id" widget="selection"/>
  135. </group>
  136. </group>
  137. <group string="Special Terms">
  138. <field name="special_terms"
  139. nolabel="1"/>
  140. </group>
  141. <notebook>
  142. <page name="structure" string="Structure">
  143. <div>
  144. <button name="%(partner_agreement_contract_document_preview)d" string="Preview" type="action" class="oe_highlight"/>
  145. <button name="%(partner_agreement_contract_document)d" string="Print" type="action" class="oe_highlight"/>
  146. </div>
  147. <separator string="Recitals"/>
  148. <field name="recital_ids"
  149. default_order="sequence"
  150. nolabel="1"
  151. context="{'default_agreement': active_id}"/>
  152. <separator string="Sections"/>
  153. <field name="sections_ids"
  154. default_order='sequence'
  155. nolabel="1"
  156. context="{'default_agreement': active_id}"/>
  157. <separator string="Clauses"/>
  158. <field name="clauses_ids"
  159. default_order='clause_id, sequence'
  160. nolabel="1"
  161. context="{'default_agreement': active_id}"/>
  162. <separator string="Appendices"/>
  163. <field name="appendix_ids"
  164. default_order='sequence'
  165. nolabel="1"
  166. context="{'default_agreement': active_id}"/>
  167. </page>
  168. <page name="signature" string="Signatures">
  169. <group>
  170. <group string="Partner">
  171. <field name="partner_signed_date"/>
  172. <field name="partner_signed_user_id" domain="[('parent_id', '=', partner_id)]"/>
  173. </group>
  174. <group string="Company">
  175. <field name="company_signed_date"/>
  176. <field name="company_signed_user_id"/>
  177. <field name="signed_contract" filename="signed_contract_filename"/>
  178. <field name="signed_contract_filename" invisible="1"/>
  179. </group>
  180. </group>
  181. </page>
  182. <page name="products" string="Products/Services">
  183. <field name="line_ids" nolabel="1">
  184. <tree editable="top">
  185. <field name="product_id"/>
  186. <field name="name"/>
  187. <field name="qty"/>
  188. <field name="uom_id" groups="product.group_uom"/>
  189. </tree>
  190. </field>
  191. </page>
  192. <page name="serviceprofiles" string="Service Profiles">
  193. <field name="serviceprofile_ids" nolabel="1">
  194. <tree editable="top">
  195. <field name="name"/>
  196. </tree>
  197. </field>
  198. </page>
  199. <page name="financials" string="Financials">
  200. <group>
  201. <group>
  202. <field name="analytic_id"/>
  203. </group>
  204. <group></group>
  205. </group>
  206. <group string="Revenues and Costs">
  207. <field name="analytic_line_ids"
  208. readonly="1"
  209. nolabel="1"/>
  210. </group>
  211. </page>
  212. <page name="child_agreements" string="Child Agreements">
  213. <field name="child_agreements_ids">
  214. <tree default_order='version desc'>
  215. <field name="name"/>
  216. <field name="version"/>
  217. <field name="revision"/>
  218. </tree>
  219. </field>
  220. </page>
  221. <page name="old_versions" string="Revisions">
  222. <field name="previous_version_agreements_ids" string="Previouse Versions">
  223. <tree default_order='version desc'>
  224. <field name="name"/>
  225. <field name="version"/>
  226. <field name="revision"/>
  227. </tree>
  228. </field>
  229. </page>
  230. <page name="performance" string="Performance">
  231. <p>This section is a place where financial records will show the current performance of this agreement.</p>
  232. <p>Perhaps include invoices with total vs costs? </p>
  233. </page>
  234. </notebook>
  235. <group string="Administration">
  236. <div>
  237. <p>Reviewed by <field name="reviewed_user_id" class="oe_inline"/> on <field name="reviewed_date" class="oe_inline"/>.</p>
  238. <p>Approved by <field name="approved_user_id" class="oe_inline"/> on <field name="approved_date" class="oe_inline"/>.</p>
  239. </div>
  240. </group>
  241. <footer>
  242. Version: <field name="version" readonly="True"/>.<field name="revision" readonly="True"/>
  243. | Created By: <field name="create_uid" readonly="True"/>
  244. | Created On: <field name="create_date" readonly="True"/>
  245. </footer>
  246. </sheet>
  247. <div class="oe_chatter">
  248. <field name="message_follower_ids" widget="mail_followers"/>
  249. <field name="message_ids" widget="mail_thread"/>
  250. </div>
  251. </form>
  252. </field>
  253. </record>
  254. <!-- Agreement Kanban View -->
  255. <record id="view_project_agreement_kanban" model="ir.ui.view">
  256. <field name="name">Agreement Kanban</field>
  257. <field name="model">agreement</field>
  258. <field name="arch" type="xml">
  259. <kanban default_group_by="stage_id">
  260. <field name="color"/>
  261. <field name="assigned_user_id"/>
  262. <templates>
  263. <t t-name="kanban-box">
  264. <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
  265. <div class="oe_kanban_content">
  266. <div class="o_kanban_record_top">
  267. <div class="o_kanban_record_headings">
  268. <strong class="o_kanban_record_title">
  269. <field name="name"/>
  270. </strong><br/>
  271. <div class="o_kanban_record_subtitle text-muted">
  272. <field name="partner_id" invisible="context.get('default_partner_id', False)"/>
  273. <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>
  274. <div t-attf-class="#{red || ''}">
  275. <i><field name="end_date"/></i>
  276. </div>
  277. </div>
  278. </div>
  279. <div class="o_dropdown_kanban dropdown" groups="base.group_user">
  280. <a class="dropdown-toggle btn" data-toggle="dropdown" href="#">
  281. <span class="fa fa-ellipsis-v" aria-hidden="true"/>
  282. </a>
  283. <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
  284. <li t-if="widget.editable"><a type="edit">Edit</a></li>
  285. <li class="divider"/>
  286. <li class="dropdown-header">Record's Colour</li>
  287. <li>
  288. <ul class="oe_kanban_colorpicker" data-field="color"/>
  289. </li>
  290. </ul>
  291. </div>
  292. </div>
  293. <div class="o_kanban_record_body">
  294. <field name="agreement_type_id"/> - <field name="agreement_subtype_id"/>
  295. </div>
  296. <div class="o_kanban_record_bottom">
  297. <div class="oe_kanban_bottom_left">
  298. V: <field name="version"/>
  299. </div>
  300. <div class="oe_kanban_bottom_right">
  301. <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"/>
  302. </div>
  303. </div>
  304. </div>
  305. <div class="oe_clear"/>
  306. </div>
  307. </t>
  308. </templates>
  309. </kanban>
  310. </field>
  311. </record>
  312. <!-- Agreement Search View -->
  313. <record model="ir.ui.view" id="partner_agreement_search_view">
  314. <field name="name">Agreement Search</field>
  315. <field name="model">agreement</field>
  316. <field name="arch" type="xml">
  317. <search string="Agreement Search">
  318. <field name="name"/>
  319. <field name="partner_id"/>
  320. <field name="agreement_type_id"/>
  321. <field name="agreement_subtype_id"/>
  322. <filter name="filter_non_template" string="Non-Templates" domain="[('active','=',True),('is_template', '=', False)]"/>
  323. <filter name="filter_inactive" string="Archived" domain="[('active','=',False)]"/>
  324. <filter name="filter_templates" string="Templates" domain="[('active','=',True),('is_template', '=', True)]"/>
  325. <filter name="group_partner_id" string="Partners" icon="terp-partner" context="{'group_by':'partner_id'}"/>
  326. <filter name="group_status" string="Status" icon="terp-partner" context="{'group_by':'state'}"/>
  327. </search>
  328. </field>
  329. </record>
  330. <!-- Agreement Reporting -->
  331. <record id="agreement_graph_view" model="ir.ui.view">
  332. <field name="name">agreement.graph</field>
  333. <field name="model">agreement</field>
  334. <field name="arch" type="xml">
  335. <graph string="Agreements" type="bar">
  336. <field name="stage_id" type="row"/>
  337. </graph>
  338. </field>
  339. </record>
  340. <record id="agreement_pivot_view" model="ir.ui.view">
  341. <field name="name">agreement.pivot</field>
  342. <field name="model">agreement</field>
  343. <field name="arch" type="xml">
  344. <pivot string="Agreements" display_quantity="true">
  345. <field name="stage_id" type="row"/>
  346. </pivot>
  347. </field>
  348. </record>
  349. <record id="action_agreement_report_order" model="ir.actions.act_window">
  350. <field name="name">Agreements</field>
  351. <field name="res_model">agreement</field>
  352. <field name="view_type">form</field>
  353. <field name="view_mode">graph,pivot</field>
  354. </record>
  355. <!-- Adding a new filter to the order line search view -->
  356. <record id="order_lines_search_view" model="ir.ui.view">
  357. <field name="name">Order Lines Search</field>
  358. <field name="model">sale.order.line</field>
  359. <field name="type">search</field>
  360. <field name="inherit_id" ref="sale.view_sales_order_line_filter"/>
  361. <field name="arch" type="xml">
  362. <xpath expr="/search/filter[1]" position="after">
  363. <filter name="filter_service_product_type" string="Service Type" domain="[('type', '=', 'service')]"/>
  364. </xpath>
  365. </field>
  366. </record>
  367. <!-- actions opening views on models -->
  368. <record model="ir.actions.act_window" id="agreement_dashboard_agreement">
  369. <field name="name">Agreements</field>
  370. <field name="res_model">agreement</field>
  371. <field name="domain">[('is_template', '=', False)]</field>
  372. <field name="view_mode">kanban,tree,form</field>
  373. </record>
  374. <record model="ir.actions.act_window" id="agreement_operations_agreement">
  375. <field name="name">Agreements</field>
  376. <field name="res_model">agreement</field>
  377. <field name="domain">[('is_template', '=', False)]</field>
  378. <field name="view_mode">tree,form</field>
  379. </record>
  380. <record model="ir.actions.act_window" id="partner_agreement_agreement_templates">
  381. <field name="name">Templates</field>
  382. <field name="res_model">agreement</field>
  383. <field name="domain">[('is_template', '=', True)]</field>
  384. <field name="context">[('is_template', '=', True)]</field>
  385. <field name="view_mode">tree,kanban,form</field>
  386. </record>
  387. </odoo>