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
    • 246
    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.

    1. models.execute _kw(db, uid, password, 'ir.model', 'create', [{
    2. 'name': "Custom Model",
    3. 'model': "x_custom_model",
    4. 'state': 'manual',
    5. }])
    6. models.execute_kw(
    7. db, uid, password, 'x_custom_model', 'fields_get',
    8. [], {'attributes': ['string', 'help', 'type']})
    9. {
    10. "create_uid": {
    11. "type": "many2one",
    12. "string": "Created by"
    13. },
    14. "create_date": {
    15. "type": "datetime",
    16. "string": "Created on"
    17. },
    18. "_last_update": {
    19. "type": "datetime",
    20. "string": "Last Modified on"
    21. },
    22. "write_uid": {
    23. "type": "many2one",
    24. "string": "Last Updated by"
    25. },
    26. "write_date": {
    27. "type": "datetime",
    28. "string": "Last Updated on"
    29. },
    30. "display_name": {
    31. "type": "char",
    32. "string": "Display Name"
    33. },
    34. "id": {
    35. "type": "integer",
    36. "string": "Id"
    37. }
    38. }

    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
Reset Password
Fill out the form below and reset your password: