Override default view with custom module?

Is there a way to override the default views for openerp by developing a module instead of doing it manually from the / Customization / User Interface / Views ... settings?

We use OpenERP and configure many default views (List of projects, List of accounts, Search of accounts, etc.), adding and hiding the fields from the list and filters / search groups, we do this manually, viewing the view from the web client. Is there a way to develop a module where I can write xml for all the views I want to configure, and when I install this module, all updates (and window actions will also be updated) will be updated?

+5
source share
3 answers

View Inheritance XML.

, , . , . XML , . __init__.py, __openerp__.py XML.

, EAN13 .


__init__.py


__openerp__.py

{
    "name" : "View Customization Test",
    "version" : "1.0",
    "category" : "Generic Modules/Inventory Control",
    'depends' : ['product',],
    "update_xml" : ["product.xml",],
    "installable": True,
    "active": True
}

product.xml

<?xml version="1.0" encoding="utf-8"?>
<openerp>
  <data>
    <record model="ir.ui.view" id="view_product_form_custom">
      <field name="name">product.form.inherit2</field>
      <field name="model">product.product</field>
      <field name="inherit_id" ref="product.product_normal_form_view" />
      <field name="arch" type="xml">
        <field name="ean13" position="replace" />
      </field>
    </record>
  </data>
</openerp>
+6

, . . . . Memento - , .

, .

0

, ( ).

  • __init__.py [ python]
  • __openerp__.py [ OpenERP]
  • xml XML- view.xml __openerp__.py. .
0

All Articles