If your server is on a different location and you need a synchronization with it to get in the proper time. Then you need to get the correct time according to that specific location.
To do so the timezone to the specific location.
This can be...
The date function in PHP is the one which formats the timstamp to a readable form.
The Syntax of it is as :
date(format,timestamp)
The required format function is to specify the format of the date and the timestamp Specifies default curr...
Read Single Line: fgets()
To read a single line from a file fgets() function is used.
For example: Suppose we have a file 'demo.txt'. The script given below results the first line of the file:
<?php
$filename = fopen("demo.txt", "r") ...
In javacsript function first we have to move on src file and open the .js file and go one step further by creating a javascript file, name it tutorial_editor.js and place it into the static folder.
For example you can see be...
For drooping the snippet onto the page first we have to open the src file, add some class and css feature in css file and jas file after that clicks on an option, the system will add the class specified in the data-select_class attribute.
By rep...
In odoo-9 Options apply standard CSS classes to the snippet. Depending on the method that you choose, the UI will behave differently.
For example you can see below.
<template id="snippet_testimonial_opt" name="Snippet Testimonial Options" ...
In odoo-9 first we have to install odoo theme module then after We just created a template specifying our less file. As in below code you can see that, the template has a special attribute named inherit_id. This attribute tells Odoo that our...
In odoo-9 first we have to install odoo website builder module after this, lets first create an empty file and named it style.less and place it in a folder called less in static folder. The following rules will style our ...
To create a specific page layout in odoo-9 you have to first install odoo website builder module and after then at the top you need to ass a whole list of services and provide the possibility of settings to the user interface for the rest of the ...
In odoo-9 use Style and Css to make for dynamic website. Styles are defined using standard CSS files. You can define a style as default or optional. The default styles are always active in your theme, the optional styles can be ena...
Odoo default theme structure have many feature to given below.
1- Website builder
2- make odoo structure
3- build website within hour
4- Basic layouts for pages, blog and eCommerce
5- Website Builder integration
6- Basic Snippets
7- Autom...
CMS is the most important part of the Odoo/OpenERP. Its help to use in Odoo dynamic website.
CMS helps to make structure acts as a design foundation that you have to update over time to ensure compatibility within your CMS. For example see ...
If you want to extend the default header in odoo-9 , use the below code.
<Customize header>
<template id="custom_header" inherit_id="website.layout" name="Custom Header"> // this is a header template.
<Assign an id>
&l...
If you want to edit __openerp_.py in odoo-9 ,for example you can use below code.
{
'name':'Tutorial theme',
'description': 'A description for your theme.',
'version':'1.0',
'author':'Your name',
'data': [
],
'category': ...
If you want to create a theme module first you have to check _init.py file and __openERP.py file. After that you need to inherit the package theme to an Odoo module.
main folder-
Create a folder and name it like this: theme followe...
All the Odoo XML file starts with encoding specifications. After that, you have to write your code inside a <data> tag, placed into tag. For example you can see below code..
<xml version="1.0" encoding="utf-8">
<openerp>
&...
Theme is most important part of odoo website and its is also use to make odoo website.
When the themes have been installed only after then XML files loaded, and whenever you make changes on an xml file then each and ever time you will have to fo...
Hello Reader's If you have some arguments that you want to pass into function and elements of that array you pass will then be received by your function as distinct parameters.
For instance, if you have this function :
function test() {
...
Hello Reader's If you have some string in base64 and you need them to convert into image file, Then by using PHP you can do this as follows:-
function base64Tojpeg($base64_string, $output_file) {
$ifp = fopen($output_file, "wb");
$dat...
Hello Reader's if you are developing the website and you want to restrict file upload to max of 4 then you can use the code as below:-
The logic for this condition is you just have to return false is count of array is more than 4. Let's see ho...
If you are using Dropbox.js for file uploading and wants to upload some specific extension type like csv, xls etc. Please follow the below code::
Dropzone.options.uploadcontact = {
maxFilesize: 10, // Mb
acceptedFiles: ".xls,.xlsx,...
We can implement jquery ajax by this way
$this->layout = 'ajax';
Call above line in your function inside your controller file. by this way we can call the ajax layout.
Need to create a ajax.ctp file which is empty layout file.
...
I remember i was working on a project where there was a large set of data in the resultset and on the basis of that data i have to update some other model but i was unable to do it in batches due to some reason. So i was searching for a method in...
We can easily encrypt and decrypt the password in php using the code below. First need to create key and string and pass it on to the encrypt function which are given below for encryption.
$key = 'password for encrypt or decrypt';
$string = ...
If you have created_at and updated_at columns in the DB table. Rails will automatically set these values when you create and update a model object. There are chances that we have to update the columns without touching these columns.
You can do...
The HTML keygen element is used in submitting the forms with security. This submits a public key and generates a private key.
It is used in the form to generate key pair.
When we submit the form, it creates two key pair, one is for Public Ke...
We can insert multiple records in database using PHP. To do this, suppose we have database *example* having table demo with columns firstname, lastname, email. We need to insert multiple record in the table by using PHP. To insert the multiple re...
Being an Internet marketer link building is not considered as a difficult task, however searching quality data for link building is one of the most important challenge that every SEO exper...
Create File in PHP
To create a file in PHP fopen() function is used i.e., the function that is used to open a file is also used to create a file. If we use, fopen function() to open a file and file doesn't exist, it will create a new file.
F...
We can easily find date difference in php by using strtotime which convert two dates to unix time once convert we can manipulate easily by calculating the number of seconds between them.Its the easy way to calculate different time periods.
$...
In openerp first override the orm model and add fields field_view_get in orm model then return the Dictionary of Fields, arch and toolbar in orm model.
you can use this function as given below.
def fields_view_get(self, cr, user, view_id=Non...
Hello Guys,
I am facing an issue in my day to day work i.e when I Copy a content to paste it to website or document and in the meanwhile If I accidentally copy another content the previous content that I copied is not accessible to me.
SO...
History forward() method in JavaScript : The forward() method of a history object is used to load the next page browsed. In our application sometimes we required to go to next opened page, in this case the forward() function is used. It is same a...
Liferay use aui validator to validate input field of the form. Alloy script provide default validator but many times we need to create new type validator.
See below default liferay aui validator :
<aui:input name="firstName" type="text"...
In some cases we need to manipulate the data a bit before saving it. So there is a function called PrepareTable() in joomla which is declared under file modeladmin.php and it is located under the libraries/joomla/application/component folder and ...
Open a file in PHP:
To open a file in PHP fopen() funtion is used. Syntax:
fopen(filename, mode)
filename is the name of the file you want open. mode can be r,w,a,x,r+,w+,a+,x+.
Read a file in PHP:
To read an open file fread() ...
There are always a requirement when you have to update the multiple records at the same time using ActiveRecord with a single HTTP request. All you have to do is create a hash with keys as the primary key and value as another hash of all the fiel...
Parsing values in .NET
While converting or parsing values we need to provide the variable to convert and datatype to be converted into String
We will see here the difference between
1 Convert.ToString()
2 .ToString()
While handli...
Ways to open a file in PHP are given below:
1. r: Open a file for read only. File pointer points at the beginning of the file.
2. w: Open a file for write only. File pointer begins at the beginning of the file. It erases all the data of th...
History back() method in JavaScript : The back() method of a history object is used to load the previous page browsed. In our application sometimes we required to go to last opened page, in this case the back() function is used. It is same as the...
In openerp first install board module and inherit object and views in board module and check the current users id values and dictionary values for every fields and then create new record in board module in openerp.
you can use this function as...
In this article we will see how to pass an array of parameters to a stored procedure using xml. For illustration purpose we will be passing the
below list of id's :
<ids>
<id>1</id>
<id>2</id>
<...
In the following article we will go through a solution to a very common requirement of getting duplicate rows from SQL Server table based on specific columns.
Let us first create a table and add sample data to this table. Col1 in the table is an...
First need to create a model relationship lets assume that a user registration form and for each and every user has a profile.so there is one to one relationship between user model and profile model.
<?php
class User extends AppModel {
...
How to save CakePHP session in Database ?
To store session in Database, you need to create a table in DB so that you can store the session in it.
Follow below steps.
1. Create a table in DB
CREATE TABLE IF NOT EXISTS `users` (
`id` VARCH...
In the following article we will go through a solution to a very common requirement of removing delete duplicate rows from SQL server table.
Let us first create a table and add sample data to this table. Col1 in the table is an identity column.
...
In openerp first install board module and inherit object in your own module and write this function name createview and this function will check the user id and list of the board id in board.board object in openerp.
You can use this as given bel...
Hello Everyone, in this blog I teach you how to filter WooCommerce products by custom attribute.
There are wide range of filter Plugins for filter product with custom attribute in WooCommerce like :
1. YITH WooCommerce Ajax Product Filter
...
In the following article we will go through a solution to a very common requirement of getting count of duplicate rows from SQL server table.
Let us first create a table and add sample data to this table. Col1 in the table is an identity column....
APEX SQL
APEX in SQL is a product from Microsoft that is used for synching of data stored on different servers.
We have our main data stored in a main server and replica of those data are stored on different servers.
Consider...