Monday, 6 May 2019

Example: API to send teachers data from odoo

Example: API to send teachers data from odoo:

# -*- coding: utf-8 -*-
from odoo.tools.translate import _
from odoo import http
from odoo.http import request
import json
import sys

class odoo_public_data(http.Controller):
    @http.route('/get/teachers', type='http', methods=['GET'], auth="public")

    def get_teachers(self, **kwargs):
        teacher_model = request.env['dps.teacher']
        teacher_ids = teacher_model.sudo().search([])
        teacher_list = {'status': 1, 'data': []}
        try:
            if teacher_ids:
                for teacher in teacher_ids:
                    vals = {
                        'id': teacher.id,
                        'name': teacher.name,
                        'email': teacher.email,
                        'phone': teacher.phone,
                        'school': teacher.partner_id.name,
                    }
                    teacher_list['data'].append(vals)
            return json.dumps(teacher_list)
        except Exception as e:
            print str(e)
            return json.dumps({'status': 0, 'data': 'Some problem with API'})

Introduction to Odoo (Formerly Open ERP)



History

Odoo also known as Open ERP was founded by Fabien Pinckaers who is the founder and current CEO of Odoo. In 2005, he started to develop his first software product, TinyERP. Three years later, the name was changed to OpenERP. The company started to evolve quickly.
 In 2014, OpenERP moved beyond the boundaries of traditional ERP players and the company was renamed Odoo, a name without restrictions, to allow the company to grow in whichever direction

What is Odoo?

The word Odoo is the acronym of On Demand Open Object. 

Odoo 12e homepage.png

Odoo is a large collection of business-related applications and modules like CRM, Sales management, E-commerce, Warehouse management, Purchase management, Accounting suit, Manufacturing management, HRMS etc. 
All these basic modules collectively called as Enterprise Resource Planning software. 

The prime benefit of Odoo is its extensible architecture. A large number of freelancers and organizations develop Odoo Apps or Modules and place them in the marketplace for sale or to be downloaded for free. 
The main Odoo components are the OpenObject[5] framework, about 30 core modules (also called official modules) and more than 5000 community modules. Most Odoo modules are available in Odoo S.A's marketplace where community could buy or download many modules for free.  15759 Apps or modules were found on the marketplace in different categories. Most modules 
are served in all active versions of 9.0, 10.0, 11.0 and 12. 

Odoo has website builder that lets users generate websites and handle online operations. It’s integrated with an e-commerce platform and helps online shops to carry out plenty of tasks. 


Odoo Web Controller have been equipped with strong facility that it can create frontend modules (functionalities like a website, website sale, website blog etc. With the help of these modules, we can create website pages with both static and dynamic contents) to integrate with backend modules. 


Software & architecture 

Odoo uses Python scripting and PostgreSQL database. The software is accessed via a web browser in a one-page app developed in JavaScript. The Community edition repository is on GitHub. 

There are two versions available for your business needs.  
They are: 
  1. 1. Community Version:   
The Community version is the open source version. 

  1. 2. Enterprise Version: 
An enterprise version supplements the Community edition with commercial features and services. 


Why Odoo is more popular? 
  • It is open source 
  • Flexible 
  • Scalable 
  • Custom Ready-made Apps 
  • Global Support 
  • Proven Product 
  • User-Friendly 
  • Up to date with Technology 
  • Highly Modular 
  • Easily Integrate with Third-party services 
  • Industry-Specific Modules 
  • Less Implementation Cost 
  • Less implementation Time Frame. 

Page Break 

Odoo implementation: 

There are two type professionals who can perform Odoo implementation services. 

1. Odoo ERP Developer 

2. Odoo ERP Techno functionalist. 

A well experienced Odoo consultant can sketch the entire business diagram. They can provide the chart of application that must be installed and other customization requirements. 

An Odoo developer can enhance/customize the existing source code as per the consultant's suggestions. 

Odoo can be implemented in two ways. Either you can host it on any server (preferably Linux based) or you can use it locally. It depends on the user needs. In both cases. 

Why to choose Odoo ?

  • Comprehensive  
  • Modular 
  • Lower Total Cost of Ownership (TCO) 
  • Consolidation Strategy 
  • Configurable and Customizable 
  • Updated Technology 
  • No Lock-in   

Most of the countries are started using Odoo.



Vendor support 

The three last LTS versions are supported in parallel. This means that when a new LTS version is released, an older version reaches its end-of-life and is not supported any more. As an example, 10.0 LTS will be supported along with 11.0 LTS and 12.0 LTS, but it will reach end-of-life when 13.0 LTS is released.