How to merge delivery order In OpenERP


Hello,

Here I would like to share with you that how to merge delivery orders in OpenERP 7.0.
it will check following condition while merging a delivery orders

1. Delivery order should be in same state
2. Delivery order should be in same invoice state
3. Delivery order should be in same customer




Thanks,
Mayur Maheshwari







How to Install Odoo (formerly OpenERP) from github

Hello,

As all know that OpenERP have changed  brand to odoo where you find e-commerce apps , website builder , crm , sales ,purchase accounting and so many apps 

I would like to share with you about  how to Install Odoo ( (formerly OpenERP) from github on Ubuntu system which is first stap to intract with Odoo


Install Odoo ( (formerly OpenERP) from github

Odoo Github Link : https://github.com/odoo/odoo

1. You need to install first gi on you ubuntu system for that open you terminal and type following commend

 a) Update apt source list
   
sudo apt-get update

 b) install update package

sudo apt-get upgrade

c) now install git 

 sudo apt-get install git

2. Install Python packages  which required for Odoo installation

sudo apt-get install graphviz ghostscript postgresql-client \
python-dateutil python-feedparser python-matplotlib \
python-ldap python-libxslt1 python-lxml python-mako \
python-openid python-psycopg2 python-pybabel python-pychart \
python-pydot python-pyparsing python-reportlab python-simplejson \
python-tz python-vatnumber python-vobject python-webdav \
python-werkzeug python-xlwt python-yaml python-imaging


sudo apt-get install gcc python-dev mc bzr python-setuptools python-babel \
python-feedparser python-reportlab-accel python-zsi python-openssl \
python-egenix-mxdatetime python-jinja2 python-unittest2 python-mock \
python-docutils lptools make python-psutil python-paramiko poppler-utils \
python-pdftools antiword postgresql


3. Install PostgreSQL database 

sudo apt-get install postgresql

4. Create database user for Odoo

sudo -u postgres createuser -s odoo

5. Download Odoo from Github to your system

a). make directory in home 
     sudo mkdir home/workplace

b).move to  directory
    cd home/workplace

c) Download odoo from Github

sudo git clone https://github.com/odoo/odoo.git

6. Once finish a download need to run odoo server  

a). go to oddo path

   cd home/workplace/odoo

b). run a odoo server

./openerp-server


7.To check odoo installation is perfectly work  on your system  so for that  just open your browser type 
http://localhost:8069, 


Odoo Login screen
Odoo Login screen



Thanks,

Mayur Maheshwari
Skype: mayur_maheshwari1



How to create Qweb report in odoo

Hello All,

         I would like to share with you how to create a Qweb report in odoo [OpenERP].let we go stap by stap to create Qweb report in odoo [OpenERP].

What is Qweb Report ??

Qweb Report is the newest version of the Odoo reporting Format and its uses the bootstrap css classes and Qweb Template Engine for Make Quick Report Design in Odoo.

About Bootstrap :

Bootstrap is a free collection of tools for creating websites and web applications.It contains HTML and CSS-based design templates for typography, forms, buttons, navigation and other interface components, as well as optional JavaScript extensions

Expressions used in Odoo report templates :

There are some magic variables used in the report rendering. The main ones are the following:
docs
        records for the current report
doc_ids
        list of ids for the docs records
doc_model
       model for the docs records
time
       a reference to time from the Python standard library

translate_doc 
 
a function to translate a part of a report. It must be used as follow:
<t t-foreach="doc_ids" t-as="doc_id">
<t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', account.report_invoice_document')"/>
</t>
user
     res.user record for the user printing the report
res_company
      record the current user‘s company

Custom Report

A generic report use the default rendering context, containing the magic variables as explained before. If you want a new rendering context containing anything you want to process your data Odoo AbstractModel, a custom module is needed. These reports are called “particular report”.

For a particular report, you have to write an Odoo Model containing a render_html method. Classically, this method returns a call to the original QWeb render with a custom rendering context.


from openerp import api, models

class ParticularReport(models.AbstractModel):
_name = 'report.<<module.reportname>>'
@api.multi
def render_html(self, data=None):
report_obj = self.env['report']
report = report_obj._get_report_from_name('<<module.reportname>>')
docargs = {
'doc_ids': ids,
'doc_model': report.model,
'docs': self.env[report.model].browse(ids),
}
return report_obj.render('<<module.reportname>>', docargs)



Create Report  in Qweb odoo [OpenERP]

Steps to create in Following Ways ::

STEP 1 ::

Create View File For Rendring the Qweb in Odoo
the view file it self uses the the Bootstrap classes for designing the Qweb Report.

Create custom module in odoo and then  Navigate

YOUR MODULE NAME/View/yourview_file.xml

And also add the Entry of xml in the __openerp__.py file

STEP 2 ::

Create Python class for report in report Dir

import time
from openerp.report import report_sxw
from openerp.osv import osv

class your_class_name(report_sxw.rml_parse):

def get_lines(self, user,objects):
lines=[]
for obj in objects:
if user.id==obj.user_id.id:
lines.append(obj)
return lines

What ever function Which You want to access in the Qweb Template which are define in the class

We must have to add the Entry in it constructor like this

def __init__(self, cr, uid, name, context):
super(your_class_name, self).__init__(cr, uid, name, context)
self.net_total=0.0
self.localcontext.update({
'time': time,
'get_lines': self.get_lines,

Add the Entry For the report class which is inherited the osv.AbstractModel object

class report_your_class_name(osv.AbstractModel):
_name = 'report.Your_Module_name.report_reportname'
_inherit = 'report.abstract_report'
_template = 'Your_Module_name.report_reportname'
_wrapped_report_class =your_class_name

Navigate :

YOUR MODULE NAME/report/reportclass.py

And also add the Entry in the __init__.py file


STEP 3 ::

Add the Menu Action for Print The Report
YOUR MODULE NAME/report_file.xml

<report
id="action_report_report_id"
string="String to Display in Menu"
model="your_model"
report_type="qweb-pdf"
name="your_module_name.report_your_reportid"
file="your_module_name.report_yourreportid"
/>
And also add the Entry of xml in the __openerp__.py file


Special function ::

Hear In odoo use the special widget for print the currency symbol,
add the company address,partner address and many more

like this..

<div class="row">
<div class="col-xs-5 col-xs-offset-7">
<address t-field="o.partner_id"
t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}' />
<span t-field="o.partner_id.vat"/>
</div>
</div>
hear t-field-options attribute use the widget to print the partner detail in Odoo
like name,address,street,country etc... 

Same things for the currency symbol

<td class="text-right">
<span t-field="o.amount_untaxed" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
</td>


Thanks,
Mayur Maheshwari (OpenERP/odoo)
Skype: mayur_maheshwari1


How to run query on database from pgAdmin and terminal - OpenERP (Odoo)

Hello,

I would like to share how to run query on database from pgAdmin and terminal. - OpenERP (Odoo) .This was too easy to do but this post is specially for beginner in query.



What is product and How to configure product in OpenERP


Hello Friends,

Today we will discuss about the product and how to configure product in OpenERP.

Product module in OpenERP


What is product :

    A product is the item offered for sale. A product can be a service or an item. It can be physical or in virtual form.In short it will offered and serves the basic business needs like sales, purchase, manufacture and services.

    We can also say product is key of ERP. To unlock the erp with the key of product we should know about the product and how to configure product If product is not properly configured then it will creates so many issue and ERP flow is break down.

Product kanban View in OpenERP


How to configure product in OpenERP :

    In OpenERP Product Form, There are three fields are important for stock management when you are configuring a new product
 
    Product Type
    Procurement Method
    Supply Method

1] Product Type :
            The Product Type determines how the product will be managed in stock management.
In OpenERP three distinct product types are:

 (a) Stockable Product : This product is used in stock management and it will demanded in stock less or more based on it's defined reordering rule [minimum stock rule] in the system. Examples:- Computer, shoes, beg
 
 (b) Consumable : This product is not used in stock management. once you receive it and delivery it because this type of product stock is not maintain in the system . it just like a stock of some time of duration. Examples:- Fruit, Milk, Food ...

 (c) Service : This product is not used in stock management. This type of product will configure when your company is providing any type of services. Examples:- Man Power, a consulting service.


2] Procurement Method :
            The procurement method determines how the product will be replenished.
   In OpenERP two distinct procurement method are:
 
   (a) Make to Stock : when stock is needed then the product will take from the stock, If the quantities in stock is too low to fulfill the order then it will set a quantity based on the reordering rule [minimum stock rule] in Procurement and generate purchase or manufacturing order [depends on supply method] to meet the needs of product
 
   (b) Make to Order : when sale order is confirmed, it will not check the stock level and immediately it will generate the purchase or manufacturing order [depends on supply method] with the same quantity of ordered.


3] Supply Method :
            The supply method determines the purpose of the product either it will be buy or produce.
   In OpenERP two distinct supply method are:
 
  (a) Produce : when the product is manufactured or the service is supplied from internal resources.
         
  (b) Buy : when the product is bought from a supplier


Cheers ENJOY OpenERP  !!


Thanks,

Mayur Maheshwari


Eclips xml template for OpenERP 7.0


Hello,

     OpenERP 7.0 basically brings about huge improvements in the area of usability. By usability we mean a better user experience through a better user interface. We know that in OpenERP, the user interface is designed via XML. OpenERP 7.0 has introduced some new features in XML.

Here I have made a very good Eclipse XML templates which may prove useful to OpenERP developers as well as beginners. These templates will provide a fast and easy method of coding in XML. Now no need to remember all syntax of XML,  just play with these Eclipse snippets!






To get Eclipse XML templates can contact me :
mail : mayurmaheshwari07@gmail.com
Thanks,

Mayur Maheshwari


Audit Trail in OpenERP - (Odoo)

In business there are number of users. It is tedious task for administrator to track all user's activity. Here OpenERP (Odoo) brings good feature to track user activity on any model. It means user perform any action [like create, modify, delete] on any model that all performed action can see administrator by logs. This feature is introduced in Audit Trail module

Audit Trail allows you to log every user operation on all system models. (such as sales, leads or products)

Required module: - Audittrail

First you just need to install the Audit Trail module in OpenERP (Odoo). After installing it, you will see in the Reporting menu an Audit menu item


Install Audit Trail Module


To track user activity you need to create audit rule. Audit rules are specified on a particular model that you want and assign user that you want to track that activity. The rules tell the system which activities performed by the user need to be logged.

How to create an audit rule :-


Navigate to : Reporting/Audit/Audit Rules

  
For example: - I have created a rule for sale order model to track activity of sale_user

Create an audit rule

   
To activate the audit rule you need to first 'Subscribe' to the audit rule.


Subscribe audit rule


To test this, login with sale_user, make changes to any in sale order. I have just created a sale order to show logs.


Create sale order to check audit logs


Now login with administrator. To see the logs of the activities performed on the sale order model by sale_user :-


Navigate to : Reporting/Audit/Audit Logs



Audit logs

You will see a list of the changes made to the sale order model. Click on logs to see the changes sale_user made to the sale order. You can also check old values and new values for comparison.

You can track every user operation on all the objects of the system. [
operation such as: create, modify, delete]    



Cheers Enjoy OpenERP (Odoo)    :)
Thanks,

Mayur Maheshwari 

  Skype : mayur_maheshwari1