expense.xml 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <record id="invoice_supplier_form" model="ir.ui.view">
  5. <field name="name">invoice_supplier_form</field>
  6. <field name="model">account.invoice</field>
  7. <field name="inherit_id" ref="account.invoice_supplier_form"/>
  8. <field name="arch" type="xml">
  9. <field name="type" position="after">
  10. <field name="is_a_expense" invisible="1"/>
  11. </field>
  12. <field name="origin" position="replace">
  13. <field name="origin" attrs="{'invisible': [('is_a_expense', '=', True)]}" readonly="1"/>
  14. </field>
  15. </field>
  16. </record>
  17. <!-- Proveedor -->
  18. <!-- Registrar gastos -->
  19. <record id="action_expense" model="ir.actions.act_window">
  20. <field name="name">Registrar Gastos</field>
  21. <field name="type">ir.actions.act_window</field>
  22. <field name="res_model">account.invoice</field>
  23. <field name="view_type">form</field>
  24. <field name="view_id" eval="False"/>
  25. <field name="view_mode">tree,form</field>
  26. <field name="context">{'default_type': 'in_invoice', 'type': 'in_invoice', 'journal_type': 'purchase','default_is_a_expense':True,'is_a_expense':True}</field>
  27. <field name="domain">['|',('origin', 'ilike', 'AA'),('origin', '=', False),('type', '=', 'in_invoice')]</field>
  28. <field name="search_view_id" ref="account.view_account_invoice_filter"/>
  29. </record>
  30. <record id="product_template_search_view_expense" model="ir.ui.view">
  31. <field name="name">product_template_search_view_expense</field>
  32. <field name="model">product.template</field>
  33. <field name="inherit_id" ref="product.product_template_search_view"/>
  34. <field name="arch" type="xml">
  35. <filter name="filter_to_sell" position="after">
  36. <filter name="filter_to_expenses" string="Es un gasto" icon="terp-accessories-archiver+" domain="[('hr_expense_ok', '=', 1)]"/>
  37. </filter>
  38. </field>
  39. </record>
  40. <record id="action_expense_products" model="ir.actions.act_window">
  41. <field name="name">Products</field>
  42. <field name="type">ir.actions.act_window</field>
  43. <field name="res_model">product.template</field>
  44. <field name="view_type">form</field>
  45. <field name="view_mode">kanban,tree,form</field>
  46. <field name="context">{"search_default_filter_to_expenses":1}</field>
  47. <field name="search_view_id" eval="False"/> <!-- Force empty -->
  48. <field name="view_id" eval="False"/> <!-- Force empty -->
  49. </record>
  50. <record id="account.action_invoice_tree2" model="ir.actions.act_window">
  51. <field name="name">Supplier Invoices</field>
  52. <field name="res_model">account.invoice</field>
  53. <field name="view_type">form</field>
  54. <field name="view_mode">tree,form,calendar</field>
  55. <field eval="False" name="view_id"/>
  56. <field name="domain">['|',('origin', 'ilike', 'PO'),('origin', '!=', False),('type', '=', 'in_invoice')]</field>
  57. <field name="context">{'default_type': 'in_invoice', 'type': 'in_invoice', 'journal_type': 'purchase', 'default_origin':'PO', 'origin':'PO'}</field>
  58. <field name="search_view_id" ref="account.view_account_invoice_filter"/>
  59. <field name="help" type="html">
  60. <p class="oe_view_nocontent_create">
  61. Click to record a new supplier invoice.
  62. </p><p>
  63. You can control the invoice from your supplier according to
  64. what you purchased or received. Odoo can also generate
  65. draft invoices automatically from purchase orders or receipts.
  66. </p>
  67. </field>
  68. </record>
  69. <menuitem name="Gastos" id="expense_main_menu" sequence="30"/>
  70. <menuitem name="Gastos" id="expense_submenu_1" parent="expense_main_menu" sequence="10"/>
  71. <menuitem name="Registrar Gastos" id="menu_expense" action="action_expense" parent="expense_submenu_1" sequence="10"/>
  72. <menuitem name="Proveedores" id="menu_expense_supplier" action="base.action_partner_supplier_form" parent="expense_submenu_1" sequence="20"/>
  73. <menuitem name="Productos" id="expense_submenu_2" parent="expense_main_menu" sequence="20"/>
  74. <menuitem name="Productos" id="menu_expense_products" action="action_expense_products" parent="expense_submenu_2" sequence="10"/>
  75. </data>
  76. </openerp>