Thursday, 27 August 2015

Laravel Unique Validation

Hi, You can find most of the things on the following link regarding unique validation in Laravel.

http://brianretterer.com/quick-tip-laravel-unique-validation/

But I would like to add one more case to make it little easy to understand:

articleName => unique:articles,article_name,{isset(article_id) : article_id : NULL },article_id,user_id,{user_id}

The query that this will give you is: 

Select count(*) as aggregate from articles where article_name = <given_article_name> and article_id <> {article_id} and user_id={user_id}

It will check unique article name per user. Multiple users can have same article name but one user can't have same article name again, only once.  

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

 

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
 

Odoo 10: Close wizard and open standard form

Hi, Today we are going to learn how to open standard form after saving data in wizard. Let's say I have created an wizard to fill bas...