Odoo: Restore admin password

Hello guys ^^

Today’s article will show you how to restore your admin password in case you forget it.

To do so:

1-  Open your Pycharm IDE and open the “python console”:

-Execute the following code that will generate the encrypted password:

>>> from passlib.context import CryptContext

>>>print CryptContext ([‘pbkdf2_sha512’]).encrypt(‘Your password’)

 

NB: “your password” is the new password for your admin

2- Open your pgAdmin III:

Go to the table:”res_users” and then change your existing encrypted password with the new one generated by the code above.

res_users

3- Go now and log in with your new password

Please find here the Demo :

Best of luck ^^

 

 

 

 

Basics of Odoo architecture

Hello everyone ^^

Today’s article will provide you a basic overview of the Odoo architecture.

Setting up and managing an Odoo installation will require a basic understanding of the components that make up Odoo. So let’s start ^^

MVC architecture:

Odoo is built upon a Model-View-Controller (MVC) architecture. One of the primary goals of this architecture is to separate the visual display of the information from the business rules and management of the underlying data. For example, if you need to change the way data is organized in the model, it is desirable not to have to make dramatic changes to how you view the data. This is true for maintaining flexibility in viewing data. Today, it is common to have many different client applications sharing the same underlying data.

MVC model and Odoo

 

The Model notifies the Controller of any data changes, and in turn, the Controller updates the data in the Views.

The View can then notify the Controller of actions the user performed and the Controller will either update the Model if necessary or retrieve any requested data.

Technical architecture: 

Odoo system is formed from three main components:

  • PostgreSQL  database server: which contains all of the databases, each of which contains all data and most elements of the Odoo system configuration.
  • Odoo application server: which contains all the enterprise logic and ensures that Odoo runs optimally.One layer of the server is dedicated to communicate and interface with the PostgreSQL database, the ORM engine. Another layer allows communications between the server and a web browser, the Web layer.
  • Web client: Which provides user interface, it is running in a web browser as Javascript application. The client issues a request to the server, gets data back and display the result (e.g. a list of customers) in different ways (as forms, lists, calendars, …). Upon user actions, it sends queries to modify data to the server.

Odoo architecture

 

Modules: 

For any enterprise, the value of Odoo lies in its different modules. The role of the modules is to implement any business requirement. The server is the only necessary component to add modules.

A module is usually composed of data models, together with some initial data, views definitions (i.e. how data from specific data models should be displayed to the user), wizards (specialized screens to help the user for specific interactions), workflows definitions, and reports.

NB: An article will be soon published explaining the principal components of a module

Best of luck ^^

 

Import translation in Odoo 10

Hello guys ^^
Today’s article will show you how to translate your modules in Odoo 10.

For our tutorial we will work with the module:”hr_expense” that has some few missing translated words and we will explain to you, step by step, how to import the translation into this module.

We will try to translate it in french.
To do so:

1-Activate the developer mode: Setting -> Activate developer mode

developer mode in odoo

2- Install the module “hr_expenses”:

you will notice that some few words are not translated in french.

hr_expenses module

3- Go to addons/hr_expense/i18n/fr.po:

– Open the file “fr.po”, you will notice that some few words are not translated

https://drive.google.com/file/d/0B09HNye3F974dnZwd3FQLTNXcHM/view?usp=sharing

– Save this file

-Add necessary  translation to your file and save it. For our case, we translated the following words:

  • “Expenses to Submit”, “Refused Expenses”, “Expense Reports”

translation odoo 10

3-Import Translation:
Go to : Setting-> Translation-> import/export-> Import translation
Screenshot 2017-04-11 15:20:16

4- This window will appear:
Screenshot 2017-04-11 15:21:14

5- Add your file “fr.po” and click import:
Screenshot 2017-04-11 15:21:55

6- Restart your navigator: 

You will notice that the translation has been successfully added.

translated words

Please find here a video that shows all the steps of importing translation in Odoo 10 described above :

 

Hope you guys like it ^^
Best of luck

Field of type Reference in Odoo, how to use it ?

Reference field type in Odoo

The main use of this field type is to make a reference with a specific model and then a specific recordset of this model.

By using the reference field type, the first thing you will choose is the model:

field reference

And by choosing the model you will be asked the choose one of the recordset of the chosen Model

field reference recordset

Structure of the reference field in Odoo (New API)

A field of type reference is declared as below :

ref = fields.Reference(string='Reference', selection='_get_document_types')

Selection attribute : We define the method that will determine which models will be showed, and from which we can choose

In our example we used this method :

method selection field reference

@api.model
    def _get_document_types(self):
        records = self.env['ir.model'].search(['|', ('model', '=', 'sale.order'), '|', ('model', '=', 'account.invoice'), '|', ('model', '=', 'stock.picking'), ('model', '=', 'purchase.order')])
        return [(record.model, record.name) for record in records] + [('', '')]

In this example, we specified that we want to choose from [ Sale Order, Account Invoice, Stock Picking, Purchase Order ] models

Hope it was useful for you
Good luck !!

Odoo : SQL Query Tips

In this article we will show some useful tips that will help you work with SQL Queries in python/Odoo.

How to execute queries in Odoo 10 ?

you should use the self.env.cr to run a sql query

cr = self.env.cr
cr.execute("SELECT a, b, c FROM [your_table] WHERE [condition]")
cr.fetchall()

It’s highly recommended to use the double quotes ” ” instead of single quotes ‘ ‘

What’s the query can returns ?

cr.dictfetchall() : will give you all the matching records in the form of the list of dictionary containing key, value [{'': ''}, {'': ''}, ...].
cr.dictfetchone : works same as cr.dictfetchall() except it returns only a single record {'': ''}.
cr.fetchall() : will give you all the matching records in the form of the list of tuple [(''), (''), ...].
cr.fetchone() : works same way as cr.fetchall() except it returns only single record ('').

SQL Queries with variables

You can execute Queries with variables using %s like:

cr.execute("SELECT a, b, c FROM [your_table] AS a WHERE a.id = %s AND a.field = %s", (first_value, second_value))

Hope it was useful for you
Good luck !!

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

Odoo V9 Community VS Enterprise

Hello everyone

This article will help you to understand the differences between Community  and Enterprise version.

let’s first recapitulate “what is odoo?” ( for more details, I advice you  to refer to the article ” what is Odoo ?”)

Odoo, known as OpenERP in the beginning,  is a suite of open-source enterprise management applications.

Odoo is used by large companies, small businesses, associations and many different types of organizations to help them manage, automate, measure and optimize their operations, finances and projects.

Odoo V6,7 and 8 had no technical or functional difference between Community and Enterprise versions. That, however, has changed with V9.

Before talking about the technical  differences between the two edition, let’s first discover some of the features of this two edition:

Odoo 9 Community:

  • Odoo Community Association (OCA)is a nonprofit organization whose mission is to promote the widespread use of Odoo and to support the collaborative development of Odoo features.
  • The Association provides financial, organizational and legal support to the broader Odoo Open Source community. It also serves as an independent legal entity to which community members can contribute to the code, funding and other resources with the knowledge that their contributions will be maintained for public benefit.
  • Odoo Software can be used, modified, distributed by anyone.
  • Odoo project is fully hosted on GitHub, access to anyone ( source code, bug reports, pull requests).

Odoo 9 Enterprise:

  • Proprietary license applies to Enterprise Apps only-Using requires Odoo Enterprise subscription

        – Modifications are allowed

        – Distribution only to Odoo Enterprise subscribers

  • Odoo project is fully hosted on GitHub, access to all partners (or some customers)

Context:

Copyleft relies on universal Copyright laws to enforce freedom for a piece of work. The Free Software Foundation defines four freedoms: use, modify, distribute, and distribute modifications. To guarantee these freedoms to every user, GPL forbids any restriction coming from other licenses.

From GPLv2 for TinyERP 1.0-4.0 to AGPLv3 for Odoo 8.0, Odoo software license is following up the changes of GPL, which is a strong copyleft license, but it suffers from the ASP loophole and lacks a linking exception. And AGPL v3 is not well suited for the CMS features. LGPL was created to fix this, by adding a linking exception on top of GPL.

Odoo 9 changes license to LGPL v3, becomes Odoo Community Edition, it will pemit selling Odoo Apps. Odoo Enterprises Edition will contain a set of new Apps on top of Odoo Community.

Core is absolutely the same in both versions.

community-vs-enterprise-odoo

 

To understand better, here’s an illustration that shows the differences between Community and Enterprise edition:

community-vs-enterprise-odoo-1

The whole database and back-end applications, without limitations, are in Odoo Community

    • Basic Functionality is in Odoo Community
    • + (additionally) Migration to the next version by Odoo SA engineers is in Odoo Enterprise
    • + (additionally) Several Functionalities are in Odoo Enterprise
    • + (additionally) Support of the non-customized Odoo Enterprise by Odoo SA Engineers
    • + (you can install any moment) Apps from Odoo Store

Technically, Odoo Enterprise is Odoo Community + Additional Functional Modules.

There’s a set of layer differences between the two edition, let’s discover them:

layer

  • Scalability: 

Following the Hardware abstract, Odoo can be scaled up for companies of almost any size. We did it for 2k+ and global companies with huge geographical distribution. Proper infrastructure provider selection, applications load balancing and database replication can do magic with this open source ERP.

  • Flexibility:

It is the most scalable business application in the world for two good reasons:

1. Open source
2. Modular structure: All functions can be customized via modules and database configuration.

If your company changes fast and experiments with processes, then Odoo should fit perfectly well.

  • Community and Enterprise App:

There are free (~90%) and paid (~10%) applications (modules) in the Odoo App store. Odoo Enterprise already includes additional unique modules that will move the ERP experience to the next level.

communityenterprise-app

  • Localizations:

Any localization can be installed as additional package on both versions. Around 50 localizations are available at this moment. The ones that are ready are for EU and US countries. Additional configuration for accounting and payroll modules is needed in most cases.

Bank integrations are available mainly for US banks and corresponding branches.

  • How functionally-rich the “out-of-the-box” system is:

As described earlier, all service-related processes are well supported in all Odoo versions: Community, Cloud and Enterprise. Companies in Software, Engineering, Service, Retail and Wholesale Industries with less than 15 employees can select any version. Any one of them would perform great with a little amount of customization.

Odoo Enterprise is the most preferred choice for middle enterprises of 50 to 300 employees. It contains modules that dramatically improve company performance. It has intuitive and clear UI that increases system adoption. The Enterprise version is more ready to be used out of the box from this point of view .

  • Access rights:

There are no differences here. Both versions have generic access rights with rules that are good enough for small and medium companies. However, for companies with complex organizational structure, basic access rights functionality is not enough. They should be ready for additional configurations.

  • User interface:

The most obvious difference between the two versions is the new UI of Odoo Enterprise. Odoo adopted the latest Google, mobile and web UI / UX trends to meet the high expectations of modern users. If your colleagues are using modern applications a lot, then they should feel very comfortable with Odoo Enterprise interface.

Odoo9EnterpriseHome

Each module is accessed as a separate application through the single dashboard. And each module provides access to one ERP application, which automates a particular business process. Under the “Contacts” icon you’ll see all your prospects, customers, and partners. Website app allows you to build your own website without coding. Odoo Enterprise interacts with a customer on intuitive level and familiarity with the ERP happens organically.

The new UI is built in a responsive design so that it’s interface can readily adapt to the resolution and orientation of your tablet or smartphone.

The Community edition inherited the classic corporate design from previous versions of Odoo. It has standard left column navigation structure and typical list and form views.

  • Price:

The Community version is open source and has no license costs. So you can use Odoo as is or customized by system integrator without support of the vendor, next updates, and additional improved apps for free. It’s a good choice for a small company that doesn’t need additional services and complex customizations.

The cost of the Enterprise version is 20EUR/user/month. For this price, a customer gets all additional apps + vendor support + future updates (Odoo 10+, for example).

There’s also a new additional features that has to deal with modules, let’s check them out:

  • New Features for Planning Projects and Resources – Community & Enterprise 

New Drags and Drop Gantt-Charts further facilitate the planning of resources and projects

  • New Accounting Features – Enterprise

The Enterprise Version also sports several new features for financial accounting. The extensive additions include automatic bank synchronization with more than 24.000 banks and SEPA payments.

  • Phone Connection via VoIP – Enterprise

-Planned and rescheduled calls

-Dial queue

-Calls on follow-up

-Auto Pop-up

  • New WYSIWYG Editor – Community & Enterprise

-Possibilty to distribute mass mails with pre-designed templates

-Possibility of A/B Tests

-New templates and themes for building your own website

-Multi-Website support

-Complete integration of front and back end

A complete introduction is available under the following link: https://www.odoo.com/fr_FR/slides/slide/keynote-odoo-9-new-features-201.

 

 

 

what is Odoo ?

Hello everyone

Today’s article will be about “what is Odoo ?”, so you’ll get the chance to discover Odoo: its definition and its release history.

Overview about Odoo:

Odoo, formerly known as OpenERP, is a suite of enterprise management applications. Targeting companies of all sizes.

The application suite cover all the company’s needs:  CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

It is 100 % modular application, so when Odoo is first installed there are ZERO modules installed with it, so you are able to only install the modules you need.

Odoo includes the following modules that may be installed with a simple mouse click:

– Accounting
– Customer Relationship Management (CRM)
– Warehouse Management
– Manufacturing Resource Planning (MRP)
– Purchase Management
– Project/Service Management
– Human Resource Management (HRM)
– Content Management (CMS)
– Document Management
– Fleet Management
– Point of Sale (POS)
– Application Builder

modules-odoo

  • Odoo offers a simple and rapid solution for all users, it allows you to customize or modify your modules.
  • Odoo is writing in Python, JavaScript and XML.
  • Odoo is compatible with: Linux, Unix-Like, OS X and Windows

Release history:

release-history

NB: Odoo have released software as open source but starting at the V9.0 release, the company of Odoo has transitioned to an open core model which provides subscription-based proprietary Enterprise software and cloud-hosted Software as a service, and a cut-down community version.

Software license:

  • GNU General Public License (GNU GPL):  is a widely used free software license, which guarantees end users the freedom to run, study, share and modify the software.
  • GNU Affero General Public License ( GNU AGPL): is a free, copyleft license published by the Free Software Foundation in November 2007, and based on the GNU General Public License, version 3 and the Affero General Public License.

The Free Software Foundation has recommended that the GNU AGPLv3 be considered for any software that will commonly be run over a network.

  • GNU Lesser General Public License (GNU LGPL): is a free software license published by the Free Software Foundation (FSF). The license allows developers and companies to use and integrate software released under the LGPL into their own (even proprietary) software without being required by the terms of a strong copyleft license to release the source code of their own components.