
Search In
To get the current page url in laravel 4.x is as follow
$webpageURL=URL::to('/');
By using the above code it will automatically take the web page url.
Example:
Lets take a example of findnerd.
**http://findnerd.com/account#url=/postblog/94
Hello Reader's If you have writing the code that makes the cookies for valid lifetime then you just need to set big number for it's validity. As the example below PHP code:-
Maximum value: 2147483647
setcookie("CookieName", "CookieValue", 21474836
Hello All,
Working with the SQL Database, I wanted to search a specific column in all the tables of database and to do that I use the following code packet.
SELECT TABLE_NAME,COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME LIKE '% You
To call ajax you need to execute the following code:
$.ajax({
type: "POST",
url: 'pagename.php', //location of the server
data: varData, //data send to the server
succes
If you want to use model reference in OpenERP(Odoo) follow the below mentioned code and paste it in your (Python).py file: →
class openerp.models.Model(pool, cr)
class user(Model):
Note-Above code are created by inheriting from this clas
A search_read function is now available. It will do a search and return a list of dict.
In below code i have explain search_read
self.search_read([], ['name'])
[{'id': 3, 'name': u'Administrator'},
{'id': 7, 'name': u'Agrolait'},
{'id': 43, 'name':
When we are using cursor we should use current environment cursor:
like below code.
self.env.cr
except if we need to use threads,we use like below code.
Environment.manage():
env = Environment(cr, uid, context)
Note- Environment.manage() indica
If you want to get access right in OpenERP(Odoo) follow the below mentioned code and paste it in your model.py file: →
class test_partner_firstname(common.TransactionCase):
def setUp(self):
super(test_partner_firstname, self).setUp()
self.user_mode
We will have to remove .py file, rename the class and its attributes to something like
below code.
from osv import osv, fields
class travel_hostel(osv.osv):
_name = ’travel.hostel’
_inherit = ’res.partner’
_columns = {
’rooms_id’: fields.one2many(’
If you want to make print a report in OpenERP(Odoo) follow the below mentioned code and paste it in your model.py file: -
def _get_invoice_id(self, uid, datas):
...
return {’ids’: [...]}
...
’actions’: [_get_invoice_id],
’result’: {’type’:’print’,
