Tuesday, 4 August 2015

Implementation of free3of9 bar-code in Odoo/OpenERP

Following are the steps to implement free3of9 bar-code in Odoo/OpenERP.

1. Install fonts(.ttf) files on your server.

a. You can download free3of9 bar-code files from here: http://www.barcodesinc.com/free-barcode-font/free3of9.zip

b. Extract/unzip folder and copy extracted 'free3of9' folder in '/usr/share/fonts/' folder only with .ttf files.

2. Odoo use two codes for 3of9 bar-code. 

Standard39 for Normal 3of9 and

Extended39 for Extended 3of9 or New 3of9

3. In Odoo you can use it as follow based on your .rml or .xml file

a. For .rml file:

<barCode code="Standard39" fontName="Times-Roman" fontSize="30" alignment="CENTER"> [[ o.name or '' ]] </barCode>

b. For .xml file:

<img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Standard39', o.name, 600, 100)" style="width:300px;height:50px;"/>

If still it's not working, restart your server. 

Note: Follow first two steps as root user only.

Hopefully it will help someone. Kindly post your valuable comments, if any improvement is needed.


Thanks!!!!!!! Enjoy Programming! :)
 


Monday, 3 August 2015

Odoo/OpenERP: Barcodes supported by Odoo

Following is the list/matrix of most popular bar-codes supported by Odoo.


1D Product
1D industrial
2D
Code Name
Bar-code Type
Odoo Code
Code Name
Bar-code Type
Odoo Code
Code Name
Bar-code Type
Odoo Code
UPC-A
upca
UPCA
Code 39
code39
Standard39
QR Code
qr
QR
UPC-E
upce
UPCE
Code 39 (extended)
code39
Extended39



EAN-8
ean8
EAN8
Code 93
code93
Standard93



EAN-13
ean13
EAN13
Code 93 (extended)
code93
Extended93






Code 128
code128
Code128






Codebar
codebar
Codabar






Code 11
code11
Code11













Kindly let me know if I missed something.

Thanks!!!!!!! Enjoy Programming! :)


Sunday, 2 August 2015

Odoo/OpenERP: Picking List printing blank barcode?

Are you facing a problem with bar-code in picking list. Is it displaying nothing?

Reason is: Odoo uses reportlab to print barcode images and reason of showing blank barcode means reportlab fonts are missing.

Follow following steps to install reportlab fonts:

1. Login to your server as root user.

2. Open terminal and go to location: '/usr/lib/python2.7/dist-packages/reportlab/'

Check if 'fonts' directory is there? If not, create it.

3. Go to 'fonts' folder and Download Zip file from here: http://www.reportlab.com/ftp/pfbfer.zip

i.e $ wget http://www.reportlab.com/ftp/pfbfer.zip

extract it and delete pfbfer.zip 

4. Restart your server.

That's it.


Thanks!!!!!!!! Enjoy Programming!!! :)


Reference Links:

https://github.com/odoo/odoo/issues/3234
 

Sunday, 3 May 2015

Install Odesk Tracker in Ubuntu

Today, I tried to install Odesk Tracker on by Ubuntu machine but it was throwing a number of errors.

shiv@localhost:~$ sudo dpkg -i ~/Downloads/odeskteam_3.12.9_i386.deb 

(Reading database ... 294217 files and directories currently installed.)
Preparing to unpack .../odeskteam_3.12.9_i386.deb ...
Unpacking odeskteam (3.12.9) over (3.12.9) ...
dpkg: dependency problems prevent configuration of odeskteam:

 odeskteam depends on libphonon4 (>= 4:4.2.0).
odeskteam depends on phonon.

dpkg: error processing package odeskteam (--install):
 dependency problems - leaving unconfigured
Processing triggers for mime-support (3.54ubuntu1.1) ...
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...
Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Errors were encountered while processing:
 odeskteam



Tried to install dependencies as well but no use. Same list of errors.

After lot of search and brainstorming I was not able to find any answer and contacted Odesk Support. After couple of hours they came up a solution which not at all working out. Finally found a very simple solution, the following chain of commands and it worked:

shiv@localhost:~$ sudo apt-get clean
shiv@
localhost:~$ sudo apt-get -f install
shiv@localhost:~$ sudo dpkg -i ~/Downloads/odeskteam_3.12.9_i386.deb

That's it.

Thanks!!!!!!!!!!!!!! Enjoy Programming :)

Reference Link:

http://askubuntu.com/questions/314221/getting-errors-when-installing-packages


Friday, 24 April 2015

Simple example of datatables

Today's post is about use of datatables. Lot of examples are available on Internet. This example is just to explore it little more and explains how to read data from xml and display using datatables.

<?php

$file_url='blog.xml';
$file_content = file_get_contents($file_url);
$xml_string_arr=simplexml_load_string($file_content);

//Optional: Start of code if you want to add some attribute to xml
//code to add unique_id attribute
/*foreach( $xml_string_arr->xpath("entry") as $r ) {
    $attrs = $r->attributes();   
    if(!$attrs['unique_id'])
        $r->addAttribute('unique_id', $r->id);
}
$xml_string_arr->asXML($file_url);*/
//End of code if you want to add some attribute to xml



$json = json_encode($xml_string_arr);
$arr_new = json_decode($json,TRUE);

$required_content_arr = $arr_new['entry'];

?>
<!DOCTYPE html>
<html>
<head>
    <title>Task3</title>
    <link rel="stylesheet" href="DataTables/media/css/jquery.dataTables.css">
    <script src="DataTables/media/js/jquery.js"></script>
    <script src="DataTables/media/js/jquery.dataTables.js"></script>
</head>

<body>
  <table id="example" class="display" cellspacing="0" width="100%">
  </table>
</body>

</html>
<script language="javascript"> 
    $(document).ready(function() {
        var oTable = $('#example').dataTable({
            data: <?php echo json_encode($required_content_arr); ?>,
            columns: [
                { data: 'id' },
                { data: 'name' },
                { data: 'url' },
                { data: 'height' },               
            ]
        });
       
   
    } );   
   
</script>



Thanks!!!!!!!!!! Enjoy Programming :)