India

ZestyBeanz Technologies Pvt Ltd 4th Floor, Nila, Technopark Thiruvananthapuram,
India – 695581
Phone: +91 471 4063254
Fax : +91 471 2700171

   .

ZestyBeanz Technologies Pvt Ltd
61/3236, Manikkath Cross Road
Ravipuram, Kochi, India - 682016
Phone: +91 484 4063254

  UAE

Zesty Labs
Office # 2003, Millennium Plaza Building
Sheikh Zayed Rd, Dubai, UAE
Phone: +971 4333 2222​
Mobile: +971-52-7553466

  Germany​

ZestyBeanz Technologies GmbH
Reuterstraße 1
90408 Nürnberg
Fon: +49 911 4801 444
Fax: +49 911 4801 445

Contact Form


subhinvelayudhan's picture

Data export to CSV with Filtering in V7

Zb_export is a module to export the records of any model with user-defined column sequences and filters into CSV (Spreadsheet) File

OpenERP by default provides us with the facility of printing the details of many models, for eg. the list of sale orders or the details of a particular sale order ect through reports. But the format of the report is defined by openerp and the normal user cannot alter it.Then there is the normal import/export functionalty using which one is able to export the data stored into a csv file. But the csv file obtained works well for importing data into another Database but it cannot be used for office use as it contains extra colums like 'external_id' and the column headers are not user defined.

Zb_export module provides the user with both flexibility of printing reports in csv format the way one wants and the user friendly appearence of a normal report. 

A module to export the records of any model with user-defined column sequences and filters to CSV - See more at: http://zbeanztech.com/node/1416/edit#sthash.aYfqEYdt.dpuf
A module to export the records of any model with user-defined column sequences and filters to CSV - See more at: http://zbeanztech.com/node/1416/edit#sthash.aYfqEYdt.dpuf
A module to export the records of any model with user-defined column sequences and filters to CSV - See more at: http://zbeanztech.com/node/1416/edit#sthash.aYfqEYdt.dpuf

On installing this module a new menuitem appears in Settings > Zb Export Tool > Export To CSV

 

Creating a New Export Tool

As shown in the screenshot here one is able to create a new export to CSV tool. The main fields to noted here are:

  • Name: The name of the tool Can Be Specified in this field. (here: "Invoice Details"). 
  • Object to Export: The Model that needs to exported can be selected from the drop down list in this field
  •  Active:  field needs to be ticked.
  • Serial No : if marked would insert Serial Number in the CSV file.

Adding Fields and Subfields

In the Fields to Export tab all the fields required can be added. (Note: The columns in the CSV file is arranged as per the sequence of the fields entered)

the Above Screenshot shows the form that appears to add a new field.  The main fields in this view to be noted are

  • Field : This is used to Select any field present in The Selected model
  • Name: This is the Column header in the CSV that would represent this field
  • Field Type:  This is automatically Loaded and Contains the type for the selected field

On Selecting fields of type one2many and many2many 2 new fields need to be Noted

  • Sub Field : This field belongs to the model to which the one2many/many2many field points at. For eg: here the field selected in model Invoice is Invoice Lines that corresponds to model Invoice Line. Invoice Reference is a field in the Invoice Line and it will be printed in the CSV file.
  • Rules: For filtering. (use will be Discussed later )

Create/Delete an Action

In the tab Advanced there is a button called Create Action. On clicking it a new action is created and 2 fields appear Window Action and Wizard Button as shown below. These represent the new action created. Button delete Action is used to delete the created action

Downloading the CSV

The Created action can be now accessed in the tree and form view of the corressponding model as shown below and clicking it a csv file is created which can be downloaded and viewed as shown in the screenshots below.

Click on Invoice Details. A wizard Appears as shown below

Click on Export to CSV

On Clicking The Download link the Invoice Report is Downloaded

Filtering Using Rules

The Module also has an additional functionality of specifying rules. Setting rules enables obtaining filtered results. For example if the requirement is to view only the Invoices that are in done state this condition can be Specified in The Rule section as [('state','=','done')]. Here state is a field in the model.
The rule can be specified both for the Main Model and for the one2many and many2many fields. After entering the required rules and saving the record the user will be able to obtain the filtered results on downloading the CSV file. The rules must be Specified correctly in the corrrect format i.e the domain format else an error message will appear.

Rules for subfields follow the same pattern. 

Thanks

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo], [[foo]]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.