Friday, February 3, 2017

Production Cost at the end of Manufacturing in Odoo

Hello Everyone,

How to calculate Production Cost with Raw material Cost and Work-center Cost ? How to create accounting entries for it ? This is what I will try to explain in the post. The post is for having the functionality in the Odoo v<10.0.


  • Create a Work-center with required information like cost, cost account, financial account, etc.
  • Create a Routing and link the Work-center with it. Link the Routing with Bill of Materials of the Finished good product.
  • Set Stock Valuation Account (Incoming & Outgoing) in 'Production' Location by having any Asset type of account. It is called a WIP account and will be used to track the cost during the Production process.
  • In the Category of Finished good product, Set Costing Method as a Real Time and set Valuation account by having any Asset type of account.


  • Once the configuration has been correctly set, Proceed to create a Manufacturing order.
  • Select the Product you want to produce with Bill of Material and the Quantity.
  • Click the Confirm Production button and Work order will be created for the Work-center, linked with the Routing.
  • Reserve the order, Mark it as Started and Produce it. Set the quantity in the wizard which should be produced.

As the end of the Production order, 

  • Odoo create a move for Raw materials from Stock to Production and update Inventory valuation with the cost of raw materials in the Quant.
  • Odoo also create accounting entry for the Raw material cost by debiting WIP account set in the Production Location and crediting Valuation account from Product category.
  • Odoo create a move for Finished good from Production to Stock and update Inventory valuation with the Raw material cost + Work-center cost.
  • Odoo also create accounting entry for the Raw material cost + Work-center cost by debiting Valuation account from Product category and crediting WIP account set in the Production Location.
  • Odoo also create a separate Analytic entries for the Work-center cost and link the financial account set in the Work-center.

By configuring and executing the way, I explained, we can calculate the production cost with accounting entries in Odoo. I hope that the post would be helpful to you.

Friday, November 20, 2015

Odoo management in Virtual Box with Ubuntu

Hello all,

Recently I installed 14.04 ubuntu in Virtual Box and the way, I did it, I am sharing few tips, it can make it easier for you.

In General:
1. Download 14.04 iso file from Ubuntu website. You can get it easily.
2. Install Virtual Box machine.
3. Create a new OS inside Virtual Box and select a correct version of ubuntu.
4. Configure Base Memory(RAM) and Create a virtual hard drive with VDI format.
5. While creating virtual hard drive, select a location where ubuntu should be install and select a hard disk space for it. Finish the process.
6. On main screen of Virtual Box, new OS is available now. Right click and go to "Settings"
7. In System tab, Un-tick the "Floppy".
8. In Storage tab, Select empty "Controller IDE" and select your iso image from system.
9. In Network tab, In Adapter 1 tab, select "Bridged Adapter". 
10. Save the configuration of point 7,8,9. Start your OS from VB.
11. It installs Ubuntu from the iso image, that you select.
12. After installation, it may be possible that you may not see VB window in full size and you face issues working with small window size in VB.
13. Go to terminal in Ubuntu from VB and execute this command:
sudo apt-get install dkms build-essential linux-headers-$(uname -r)
14. Go to Devices menu in VB and click on "insert guest additions". It will mount the additions in the virtual CD. 
15. Restart the Ubuntu and it will appear in full size.

In terms of odoo:
1. Install odoo9, say for ex, as per your need. Also install python packages and postgresql. You can get lots of references from websites about how to install odoo9.
2. After installation of odoo9, make sure that you can connect to your database. After it, drop the database.

Lets say, you will be working on number of projects in different versions of odoo. 2 Projects in odoo9, 1 in odoo8 like that so VB allows you to create a Clone of your OS.  By making a clone of your OS, it will create OS and your all packages installation stays in the new OS from old OS. You do not need to install it again. That's why I ask to drop the database.

So if you need to work on a project with odoo9, 
1. Right click on your OS in virtual box and click on "Clone" option.
2. Fill up the details with your project name and it will create a clone after 5-10 mins.
3. You can use this OS for your project work and keep the old one as it is in case if you need to use it to check something.
4. You can follow the same steps for odoo8.

I did not go much technically in this post, just try to make it easier for you to configure and work on Odoo with different versions and projects. It may help you out.

You can install and use Kitty to access Virtual box OS from command line only to access only Odoo database. You can install Winscp to move files from Windows to Virtual box OS. 

Friday, October 30, 2015

Set Decimal Accuracy in Odoo

Odoo provides you a facility to set Decimal accuracy for floating point fields. To set a value like 150.345 or 876.342 instead of 150.30 or 876.30, Odoo Provides you a facility to set Decimal accuracy by just configuring it. To set it, go to the Settings → Technical → Database Structure → Decimal Accuracy

You can see the list of records inside it with some ‘Digits’ value. They are created from Odoo code. You can create a new record inside it but it will not be effective until it has been set from Odoo code but you can update the existing Digits value as per our need. If you need to set digits only for Accounting purpose, you will have to set accuracy in below terms, as they are related to accounting:

To update the Unit Price – Set digit in 'Product Price' record.
To update the Discount - Set digit in ‘Discount’ record.
To update the Untaxed-Taxed-Total - Set digit in ‘Account’ record.
To update the Product Qty - Set digit in ‘Product Unit of Measure’ record.

You can see Invoices and Accounting Entries with 2 decimal points as per first screenshot as below:

So, if you want to set accounting for 3 digits, you have to set decimal accuracy for all of above terms and set it as 3 as shown below:

Once you set new decimal accuracy, Reload Odoo page. Now it will reflect in the Accounting terms.

So, by this way, you can configure decimal accuracy in odoo as per your need.

Tuesday, July 21, 2015

Odoo v8 New API

Hello all,

Its been long time of my presence here. Today, I would like to share few things about Odoo v8 new API which can help us to develop modules easily.

With new API, functions can be execute on a recordset, We consider 'self' as a recordset.

class test_test(models.model):
    _name = 'test.test'
    def method_test(self):

Recordset Operations:

records.filtered(lambda l: l.account_id == self.account_id)
records.sorted(key=lambda t:

Environment variables: 
Remember: cr, uid, context in old API. In new API, we can use it with recordsets, as below:

records.env --> returns object name --> returns cursor object
records.env.user --> returns logged user id

Environment alternatives:
records.env['res.partner'].sudo().create({'name': 'Priyesh'})

ORM Methods:
Consider 'self' as a recordset as below:

self.create({'name': 'Priyesh'})
self.write({'name': 'Priyesh'})
self.browse([1, 2, 3, 4, 5])

Model definition with old API:
class test(osv.osv):
Model definition with new API:
class test(models.model):
Field definition with old API:
'name': fields.char('Description', size=64, select=True, required=True)
Field definition with new API:
name = fields.Char(string='Reference/Description', index=True, required=True)
name = fields.char(string='Name', default=default_name) --> To compute default value
name = fields.char(string='Name', compute='_compute_name') --> Function field

To allow searching on computed field, set 'search' parameter as below:
name = fields.char(string='Name', compute='_compute_name', search='_search_name')
To allow setting value of computed field, set 'inverse' parameter as below:
name = fields.char(string='Name', compute='_compute_name', inverse='_set_name') 

More coming soon.....

Saturday, March 29, 2014

Account Payments in OpenERP

Hi all,

I would like to share different ways of payment in OpenERP. I have found four ways to do that as below:

1. Invoice --> Payment
2. Invoice --> Bank Statement --> Payment
3. Invoice --> Bank Statement --> Manual Reconciliation --> Payment
4. Invoice --> Bank Statement --> Automatic Reconciliation --> Payment

First of all, you need to install account_voucher module for this.

1. Its very simple way to manage payment. You can register a payment from Invoice itself.

Here are the steps:
  • Create an Invoice.
  • Validate it.
  • Make Payment by clicking on Register Payment and Invoice will be validated.

2. You can import an Invoice from Bank statement to make its payment.

Here are the steps:
  • Create an Invoice.
  • Validate it.
  • Create a Bank Statement.
  • Import that Invoice that you just validate it.
  • Note that You can import only those invoice which are in Open state. (Validated Invoice only)
  • Confirm that Bank Statement.
  • Invoice will be Paid once you confirm the bank statement.

3. You can make payment of Invoices by Manual Reconciliation wizard.

Here are the steps:
  • Create an Invoice.
  • Validate it.
  • Create a Bank Statement.
  • Create a Bank Statement Line manually with that Partner and Amount that you want to pay.
  • If that amount will be match with invoice, It will be Full payment otherwise Partial Payment.
  • Confirm that Bank Statement.
  • Open Manual Reconciliation wizard.
  • You will see two entries : One for Sales Journal and another for Bank Journal.
  • Select those entries and Reconcile it.
  • Amount of that invoice will be affect.
  • If it will be same amount in Bank statement as like in Invoice, Invoice will be in Paid State otherwise Remaining amount will be appear as in Balance field in Invoice.

4. You can make payment of Invoices by Automatic Reconciliation wizard too.

Here are the steps:
  • Create an Invoice.
  • Validate it.
  • Create a Bank Statement.
  • Create a Bank Statement Line manually with that Partner and Amount that you want to pay.
  • If that amount will be match with invoice, It will be Full payment otherwise Partial Payment.
  • Confirm that Bank Statement.
  • Open Automatic Reconciliation wizard.
  • Add accounts which you want to reconcile.
  • It will automatically select related Sales and Bank accounting entries and Reconcile it.
  • Amount of invoices will be affect.
  • If it will be same amount in Bank statement as like in Invoice, Invoice will be in Paid State otherwise Remaining amount will be appear as in Balance field in Invoice.


Tuesday, May 14, 2013

Negotiation and Problem Solving

A father left 17 camels as an asset for his three sons.
When the father passed away, his sons opened up the will.

The Will of the father stated that the eldest son should get half of 17 camels while the middle son should be given 1/3rd (one-third). The youngest son should be given 1/9th (one-ninth) of the 17 camels.
As it is not possible to divide 17 into half or 17 by 3 or 17 by 9, three sons started to fight with each other. So, the three sons decided to go to a wise man.
The wise man listened patiently about the Will.
The wise man, after giving this thought, brought one camel of his own and added the same to 17. That increased the total to 18 camels.
Now, he started reading the deceased father’s will.
Half of 18 = 9. So he gave the eldest son 9 camels
1/3rd of 18 = 6. So he gave the middle son 6 camels
1/9th of 18 = 2. So he gave the youngest son 2 camels.
Now add this up: 9 plus 6 plus 2 is 17 and this leaves one camel, which the wise man took back.
Have a nice day!

Moral :The attitude of negotiation and problem solving is to find the 18th camel i.e. the common ground. Once a person is able to find the 18th ground the issue is resolved. It is difficult at times. However, to reach a solution, the first step is to believe that there is a solution. If we think that there is no solution, we won’t be able to reach any!

Thursday, May 2, 2013

Our reaction to the Problems

Really nice story- Cockroach theory!! 

At a restaurant, a cockroach suddenly flew from somewhere and sat on
a lady. She started screaming out of fear. With a panic stricken
face and trembling voice, she started jumping, with both her hands
desperately trying to get rid of the cockroach.

Her reaction was contagious, as everyone in her group also got

The lady finally managed to push the cockroach away but landed
on another lady in the group.

Now, it was the turn of the other lady in the group to continue the

The waiter rushed forward to their rescue.
In the relay of throwing, the cockroach next fell upon the waiter.

The waiter stood firm, composed himself and observed the behavior of
the cockroach on his shirt.
When he was confident enough, he grabbed it with his fingers and
threw it out of the restaurant.

Sipping my coffee and watching the amusement, the antenna of my mind
picked up a few thoughts and started wondering, was the cockroach
responsible for their histrionic behavior?
If so, then why was the waiter not disturbed?
He handled it near to perfection, without any chaos.

It is not the cockroach, but the inability of the ladies to handle
the disturbance caused by the cockroach that disturbed the ladies.

I realized that, it is not the shouting of my father or my boss or
my wife that disturbs me, but it's my inability to handle the
disturbances caused by their shouting that disturbs me.

It's not the traffic jams on the road that disturbs me, but my
inability to handle the disturbance caused by the traffic jam that
disturbs me.

More than the problem, it's my reaction to the problem that creates
chaos in my life.

Lessons learnt from the story:
I understood, I should not react in life.
I should always respond.
The women reacted, whereas the waiter responded.

Reactions are always instinctive whereas responses are always well
thought of, just and right to save a situation from going out of
hands, to avoid cracks in relationship, to avoid taking decisions in
anger, anxiety, stress or hurry.

Have a nice day.