Delete facebook mail in gmail inbox

Hello Friends

        Here I wanna like to share python script which delete facebook mail in your gmail account ,For use this script you just add your username and password  run this script on terminal so it's delete  facebook related mail in your gmail account

import imaplib, email
M = imaplib.IMAP4_SSL("", 993)
#your username and password
M.login('<<xxUSERNAMExx>>', '<<xPASSWORDx>>')
typ, data =, 'FROM', '""')
for num in data[0].split() :
    typ, data = M.fetch(num, '(UID BODY[TEXT])'), '+FLAGS', '\\Deleted')

For another mail like LinkedIn, Twitter on any other groups
you have need to  change one line and run again this script

Example for Linked-In :

    typ, data =, 'FROM', '""')

I hope it's helpful for you .....:)


Mayur Maheshwari
skype: mayur_maheshwari1

Database Filter in OpenERP 7.0

Hello Friends

Here I shared Information about how to filter a database name in openerp 7.0

just add a parameter after when you start server

 ./openerp-server --addons=/addons/trunk,/web/trunk/addons/ --db-filter='<<filtername_.*>>'


Mayur Maheshwari

Create Menu shortcut in openerp v7.0


   Here I wanna like to share how to create menu shortcut in openerp.

Follow this simple steps for create menu shortcut

Step 1 - Browse any menu in OpenERP.

Example: suppose I would like to create a shortcut for sale order menu then browse  
             [sales  => sales => sale order ]


Step 2 - Press [*] the STAR icon.

you can find this [*] icon in right-corner of form [press and make it yellow]


After pressing the Star Icon [*], you will know a newly menu shortcut was created.

Hope this helps you  :)


Mayur Maheshwari

Incoming Mail Server setting in OpenERP


I would like to serve How to set-up Incoming mail server in OpenERP 7.0

Required module for Installation:


go thorough Settings/Technical/Email/Incoming Mail Servers

SSL Port : 993
Please make sure, that IMAP access is enabled in the account settings. Login to your account and enable IMAP.

SSL Port: 993


Mayur Maheshwari 

How to add an image icon to OpenERP custom module In OpenERP


I would like to share with you that How to add an image icon to OpenERP Custom module In OpenERP.

when you develop a custom module make a following directory in your custom module in OpenERP.



You need to save your icon as 'icon.png' and place it under 

 exmple :

Openerp will automatically select the icon from the static/src/img path

custom module icon
custom module icon


Mayur Maheshwari 

Send Mail in OpenERP with Mail Templates


    Now a days Mailing mechanism is to fast for any communication. Here I would like to serve you how to send mail in openerp and how to use a custom templates for sending mail.

Required module for Installation:

--> email_templates
    Here First of all you need to configure outgoing email server.
    For Outing Mail Servers:
        Settings/Technical/Email/Outing Mail Servers

    SSL Port 465
    StartTLS Port 587

    SSL Port 465

If you success to configure openerp outgoing email server then lets see how to use a custom templates for sending mail.

Here First of all you need to install email_template module.This module is used to specify the format in which the email has to be send.

For Templates:

In templates need to set required field

Name : Name of the template
Applies to: Model to which the template is related [Ex: sale order]
Form: sender address
To: Destination mail address
Reply To : Preferred Reply address
Subject : Subject of the mail
Body : Body of the email [either plain text or an HTML format]
Add signature: predefine signature for all.

Main important feature of email_templates is dynamically value builder tab where you can fetch your required field from related document model and also use the field value in [Form,TO,Subject,Body] anywhere in mail template.

Field Description:

Field : Select field from Applies to model
    In our Example:we select sale order modele in applies to so all sale order filed display here like [name, ref, company_id, partner_id, etc]

Sub-Model : When a relation field like many2one is selected, this field specify the Related model.
       Example: partner_id is many2one field which related with res.partner
Sub-field : When a relation field is selected, this field let us select the target field inside the Sub-Model
        Ex: In sub-model if you select partner_id than you can use all partner table field as sub field

Placeholder Expression : This is the resulting expression generated when the fields are selected in Dynamic Value Builder. This can be copy pasted in fields in email template.
      ex: ${}

In Advanced tab you can find this many field:


Language: language of the mail
Outgoing mail server: Outgoing Mail Server configured before
Auto Delete : Permanently delete the email after sending it to save space
Attachment: to attach files on email.

Button events:

Preview: preview of mail_template
  Add context action: this creates a links in [more] in the related document model form view which helps in sending email any time from the form view.
    example: I have created a template for the sale.order and a link is created by clicking "Add Context action" button in template, a link will be created as shown below screen-shot:

When you click on this link, a wizard pops up using from which we can send email to clicking send button:


Mayur Maheshwari

Jasper Report in OpenERP

JasperReports is an open source Java reporting tool that can write to a variety of targets, such as: screen, a printer, into PDF, HTMl, Microsoft Excel RTF, ODT, Comma separated values  XML files.

Working With the OpenERP Jasper Reports:

    For working with OpenERP jasper Reports you need to download  jasper i-report and  OpenERP jasper reports module.

    you can Download jasper i-report latest version from Jasper official site and download  OpenERP jasper reports module and install it in OperERP 6.1. and install it
Jasper i-report:-

OpenERP  Jasper reports module:
After successfully installing jasper report module in OpenERP 6.1 there is menu in Client, To navigate menu of jasper-reports.

Setting -> Customization -> Jasper Reports

there is Two new menu in Jasper Reports:

1] Create Data Template:- From this menu we can create XMLTempalate file Which used as Data source.
2] Jasper Reports :- We can load report in OpenERP related object.

To create XML template file Open wizard and click on Create data template button, it create template file which use as connection with ireport.

In screen shot we see the wizard in model field select require model which you want create report, in Depth filed select depth 1, 2, it useful to access the other object relation field like one2many and many2one field. Then click on create button so here  xml template will be created and save it to proper path.

After Creating Template file open i-report and make connection using template file. Create new data source.

Working With the I-report :

Select template file which created from OpenERP client then press save, if you want test connection click on test it show successfully test connection.

After Creating data source, click on new and open jasper report template  chose one from list, as show in below figure.

Then save this .jrxml file in OpenERP jasper_report modules custom_reports directory. After that select field from data source and add filed.

After adding field in data source drag and drop all filed form report inspector tab in to Designer page. As show in figure.

After drag and drop filed we need show report in client so close i-report and go on Openerp client.

Go on Jasper report menu Setting > Customization > Jasper reports

it show the list view of jasper report created by you.

Click on create button, form view is there and fill required field name of report that you want so on particular object then select model, give service name and then select output of type of your like pdf, xls, .. etc.

In Jasper report files Field click on create button, form view open in this view select .jrxml file created form the i-report tick on Default and save and close it.

After following the step sale order jasper report is created when you click on save button

Finally report is created on sale order on object to view this report click on sales menu click on sales order in side bare sale order is there.


Mayur Maheshwari