Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Form Views Default Rules

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 266
    Comment on it

    Default Rules of Form Views-

    1. Form Views shows how each object is displayed in openerp browser.
    2. The field disposition in a form view always follows the same principle.
    3. Fields are placed on the screen from left to right, and from top to bottom, according to the order in which they are declared in the view.
    4. Every screen is divided into 4 columns, each column will be able to contain either a label, or an edition field. As every edition field is preceded (by default) by a label with its name, there will be two fields (and their respective labels) on each line of the screen. The green and red zones on the screen-shot below, illustrate those 4 columns. They designate respectively the labels and their corresponding fields.
      On Change
    5. The on_change attribute defines a method that is called when the content of a view field has changed.

      <field name="name_of_field" on_change="name_of_method(other_;field'_;1_', ..., other_field'_;n_')"/>
      
      /* def onchange_;shop_id(self, cr, uid, ids, shop_id):
      
          v={}
          if shop_id:
      
              shop=self.pool.get('sale.shop').browse(cr,uid,shop_id)
              v['project_id']=shop.project_id.id
              if shop.pricelist_id.id:
      
                  v['pricelist_id']=shop.pricelist_id.id
      
              v['payment_default_id']=shop.payment_default_id.id
      
          return {'value':v}
      

    6. Tree views
    7. These are the views which are used while work on list mode (in order to visualize several resources at once) and in the search screen. These views are simpler as the form views and thus have less options.

    8. Search views
    9. Search views creates customized search panel and these are declared much similarly to a form views, the only difference is that the view type and root element change to search instead of form. Search views are a new feature of OpenERP supported as of version 6.0.
    10. Group tag
    11. Far a part form group elements, unlimited number of widget are supported by search view groups (fields or filters) in a row (no automatic line wrapping), and only use the following attributes:

      <group expand="1" string="Group By...">
         <filter string="Users" icon="terp-project" domain="[]" context="{'group_by':'user_id'}"/>
         <filter string="Project" icon="terp-project" domain="[]" context="{'group_by':'project_id'}"/>
         <separator orientation="vertical"/>
         <filter string="Deadline" icon="terp-project" domain="[]" context="{'group_by':'date_deadline'}"/>
      </group>
      

    12. Filter tag
    13. Filters are displayed as a toggle button on search panel Filter elements can add new values in the current domain or context of the search view.

      <filter string="Current" domain="[('state','in',('open','draft'))]" help="Draft, Open and Pending Tasks" icon="terp-project"/>
      <field name="project_id" select="1" widget="selection">
          <filter domain="[('project_id.user_id','=',uid)]" help="My Projects" icon="terp-project"/>
      </field>
      

    14. Graph views
    15. A graph is a new mode of view for all views of type form. for example, a sale order line must be visible as list or as graph, define it like this in the action that open this sale order line.

      <field name="view_type">form</field>
      <field name="view_mode">tree,graph</field>
      

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: