List Vs Tuple in python with Odoo

Hello everyone

In this article we will emphasize the difference in the use of tuple and list :

list gives you values between brackets “[]”. For example, when we do in odoo:

account_ids = self.env['account.account'].search([])
account_ids ---> [1, 4, 5, 8 , 9]

account_ids is a list of values

We can use this list:

* in loops:

for account_id in account_ids:
     move = self.env['account.account'].search([('account_id', '=', account_id)])

* to search in another table:

move = self.env['account.account'].search([('account_id', 'in', account_ids)])

* to change or search a specific value:

account_ids[2] -----> 5
account_ids[4] -----> 9
account_ids[0] = 10 -----> will replace the first value "1" by "10"

* change a tuple to a list:

 list(my_tuple)

tuple gives you values between parentheses “()”. we can use them in :

* change a tuple to a list:

account_ids = tuple(self.env['account.account'].search([])) 
account_ids ---> (1, 4, 5, 8 , 9)

* in loops:

for account_id in account_ids:
     move = self.env['account.account'].search([('account_id', '=', account_id)])

* to search in another table:

move = self.env['account.account'].search([('account_id', 'in', account_ids)])

* in SQL filter Query:

In SQL Query we should use a tuple of values and not a list

account_ids = tuple(self.env['account.account'].search([]))
cr.execute('SELECT * FROM account_move_line where account_id in %s,(account_ids))

Install Odoo 10.0 ( Community) on Ubuntu 16.04 LTS

Hello everyone

This article will help you to install Odoo-10 Community on Ubuntu 16.04 LTS.

The script that will be used in this installation  is based on the one done by Yenthe.

To do so, I adv ice you to refer to that link and follow the script used.

http://www.odoo.yenthevg.com/installing-odoo-10-ubuntu-16-04/ 

The next article, will be about debugging Odoo-10 (Community) using PyCharm Community on Ubuntu 16.04 LTS.
Wish you best of luck ^^

Please find here the Demo of  “how to debug Odoo 10 using Pycharm IDE on Ubuntu 16.04 LTS”:

https://www.youtube.com/watch?v=O7OdXcYCo3o

You could also see this two tutorials that show how:

Best of luck ^^

Install PyCharm Community IDE in Ubuntu 16.04 LTS

Hello everyone

Today’s article will show you how to install PyCharm Community IDE in Ubuntu

Let’s start ^^

PyCharm is a cross platform editor developed by Jetbrains. It is an intelligent Python IDE with unique code assistance and analysis, for productive Python development on all levels.

Install PyCharm from PPA:

There’s a PPA repository for Ubuntu based users that contains both professional (30-day free trial) and community version of PyCharm packages. So far, Ubuntu 15.04, Ubuntu 14.04, Ubuntu 12.04 and their derivatives are supported.

1- To add the PPA, open terminal from the Dash, Launcher, or via Ctrl+Alt+T shortcut keys. When it opens, run command:

sudo add-apt-repository ppa:mystic-mirage/pycharm

2-After adding the PPA, update system package cache:

sudo apt-get update 

3- Install the IDE Community

 sudo apt-get install pycharm-community 

NB:  Make sure to have a good connection so that the insallation won’t be corrupted
You could see the tutorial of “how to install Pycharm IDE on Ubuntu”:

https://www.youtube.com/watch?v=jtm5xLFA_kA