How to add custom font to qweb report

1). Create font folder under “module_name/static/src/fonts/”

2). create .css file (ref :

@font-face {
    font-family: 'calibri';
    src: url('../fonts/Calibri.eot'); /* IE9 Compat Modes */
    src: url('../fonts/Calibri.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
         url('../fonts/Calibri.woff2') format('woff2'), /* Super Modern Browsers */
         url('../fonts/Calibri.woff') format('woff'), /* Pretty Modern Browsers */
         url('../fonts/Calibri.ttf')  format('truetype'), /* Safari, Android, iOS */
         url('../fonts/Calibri.svg#Calibri') format('svg'); /* Legacy iOS */
    font:normal 12px calibri !important;
    text-align: center !important;
    color: #000000 !important;
    padding-top: 5px !important;

3). Add your new style sheet

<?xml version="1.0" encoding="UTF-8"?>
    <template inherit_id="report.minimal_layout" id="minimal_layout_inherit">
      <xpath expr="//head" position="inside">
             <link rel='stylesheet' href="/feag_header_footer/static/src/css/feag_layout_style.css"/>
             <link rel='stylesheet' href="/feag_header_footer/static/src/css/feag_report_style.css"/>

4). now you can use the class in HTML tags. eg.


Odoo PyCharm Templates

Templates for Odoo in PyCharm

This Templates can help you to develop Odoo Modules Faster and with no Typing Errors

Download odoo.xml file and place in pycharm template folder




If You are using a linux distribution you can save the XML file in PyCharm files, Just find the path:


MacOs X users, look for the templates folder here:


and save the XML file there. Enjoy your time developing great Odoo Modules 🙂

odoo 10 custom css for report

STEP 1: Create CSS file:-

We have to create CSS file in the following directory:

STEP 2: Give path of your CSS file:-

Now put the following code in the xml file of the report.
In this code I have inherited the “minimal_layout” template of the
layout.xml file of the report module and gave path of the CSS file.

<template id="minimal_layout_inherit" inherit_id="report.minimal_layout">
<xpath expr="//head" position="inside">
	<link rel='stylesheet' href="/<module_name>/static/src/css/<file_name>.css"/>

Setting up a Sharp network Printer on Ubuntu

Add below line on ppd file before you install

*OpenGroup: Authentication
*% Base JCL key code option 
*OpenUI JCLPasscode/Key Code: PickOne
*OrderDependency: 10 JCLSetup *JCLPasscode
*DefaultJCLPasscode: None
*JCLPasscode None/No Code: ""
*JCLPasscode 1111: "@PJL SET ACCOUNTNUMBER = \"1111\""
*JCLPasscode 2222: "@PJL SET ACCOUNTNUMBER = \"2222\""
*JCLPasscode 3333: "@PJL SET ACCOUNTNUMBER = \"3333\""
*CloseUI: *JCLPasscode
*% Custom JCL key code option 
*CustomJCLPasscode True: "@PJL SET ACCOUNTNUMBER = \"\1\""
*ParamCustomJCLPasscode Code/Key Code: 1 passcode 1 8
*CloseGroup: Authentication

go to ubuntu pc localhost:631/printers

Add new printer with ppd file.

Increase Virtual Box Disk Size

To enlarge a virtual disk in VirtualBox, you’ll need to use the VBoxManage command from a Command Prompt window. First, shut down the virtual machine – ensure its state is set to Powered Off, not Saved.


Second, open a Command Prompt window from your Start menu and change to VirtualBox’s program files folder so you can run the command:

 cd “C:\Program Files\Oracle\VirtualBox”


The following command will operate on the VirtualBox virtual disk located at “C:\Users\Chris\VirtualBox VMs\Windows 7\Windows 7.vdi”. It will resize the virtual disk to 81920 MB (80 GB)

VBoxManage modifyhd “E:\VM\odoo\odoo.vdi” --resize 81920


(Use two dashes before resize in the command above.)

Replace the file path in the command above with the location of the VirtualBox disk you want to resize and the number with the size you want to enlarge the image to (in MB).


Note that this process doesn’t enlarge the partition on the virtual hard disk, so you won’t have access to the new space yet – see the Enlarge the Virtual Machine’s Partition section below for more information.

How to Add Custom Header and Footer in Odoo


<template id=”report_quotation_header” inherit_id=”report.external_layout_header”>
<xpath expr=”//div[@class=’header’]” position=”replace”>
custom div


<template id=”report_quotation_footer” inherit_id=”report.external_layout_footer”>
<xpath expr=”//div[@class=’footer’]” position=”replace”>
custom div

How to create a first custome widget in odoo

1). Add js and xml file under resource folder.



aslo add these files on file


2). petstore.js

openerp.petstore = function(instance, local) {

instance.web.form.widgets = instance.web.form.widgets.extend(
‘test’ : ‘instance.web.form.message’,

instance.web.form.message = instance.web.form.FieldChar.extend(
template: ‘test’,
start: function() {
var self=this;

show_message :function(){


3). rootfolder/static/src/xml/petstore.xml   (Qweb template file)

<?xml version=”1.0″ encoding=”utf-8″?>
<t t-name=”test”>
<button name=”view_images” type=”object” id=”message” >Alert</button>


4). call widget on data template

attach js and css on data file

<template id=”assets_backend” name=”petstore_assets” inherit_id=”web.assets_backend”>
<xpath expr=”.” position=”inside”>
<link rel=”stylesheet” href=”/petstore/static/src/css/petstore.css”/>
<script type=”text/javascript” src=”/petstore/static/src/js/petstore.js”/>

call widget

<field name=”name” widget=”test”/>

download source

Change Ubuntu Server from DHCP to a Static IP Address

Change Ubuntu Server from DHCP to a Static IP Address

If the Ubuntu Server installer has set your server to use DHCP, you will want to change it to a static IP address so that people can actually use it.

Changing this setting without a GUI will require some text editing, but that’s classic linux, right?

Let’s open up the /etc/network/interfaces file. I’m going to use vi, but you can choose a different editor

sudo vi /etc/network/interfaces

For the primary interface, which is usually eth0, you will see these lines:

auto eth0
iface eth0 inet dhcp

As you can see, it’s using DHCP right now. We are going to change dhcp to static, and then there are a number of options that should be added below it. Obviously you’d customize this to your network.

auto eth0
iface eth0 inet static

Now we’ll need to add in the DNS settings by editing the resolv.conf file:

sudo vi /etc/resolv.conf

On the line ‘name server’ replace the x with the IP of your name server. (You can do ifconfig /all to find out what they are)

You need to also remove the dhcp client for this to stick (thanks to Peter for noticing). You might need to remove dhcp-client3 instead.

sudo apt-get remove dhcp-client

Now we’ll just need to restart the networking components:

sudo /etc/init.d/networking restart

Ping If you get a response, name resolution is working(unless of course if google is in your hosts file).

Really pretty simple.

Updated Thanks to Nickname007 in the comments for noting that I forgot the DNS entries in the guide.