Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to communicate with the Odoo Server ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 150
    Comment on it

    Most operations with Odoo involve communicating with models implementing business concern, these models will then interact with some storage engine.
    JQuery provides ajax function for network interactions, communicating with Odoo requires additional metadata whose setup before every call would be verbose and error-prone. As a result, Odoo web provides higher-level communication primitives.For example code is like below.

    class message_of_the_day(models.Model):
        _name = "oepetstore.message_of_the_day"
    
        @api.model
        def my_method(self):
            return {"hello": "world"}
    
        message = fields.Text(),
        color = fields.Char(size=20),
    

    Note-This declares a model with two fields, and a method my_method() which returns a literal dictionary.

 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: