Introduction


2 files need to be modified when we creating a custom model
  1. _ _openerp_ _.py
  2. <view name>.xml

<view name>.xml


There are two general views in openerp that is inherited from ir.ui.view
  1. Tree view
    • Allow user to select more than one data
    • Allow print, delete more than one data
    • Allow to create new data in tree view
    • Allow to control the list of data that going to show in tree list
  2. Form view
    • Allow user to view the details of a data
    • Allow user to edit the existing data
  3. The xml format must be as following.
    empty_view_xml.png
  4. one model → muliple menus > multiple actions > multiple formview and list view
    Example: Please refer to phone call under the Sale > Phone calls > logged calls
  5. Action need to be created in order to present the model to the view. action is inherit from the ir.actions.act_window
  6. Create menus to execute the action

_ _openerp_ _.py




There are two sections need to update when adding a new view
No.
Tags
Description
1
depends
Contains the list of dependencies.
Eg. 'depends' : ['base', 'sales', ... ]
2
data
Contains the relative path of
custom views, actions, workflows.
Eg. 'data' : ['college_view.xml', ]
  • Making sure that the sequence of defining items are correct.
    • Example of this sequence is
      • sequence of declaration of XML files in openerp.py
      • declaration of many2one and one2many in the python file.


References


  1. https://doc.openerp.com/v6.1/developer/03_modules_3/