Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to set inspection and introspection in OpenERP/Odoo ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 224
    Comment on it

    Odoo stores most model metadata inside a few meta-models which allow both querying the system and altering models and fields on the fly over XML-RPC.
    For example code like below.

    models.execute _kw(db, uid, password, 'ir.model', 'create', [{
        'name': "Custom Model",
        'model': "x_custom_model",
        'state': 'manual',
    }])
    models.execute_kw(
        db, uid, password, 'x_custom_model', 'fields_get',
        [], {'attributes': ['string', 'help', 'type']})
    {
        "create_uid": {
            "type": "many2one",
            "string": "Created by"
        },
        "create_date": {
            "type": "datetime",
            "string": "Created on"
        },
        "_last_update": {
            "type": "datetime",
            "string": "Last Modified on"
        },
        "write_uid": {
            "type": "many2one",
            "string": "Last Updated by"
        },
        "write_date": {
            "type": "datetime",
            "string": "Last Updated on"
        },
        "display_name": {
            "type": "char",
            "string": "Display Name"
        },
        "id": {
            "type": "integer",
            "string": "Id"
        }
    }
    

    Note- With the help of this code we will set inspection and introspection.

 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: