
Search In
If you want to mapped the records in OpenERP(Odoo) follow the below mentioned code and paste it in your (Python).py file: →
# returns a list of summing two fields for each record in the set
records.mapped(lambda r: r.field1 + r.field2)
# returns a l
Low level sql is the cursor for the current database transaction and allows executing SQL directly, either for queries which are difficult to express using the ORM
For example you can take idea from below code-
self.env.cr.execute("some_sql", param1
Its indicate no selection constraint in database. Selection must be
set as a list of tuples or a callable that returns a list of tuples
In below code i have explain search_read
aselection = fields.Selection([('a', 'A')])
aselection = fields.Selectio
If you want to make a functionality that can be used anywhere in the code. For example, you want some method that can be called on the jquery selection and it can perform number of operations on the selection. For this, you can write a plugin.
For e
Api unity of returned value will return a RecordSet of specified model based on original
returned value:
In below code i have explain api_returns
@api.returns('res.partner')
def afun(self):
...
return x # a RecordSet
Note- And if an old API functi
Api.onchange will trigger the call to the decorated function if any of the fields specified in the decorator is changed in the form:
In below code you can use in your .py file.
@api.onchange('fieldx')
def do_stuff(self):
if self.fieldx == x:
self.fi
Api.depends will trigger the call to the decorated function if any of the fields specified in the decorator is altered by ORM or changed in the form:
In below code you can use in your .py file.
@api.depends('name', 'an_other_field')
def afun(self):
If you want to use greetingswidget in OpenERP(Odoo) follow the below mentioned code and paste it in your wizard .js file:
local.HomePage = instance.Widget.extend({
start: function() {
this.$el.append("Hello dear Odoo user!");
va
If you want to widget parents and Children in OpenERP(Odoo) follow the below mentioned code and paste it in your wizard .js file:
local.HomePage = instance.Widget.extend({
start: function() {
var greeting = new local.GreetingsWidget(thi
In count records retrieve a list of records and count them, search_count() can be used to retrieve only the number of records matching the query. It takes the same domain filter as search() and no other parameter.For example code is like below.
mode
