account_purchase_contract_view.xml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <record id="view_purchase_contract_form" model="ir.ui.view">
  5. <field name="name">purchase.contract.form</field>
  6. <field name="model">account.analytic.account</field>
  7. <field name="arch" type="xml">
  8. <form string="Analytic Account">
  9. <header>
  10. <button name="set_pending" string="To Renew" type="object" states="open"/>
  11. <button name="set_close" string="Close Contract" type="object" states="open,pending"/>
  12. <button name="set_open" string="Set In Progress" type="object" states="pending,close,cancelled,draft"/>
  13. <button name="set_cancel" string="Cancel Contract" type="object" states="open,pending"/>
  14. <field name="state" readonly="1" widget="statusbar" statusbar_visible="open,pending,close" statusbar_colors="{'pending':'red', 'template':'blue'}"/>
  15. </header>
  16. <sheet string="Analytic Account">
  17. <div class="oe_right oe_button_box" name="buttons">
  18. </div>
  19. <div class="oe_title">
  20. <label for="name" class="oe_edit_only"/>
  21. <h1>
  22. <field name="name" class="oe_inline"/>
  23. </h1>
  24. <div name="project"/>
  25. </div>
  26. <group name="main">
  27. <group>
  28. <field name="partner_id" on_change="on_change_partner_id(partner_id, name)" string="Supplier" domain="[('supplier','=',True)]" required="1"/>
  29. <field name="manager_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'account.group_account_manager']}"/>
  30. <field name="currency_id" attrs="{'invisible': ['|',('type', '&lt;&gt;', 'view'), ('company_id', '&lt;&gt;', False)]}"/>
  31. </group>
  32. <group>
  33. <field name="type" invisible="context.get('default_type', False)"/>
  34. <field name="template_id" on_change="on_change_template(template_id, date_start)" domain="[('type','=','template')]" attrs="{'invisible': [('type','in',['view', 'normal','template'])]}" context="{'default_type' : 'template'}" invisible="1"/>
  35. <field name="code"/>
  36. <field name="parent_id" on_change="on_change_parent(parent_id)" attrs="{'invisible': [('type','in',['contract'])]}" invisible="1"/>
  37. <field name="company_id" on_change="on_change_company(company_id)" widget="selection" groups="base.group_multi_company" attrs="{'required': [('type','&lt;&gt;','view')]}"/>
  38. </group>
  39. </group>
  40. <notebook>
  41. <page string="Contract Information" name="contract_page" attrs="{'invisible':[('type','not in',['contract', 'template', 'purchase_contract'])]}">
  42. <group string="Renewal" name="contract">
  43. <!-- <p colspan="2" class="oe_grey oe_edit_only">
  44. Once the end date of the contract is
  45. passed or the maximum number of service
  46. units (e.g. support contract) is
  47. reached, the account manager is notified
  48. by email to renew the contract with the
  49. customer.
  50. </p> -->
  51. <field name="date_start"/>
  52. <label for="date" string="End Date"/>
  53. <div name="duration">
  54. <field name="date" class="oe_inline"/>
  55. </div>
  56. </group>
  57. <separator string="Recurring Invoices" attrs="{'invisible': [('recurring_invoices','!=',True)]}"/>
  58. <div>
  59. <div attrs="{'invisible': [('type','!=', 'purchase_contract')]}">
  60. <field name="recurring_invoices" on_change="onchange_recurring_invoices(recurring_invoices, date_start)" class="oe_inline"/>
  61. <label for="recurring_invoices"/>
  62. </div>
  63. <button class="oe_link" name="recurring_create_invoice" attrs="{'invisible': [('recurring_invoices','!=',True)]}" string="⇒ create invoices" type="object"/>
  64. </div>
  65. <group attrs="{'invisible': [('recurring_invoices','!=',True)]}">
  66. <label for="recurring_interval"/>
  67. <div>
  68. <field name="recurring_interval" class="oe_inline" attrs="{'required': [('recurring_invoices', '=', True)]}"/>
  69. <field name="recurring_rule_type" class="oe_inline" attrs="{'required': [('recurring_invoices', '=', True)]}"/>
  70. </div>
  71. <field name="recurring_next_date"/>
  72. </group>
  73. <label for="recurring_invoice_line_ids" attrs="{'invisible': [('recurring_invoices','=',False)]}"/>
  74. <div attrs="{'invisible': [('recurring_invoices','=',False)]}">
  75. <field name="recurring_invoice_line_ids">
  76. <tree string="Account Analytic Lines" editable="bottom">
  77. <field name="product_id" on_change="product_id_change(product_id, uom_id, quantity, False, parent.partner_id, False, parent.pricelist_id, parent.company_id, {'purchase': True})"/>
  78. <field name="name"/>
  79. <field name="quantity"/>
  80. <field name="uom_id"/>
  81. <field name="price_unit"/>
  82. <field name="price_subtotal"/>
  83. </tree>
  84. </field>
  85. </div>
  86. <separator string="Terms and Conditions" name="description"/>
  87. <field name="description"/>
  88. </page>
  89. </notebook>
  90. </sheet>
  91. <div class="oe_chatter">
  92. <field name="message_follower_ids" widget="mail_followers"/>
  93. <field name="message_ids" widget="mail_thread"/>
  94. </div>
  95. </form>
  96. </field>
  97. </record>
  98. <record id="view_purchase_contract_tree" model="ir.ui.view">
  99. <field name="name">purchase_contract.tree</field>
  100. <field name="model">account.analytic.account</field>
  101. <field name="inherit_id" ref="account.view_account_analytic_account_list"/>
  102. <field name="arch" type="xml">
  103. <field name="partner_id" position="attributes">
  104. <attribute name="invisible">'recurring_invoices' in context</attribute>
  105. </field>
  106. <field name="partner_id" position="after" >
  107. <field name="partner_id" string="Supplier" invisible="'recurring_invoices' not in context"/>
  108. </field>
  109. </field>
  110. </record>
  111. </data>
  112. </openerp>