Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Basic OpenERP Object Attributes and Different Field Types

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 238
    Comment on it

    An object attributes is defined by declaring some fields with predefined names in the class. Two of them which are required (_name and _columns).

    The predefined fields are:

    _auto: Determines whether a corresponding PostgreSQL table must be generated automatically from the object.

    1. _columns (required)

    2. _constraints

    3. _defaults

    4. _inherit

    5. _inherits

    6. _log_access

    7. _name (required)

    8. _order

    9. _rec_name

    10. _sequence

    11. _sql

    12. _table

    13. object declaration :

      class name_of_the_object(osv.osv):
              _name = 'name.of.the.object'
              _columns = { ... }
              ...
      name_of_the_object()
      

      Fields declaration:

      class other_material(osv.osv):
          _name = 'other.material'
          _inherit = 'network.material'
          _columns = {
              'manuf_warranty': fields.boolean('Manufacturer warranty?'),
          }
          _defaults = {
              'manuf_warranty': lambda *a: False,
          }
          other_material()
      
      

 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: