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)