2016-04-28

How To Create a New Module on the Odoo

If we are trying to build a new module of the Odoo, we should type the command like:


python odoo.py scaffold Academy openerp/my-modules

This command generates the Odoo module scaffold named Academy to the directory openerp/my-modules. But when we try to install this new Academy module under the Setting page, we cannot find an Academy module for us to install.

In order to find this new module, we need to use the "Update Module List" option.

If we can't find the option "Update Module List" either, we need to enable the "Technical Features" checkbox in our current user's settings.

Need to do some steps:

First, select side menu Users-Users  and click the Administration user. Then we can see the form view of the User/Administrator. Click the "Technical Features" checkbox and save the settings.


Then, select side menu of Modules-"Update Module List", and click the Update button.


Finally,  select side menu Modules-Local Modules,remove all filters and sort the module list. We will see the Academy module in the first position.


Going to http://localhost:8069/academy/academy/  will see the new module.

If we've added some  templates or have modified codes of the module Academy , we will need to upgrade the module again.

We should restart Odoo and update the module's data (to install the template) by going to Settings-Modules-Local Modules-Academy and clicking the Upgrade button.
Going to http://localhost:8069/academy/academy/  should show new updated results.

Reference:

Building a Website — odoo 8.0 documentation


2016-04-23

Coding 5 Languages at once: If Statement

    If we want computer do something based on different conditions, we can use the "IF" statement.
    If the "If condition Then" statement finds the result is True then if will continue the next statement. Otherwise, it will find the next "ElseIf condition Then" statement to test another condition. If no condition is matched, it will find the "Else" statement to go. Or the "End If" statement, if there is no "Else" found.
    Other languages use the "{...}" to define a black of statements. If the condition is True, it will perform all statements within the block.

BASIC:
        ' *******************************************
        ' Condition statement (If..ElseIf..Else..End If)
        ' *******************************************
        Sub IfStatement()
            Dim dPara1 as Double
            Dim dPara2 as Double
            dPara1 = 1.0
            dPara2 = 2.0
            ' Condition statement (If..ElseIf..Else..End If)
            If dPara1 > dPara2 Then
                ' Is Greater Than
                Debug.Print " ";"dPara1 > dPara2";
                Debug.Print
            ElseIf dPara1  = dPara2 Then
                ' Equals to
                Debug.Print " ";"dPara1 ==dPara2";
                Debug.Print
            ElseIf dPara1 < dPara2 Then
                ' Is Less Than
                Debug.Print " ";"dPara1 < dPara2";
                Debug.Print
            End If
            If dPara1 <> dPara2 Then
                ' not equal to
                Debug.Print " ";"dPara1 <> dPara2";
                Debug.Print
            End If
            ' And Logic
            If dPara1 > dPara2 AND dPara1  = dPara2 Then
                Debug.Print " ";"dPara1 >=dPara2";
                Debug.Print
            ' Or Logic
            ElseIf dPara1 > dPara2 OR dPara1 < dPara2 Then
                Debug.Print " ";"dPara1 <> dPara2";
                Debug.Print
            End If
        End Sub


C++:
        /* ******************************************* */
        /* Condition statement (If..ElseIf..Else..End If) */
        /* ******************************************* */
        void IfStatement() {
            double dPara1;
            double dPara2;
            dPara1 = 1.0;
            dPara2 = 2.0;
            /* Condition statement (If..ElseIf..Else..End If) */
            if (dPara1 > dPara2) {
                /* Is Greater Than */
                printf(" %s" , "dPara1 > dPara2");
                printf("\n" );
            } else if (dPara1 ==dPara2) {
                /* Equals to */
                printf(" %s" , "dPara1 ==dPara2");
                printf("\n" );
            } else if (dPara1 < dPara2) {
                /* Is Less Than */
                printf(" %s" , "dPara1 < dPara2");
                printf("\n" );
            }
            if (dPara1 != dPara2) {
                /* not equal to */
                printf(" %s" , "dPara1 <> dPara2");
                printf("\n" );
            }
            /* And Logic */
            if (dPara1 > dPara2 && dPara1 ==dPara2) {
                printf(" %s" , "dPara1 >=dPara2");
                printf("\n" );
            /* Or Logic */
            } else if (dPara1 > dPara2 || dPara1 < dPara2) {
                printf(" %s" , "dPara1 <> dPara2");
                printf("\n" );
            }
        }

JAVA:   
        // *******************************************
        // Condition statement (If..ElseIf..Else..End If)
        // *******************************************
        public void IfStatement()  {
            double dPara1;
            double dPara2;
            dPara1 = 1.0;
            dPara2 = 2.0;
            // Condition statement (If..ElseIf..Else..End If)
            if (dPara1 > dPara2) {
                // Is Greater Than
                System.out.print(" "+"dPara1 > dPara2" );
                System.out.println("");
            } else if (dPara1 ==dPara2) {
                // Equals to
                System.out.print(" "+"dPara1 ==dPara2" );
                System.out.println("");
            } else if (dPara1 < dPara2) {
                // Is Less Than
                System.out.print(" "+"dPara1 < dPara2" );
                System.out.println("");
            }
            if (dPara1 != dPara2) {
                // not equal to
                System.out.print(" "+"dPara1 <> dPara2" );
                System.out.println("");
            }
            // And Logic
            if (dPara1 > dPara2 && dPara1 ==dPara2) {
                System.out.print(" "+"dPara1 >=dPara2" );
                System.out.println("");
            // Or Logic
            } else if (dPara1 > dPara2 || dPara1 < dPara2) {
                System.out.print(" "+"dPara1 <> dPara2" );
                System.out.println("");
            }
        }
   

C#:
        /* ******************************************* */
        /* Condition statement (If..ElseIf..Else..End If) */
        /* ******************************************* */
        public void IfStatement()  {
            double dPara1;
            double dPara2;
            dPara1 = 1.0;
            dPara2 = 2.0;
            /* Condition statement (If..ElseIf..Else..End If) */
            if (dPara1 > dPara2) {
                /* Is Greater Than */
                Console.Write(" "+"dPara1 > dPara2");
                Console.WriteLine("");
            } else if (dPara1 ==dPara2) {
                /* Equals to */
                Console.Write(" "+"dPara1 ==dPara2");
                Console.WriteLine("");
            } else if (dPara1 < dPara2) {
                /* Is Less Than */
                Console.Write(" "+"dPara1 < dPara2");
                Console.WriteLine("");
            }
            if (dPara1 != dPara2) {
                /* not equal to */
                Console.Write(" "+"dPara1 <> dPara2");
                Console.WriteLine("");
            }
            /* And Logic */
            if (dPara1 > dPara2 && dPara1 ==dPara2) {
                Console.Write(" "+"dPara1 >=dPara2");
                Console.WriteLine("");
            /* Or Logic */
            } else if (dPara1 > dPara2 || dPara1 < dPara2) {
                Console.Write(" "+"dPara1 <> dPara2");
                Console.WriteLine("");
            }
        }


PHP:   
        /* ******************************************* */
        /* Condition statement (If..ElseIf..Else..End If) */
        /* ******************************************* */
        function IfStatement()  {
            $dPara1 = 1.0;
            $dPara2 = 2.0;
            /* Condition statement (If..ElseIf..Else..End If) */
            if ($dPara1 > $dPara2) {
                /* Is Greater Than */
                echo " "."dPara1 > dPara2";
                echo "";
            } elseif ($dPara1 ==$dPara2) {
                /* Equals to */
                echo " "."dPara1 ==dPara2";
                echo "";
            } elseif ($dPara1 < $dPara2) {
                /* Is Less Than */
                echo " "."dPara1 < dPara2";
                echo "";
            }
            if ($dPara1 != $dPara2) {
                /* not equal to */
                echo " "."dPara1 <> dPara2";
                echo "";
            }
            /* And Logic */
            if ($dPara1 > $dPara2 && $dPara1 ==$dPara2) {
                echo " "."dPara1 >=dPara2";
                echo "";
            /* Or Logic */
            } elseif ($dPara1 > $dPara2 || $dPara1 < $dPara2) {
                echo " "."dPara1 <> dPara2";
                echo "";
            }
        }

2016-04-19

Learn Coding Five Languages at once: For Statement

If we want to perform an instruction many times, we can copy this instruction many times or use a "For...Next" block. This "For" statement assigns an initial value to a variable and change it up to the end value stepping with +1 or -1.

For example, "For i=1 to 5 " statement assign value 1 to the variable i and loop it up to the end value 5 with stepping value 1 each time. When program meets the "Next"  statement, it will jump back to the "For" statement. But if the variable exceeds the end value, the program will jump to the statement next to "Next".

Here we show the example of looping five times and print the value of the variable i in five different programming languages:

BASIC:
        ' *******************************************
        ' for loop statement (For..Next)
        ' *******************************************
        Sub ForLoop()
            ' Declare local variable
            Dim i as Integer
            Debug.Print " ";"**** For statement ***";
            Debug.Print
            For i=1 to 5
                Debug.Print " ";"i=";
                Debug.Print " ";i;
                Debug.Print
            Next
        End Sub

C++:
        /* ******************************************* */
        /* for loop statement (For..Next) */
        /* ******************************************* */
        void ForLoop() {
            /* Declare local variable */
            int i;
            printf(" %s" , "**** For statement ***");
            printf("\n" );
            for (i=1; i<= 5; i++) {
                printf(" %s" , "i=");
                printf(" %d" , i);
                printf("\n" );
            }
        }

JAVA:
        // *******************************************
        // for loop statement (For..Next)
        // *******************************************
        public void ForLoop()  {
            // Declare local variable
            int i;
            System.out.print(" "+"**** For statement ***" );
            System.out.println("");
            for (i=1; i<= 5; i++) {
                System.out.print(" "+"i=" );
                System.out.print(" "+i );
                System.out.println("");
            }
        }
   
C#:
        /* ******************************************* */
        /* for loop statement (For..Next) */
        /* ******************************************* */
        public void ForLoop()  {
            /* Declare local variable */
            int i;
            Console.Write(" "+"**** For statement ***");
            Console.WriteLine("");
            for (i=1; i<= 5; i++) {
                Console.Write(" "+"i=");
                Console.Write(" "+i);
                Console.WriteLine("");
            }
        }

PHP:   
        /* ******************************************* */
        /* for loop statement (For..Next) */
        /* ******************************************* */
        function ForLoop()  {
            /* Declare local variable */
            echo " "."**** For statement ***";
            echo "";
            for ($i=1; $i<= 5; $i++) {
                echo " "."i=";
                echo " ".$i;
                echo "";
            }
        }
   

2016-04-16

Learn Computer Languages from BASIC,C++, JAVA, C# to PHP at once

Computer programming languages from BASIC,C++, JAVA, C#  to PHP seem different, but actually they can do the same task. We can study them all together under some basic topics.

The first lesson of coding to understand assignment like a=a+1. This is not an equation. It simply means compute a+1 and put the result back to a.

Here we list some statements of assignment in five different programming languages: BASIC,C++, JAVA, C# and PHP.



' Value Assignment
iA = 1*2+3/4-5
iB = 1*(2+3)/4-5
iC =iA  Mod  2

' Print  iA,iB,iC

' String Assignment
sS="abc"

' String Catenation
sS=sS+"<>"
sS=sS+"def"

' Print  sS



BASIC:
        ' *******************************************
        '  Assignment Statement BASIC
        ' *******************************************
        Sub AssignmentStatement()
            Dim iA as Integer
            Dim iB as Integer
            Dim iC as Integer
            Dim sS as String
            ' Value Assignment
            iA = 1*2+3/4-5
            iB = 1*(2+3)/4-5
            iC =iA  Mod  2
            Debug.Print " ";iA;
            Debug.Print " ";iB;
            Debug.Print " ";iC;
            Debug.Print
            ' String Assignment
            sS="abc"
            ' String Catenation
            sS=sS+"<>"
            sS=sS+"def"
            Debug.Print " ";"sS=";
            Debug.Print " ";sS;
            Debug.Print
        End Sub

C++:
        /* ******************************************* */
        /* Assignment Statement  C++                                    */
        /* ******************************************* */
        void AssignmentStatement() {
            int iA;
            int iB;
            int iC;
            char* sS;
            /* Value Assignment */
            iA = 1*2+3/4-5;
            iB = 1*(2+3)/4-5;
            iC =iA % 2;
            printf(" %d" , iA);
            printf(" %d" , iB);
            printf(" %d" , iC);
            printf("\n" );
            /* char* Assignment */
            vstrcpy((char**)&sS, "abc");
            /* char* Catenation */
            vstrcat((char**)&sS, "<>");
            vstrcat((char**)&sS, "def");
            printf(" %s" , "sS=");
            printf(" %s" , sS);
            printf("\n" );
            vfree((char*)sS);
        }

JAVA:
        // *******************************************
        // Assignment Statement JAVA
        // *******************************************
        public void AssignmentStatement()  {
            int iA;
            int iB;
            int iC;
            String sS = null;
            // Value Assignment
            iA = 1*2+3/4-5;
            iB = 1*(2+3)/4-5;
            iC =iA % 2;
            System.out.print(" "+iA );
            System.out.print(" "+iB );
            System.out.print(" "+iC );
            System.out.println("");
            // String Assignment
            sS="abc";
            // String Catenation
            sS=sS+"<>";
            sS=sS+"def";
            System.out.print(" "+"sS=" );
            System.out.print(" "+sS );
            System.out.println("");
        }

C#:
        /* ******************************************* */
        /* Assignment Statement C#                                        */
        /* ******************************************* */
        public void AssignmentStatement()  {
            int iA;
            int iB;
            int iC;
            String sS = null;
            /* Value Assignment */
            iA = 1*2+3/4-5;
            iB = 1*(2+3)/4-5;
            iC =iA % 2;
            Console.Write(" "+iA);
            Console.Write(" "+iB);
            Console.Write(" "+iC);
            Console.WriteLine("");
            /* String Assignment */
            sS="abc";
            /* String Catenation */
            sS=sS+"<>";
            sS=sS+"def";
            Console.Write(" "+"sS=");
            Console.Write(" "+sS);
            Console.WriteLine("");
        }

PHP:
        /* ******************************************* */
        /* Assignment Statement  PHP                                    */
        /* ******************************************* */
        function AssignmentStatement()  {
            /* Value Assignment */
            $iA = 1*2+3/4-5;
            $iB = 1*(2+3)/4-5;
            $iC =$iA % 2;
            echo " ".$iA;
            echo " ".$iB;
            echo " ".$iC;
            echo "";
            /* String Assignment */
            $sS="abc";
            /* String Catenation */
            $sS.="<>";
            $sS.="def";
            echo " "."sS=";
            echo " ".$sS;
            echo "";
        }

2016-04-15

How can we adjust the size of Android Camera Preview on the Screen


In this Android Camera test example, we will see the full screen preview view on the screen.
However, we can not set arbitrary camera size we want. We can only select one of the sizes returned from getSupportedPreviewSizes call, like:

    mSupportedPreviewSizes = mCamera.getParameters().getSupportedPreviewSizes();

And later we set the Preview size with the call setPreviewSize() in the surfaceChanged method:
    parameters.setPreviewSize(mPreviewSize.width, mPreviewSize.height);

We can not set any other values. Otherwise the app will generate error.

Then, How can we adjust the size of Camera Preview on the Screen if we don't any of the Supported Preview Sizes?

Simple! Since we cannot change the input of the surface View, but we change the
surface View output. We can adjust  the size of the surface View to any value as we wish.


Reference:

josnidhin/Android-Camera-Example

2016-04-10

Animation of Aerobic Exercise, Jump and Kick

This is an animation of Aerobic Exercise. The 3D model does the Jump and Kick exercise for both forward and backward direction. Not only the body, we also generate the movements of cloth and hair while jumping.



Jump and kick left leg forward.


Jump and kick right leg forward.


Jump and kick left leg backward.

 Jump and kick right leg backward.



Jump and left knee up.


Jump and right knee up. 


2016-04-09

Convert Sales Opportunity to Quotation on your Sales system

After the meeting and calls with the potential customers, it will be the time to send the reference prices of products for their reference. We can convert sales opportunity to quotation on the OpenERP sales system.

From the Sales-Opportunities view screen, we can check which can be converted into the quotation stage and click it.


 Then we can see the detailed form view of the Opportunity.


 Click the Convert to Quotation button.


Click the Edit button to add some items into the quotation and then click Save to convert it into a formal Quotation.



Install CentOS Linux on Windows with VMware Player

It would be very helpful for a programmer to run different virtual machines on one desktop PC while we test our program.  Here we show the procedures of installing CentOS under the VMware Player.


Start the VMware Player.


 Click 'Create a New Virtual Machine','Next'
 

Select 'I'll install the operating System Later'
 

Select 'Linux', click 'Next'


Set Location if you want to change  the default setting. Click 'Next'
 
 
Click 'Next'
 

Click 'Finish'
 
 
Click 'Edit virtual machine settings'
 

Click 'OK'
 

Select 'CD/DVD'. Select 'Use ISO image file' if you are using an ISO centos file.
 
 
Click 'Play virtual machine'
 

Start installing CentOS6 as usual.






2016-04-07

From Leads to Opportunities on the Sales Process

    A sales process includes the stages of Prospecting, Approaching, Presenting, Closing, Following up and Referral. The first sales stage is prospecting. Normally a company will attend trade shows,  conferences or seminars to meet the prospects. Sales people collect their name cards and come back to the office to analyze who will be the possible customers. How can we keep track of these leads and plan the future activities? The answer is the Sales system of the OpenERP.
   
    We can create a new lead by entering the Sales-Leads view and click the Create button. Then we input all information from the name cards of prospects.



Click Save button after we finish the task. We can see the new lead has been added into the Leads view.


After the internal analysis process, we will filter the leads and convert them into Opportunities by clicking the Convert to Opportunity button on the Leads view.

If we select the Sales-Opportunities from the left hand side menu, we can see the form of all opportunities.


It's also possible to show the opportunities distribution of different sales stages by clicking the Graph icon on the right hand side of the screen.
 

 If we select the KanBan view, we can move opportunities between stages by drag-n-drop.

W can also fold or unfold different stage columns, or increase a new sales stage column into the view.





2016-04-06

Create a new company on the Sales system of the OpenERP(Odoo)

For the medium or small businesses, the business automation is quite a helpful tool to increase the productivity. With a limited budget, an open source software is quite suitable for concept building and feasibility study of an ERP system. Here we introduce an Odoo(formerly known as OpenERP) open source ERP system, A system with two million users currently.

Starting from the Sales system, the first thing we need to do is to create a company name. Select the Company-Company from the menu.


Click the Create button to create a new company. Input the company name.


Click the Save button. Then we've created a new company name.


Then we click the Your Company Logo and click the pen to update the company logo.








2016-04-05

The present value of the future money calculator

The present value of a certain amount of the future money is how much money we need to invest today in order to get  return of that amount of money in the future. Normally the investment today will receive the investment return plus capital in the future. Therefore the present value of money is less than the amount of the future money if the interest rate is positive.

CubicPower provides a calculator to calculate the present value of the future money.

http://www.cubicpower.idv.tw/php/Mobile/EN/PresentValueInterestFactorMobile.php



We only need to input the interest rate and the periods, then click the SEND button. The returned value is how much is the present value of one dollar in the future.

2016-04-04

Practice the Vertical Addition from CubicPower online

The Vertical Addition is quite a basic skill of math. Once the a student has learned the meaning of the number and addition of two numbers, then it will be the time to practice the skill of the vertical addition. The CubicPower Vertical Addition online practice allows students to set the digits of number and correct the error on each digit.

Click the following link to start the practice on the CubicPower:
http://www.cubicpower.idv.tw/php/Mobile/EN/VerticalAdditionMobileEN.php

Click the New button to get a new pair of numbers.


Select your answer of each digit column, then click the Check button.

 
You can correct your answer and then click the Check button again.

 

Or we can set the Digits to  two, then click the New button to get a pair of double digit numbers.




 Or three-digit numbers.





2016-04-01

Too Many Startup Pitching Events

    Since last few years, we've seen so many startup conferences, competitions, pitching events,  government schemes, accelerators and incubators around us. Do they actually work?
Actually, same people attended most of these events. Investors got bored to listen to these similar pitches. And the founders spent so much of time and budget to prepare the presentation on the events. How many founders actually got a check from the investors on these events?
    The founders of the startup  companies should spend time on the business development process. Get in touch with potential customers and generate more revenue. Once you have an impressive growth in your business, investors will come to see you.


Reference:

Beware of Startup Prostitution — Life Tips

My Notes:

10 personal reasons why you should stop taking part in beauty parades and spend more time building your business:

- Too Many Startup Pitching Events

- Fundraising

- Startup Conferences 

- Women & Startups 

- Hiring 

- Mentor Backlash

- Product Market

 - Startup Training 

- Let’s Talk Money

- EXIT is a Dirty word. OR NOT.