
Search In
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
To copy the image on NSPasteBoard following code can be used:
- (IBAction)paste:sender
{
NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
NSArray *classArray = [NSArray arrayWithObject:[NSImage class]];
NSDiction
During User registration it is very necessary to check that entered email id is valid or not. To check that following code will help you.
- (BOOL)validateEmailWithString:(NSString*)email
{
NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za
Sometime we don't know name of the method at compile time. So pass the method name as argument and use the following lines of code.
NSString *methodname=@"calltest";
SEL aSelector = NSSelectorFromString(methodname);
NSInvocation *inv = [NSInvocatio
Hello all,
If you want to delete all directory and files recursively by using php script, for this please follow the below mentioned code.
<?php
function deleteDirectory($filename) {
if(is_dir($filename))
$handle = opendir($filename);
i
Inline styles have the highest priority of all CSS. In general, I would recommend you avoid using them and place your CSS declarations in external files. However, you may not have that luxury if you are working on a legacy system or do not have direc
Hi if you want a condition where you want to load another model inside you model.
you can do as I code follow
App::import('Model', 'MyModel');
$my_model = new MyModel();
Or you can write
$this->SomeModel->MyModel
if you have already this
