Extra Functions

There are set of embedded functions defined for user convenience. These represent generic functionality that is commonly used for creating reports. Listing of these functions is not to be considered as complete, we may introduce more functions over time. Do not hesitate to ask, if you want some function to appear among them. All requests will be treated as a wish-list, and if the requested function will appear as commonly required item we will gladly include it in the embedded function list. You may place your motivated request on launchpad project bugs/blueprints sections. You can use our dedicated forum, if you are not familiar with launchpad. Reports with attached source code will receive somehow better attention, so may be implemented more sooner.

You may vote for functionality by donating funds to this project and naming the functionality you would like to be implemented.

For better reference we decided to split listing of functions by domains.

Contents

Language related functions

  • setLang - sets default language on template;
  • gettext - gets translation for a given text;
  • _ - same as gettext;
  • getLang - gets current effective language of template;
  • currency_to_text - converts floating point currency to it's written form;

Mathematical functions

  • sum_field - returns sum of named field from all objects in a list;
  • sumif - returns sum of named field from conditionally selected objects in a list;

Statistical functions

  • average - returns the average (arithmetic mean) of fields from all objects in a list;
  • count - returns total count of objects in a list;
  • count_blank - returns total count of objects in a list, where named field is empty;
  • countif - Returns count of objects from a list, where fields meet condition;
  • large - returns k-th largest numeric value in a list of objects;
  • max_field - returns largest numeric value in a list of objects;
  • min_field - returns smallest numeric value in a list of objects;
  • small - returns k-th smallest numeric value in a list of objects;

Time related functions

  • dec_to_time - converts time to hh:min representation;
  • time - time access and conversions;

Barcode related functions

  • barcode - converts code to barcode image;

Helper functions

  • asarray - returns named field from all objects as a list;
  • asimage - converts binary data to image;
  • bool_as_icon - translates boolean value to text string;
  • browse - returns list of objects;
  • chunks - splits list of objects into chunks;
  • debugit - helps debugging templates;
  • epl2_gw - insert EPL v2 'gw' command (use on Zebra & compatible printers);
  • field_accuracy - returns accuracy for the OpenERP object's field;
  • field_size - returns maximum size for named field;
  • get_attachments - returns attachment(s) from an object;
  • get_label - returns human readable name for the field;
  • get_log - ;
  • get_name - returns string representation for object;
  • get_selection_item - returns human readable name for selection field's code;
  • html_embed_image - embeds image on html templates
  • html_escape - escapes HTML unsafe characters (New in v1.1.)
  • http_builduri - builds string of URI attributes from dictionary(ies) (New in v1.1.)
  • http_prettyuri - converts string URI safe format (New in v1.1.)
  • include_document - ;
  • insert-subreport - inserts Open ERP sub reports;
  • itemize - Appends the given array with number of usefull attributes (New in v1.1.)
  • safe - tries to safely evaluate expression;
  • search - do a search returning list of OpenERP objects;
  • search_ids - do a search returning only list of OpenERP object ids;
Copyright © 2001 Alistek Ltd., ALL RIGHTS RESERVED