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.

87 lines
3.5 KiB

  1. <?xml version="1.0"?>
  2. <!--
  3. © 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
  4. License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  5. -->
  6. <odoo>
  7. <record id="agreement_form" model="ir.ui.view">
  8. <field name="name">agreement.form</field>
  9. <field name="model">agreement</field>
  10. <field name="arch" type="xml">
  11. <form string="Agreement">
  12. <div class="oe_button_box" name="button_box">
  13. <button name="toggle_active" type="object"
  14. class="oe_stat_button" icon="fa-archive">
  15. <field name="active" widget="boolean_button"
  16. options='{"terminology": "archive"}'/>
  17. </button>
  18. </div>
  19. <group name="main">
  20. <field name="partner_id"/>
  21. <field name="name"/>
  22. <field name="code"/>
  23. <field name="agreement_type"/>
  24. <field name="signature_date"/>
  25. <field name="company_id" groups="base.group_multi_company"/>
  26. </group>
  27. <group string="Customer Invoices" name="out_invoices" attrs="{'invisible': [('agreement_type', '!=', 'sale')]}">
  28. <field name="out_invoice_ids" nolabel="1"/>
  29. </group>
  30. <group string="Supplier Invoices" name="in_invoices" attrs="{'invisible': [('agreement_type', '!=', 'purchase')]}">
  31. <field name="in_invoice_ids" nolabel="1"/>
  32. </group>
  33. </form>
  34. </field>
  35. </record>
  36. <record id="agreement_tree" model="ir.ui.view">
  37. <field name="name">agreement.tree</field>
  38. <field name="model">agreement</field>
  39. <field name="arch" type="xml">
  40. <tree string="Agreements">
  41. <field name="partner_id"/>
  42. <field name="code"/>
  43. <field name="name"/>
  44. <field name="agreement_type"/>
  45. <field name="signature_date"/>
  46. <field name="company_id" groups="base.group_multi_company"/>
  47. </tree>
  48. </field>
  49. </record>
  50. <record id="agreement_search" model="ir.ui.view">
  51. <field name="name">agreement.search</field>
  52. <field name="model">agreement</field>
  53. <field name="arch" type="xml">
  54. <search string="Search Agreements">
  55. <field name="name" filter_domain="['|', ('name', 'ilike', self), ('code', 'ilike', self)]" string="Name or Number"/>
  56. <field name="partner_id"/>
  57. <filter name="sale" string="Sale" domain="[('agreement_type', '=', 'sale')]"/>
  58. <filter name="purchase" string="Purchase" domain="[('agreement_type', '=', 'purchase')]"/>
  59. <separator/>
  60. <filter name="inactive" string="Archived" domain="[('active', '=', False)]"/>
  61. <group name="groupby">
  62. <filter name="partner_groupby" string="Customer"
  63. context="{'group_by': 'partner_id'}"/>
  64. <filter name="signature_date_groupby" string="Signature Date"
  65. context="{'group_by': 'signature_date'}"/>
  66. <filter name="agreement_type_groupby" string="Type"
  67. context="{'group_by': 'agreement_type'}"/>
  68. </group>
  69. </search>
  70. </field>
  71. </record>
  72. <record id="agreement_action" model="ir.actions.act_window">
  73. <field name="name">Agreements</field>
  74. <field name="res_model">agreement</field>
  75. <field name="view_mode">tree,form</field>
  76. </record>
  77. <menuitem id="agreement_menu" action="agreement_action"
  78. parent="account.account_management_menu" sequence="100"/>
  79. </odoo>