Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


How to automatically create additionnal account move lines to a stock move?

Pascal Tremblay
on 9/28/16, 6:21 PM 201 views

hello there,

We are on a problem since many days.

We are in a "real-time (automated)" stock management for all our products.

We have set a virtual location with location name = "gift to customer" and location type = Inventory.

Stock valuation account (incoming and outgoing) for this location is set to the charge account " - gift to customer"

So, when we make an internal transfert from "stock" location to "gift to customer" location, we get this journal entry :

    114006 - stock valuation : 100 (CT) - gift to customer : 100 (DT)

But it is not enough for us. This internal transfert should bring these journal entry :

    114006 - stock valuation : 100 (CT) - gift to customer : 100 (DT)

    114004 - stock output : 100 (DT)

    411000 - Inside Sales (CT)


How to add lines automatically to an account move already created by a stock move?

How could we proceed to manage this?

Should we use an existing module? Which module?

Should we create our own module?

Could you please help



An other way to make what we want should be this way...

Actually, we could make a delivery order. Journal items created by this stock move would be :

    114006 - stock valuation : 100 (CT)

    114004 - stock output : 100 (DT)

But it is not enough for us. This delivery order should bring these journal entry. The result should be exactly the same than above :

    114006 - stock valuation : 100 (CT)

    114004 - stock output : 100 (DT) - gift to customer : 100 (DT)

    411000 - Inside Sales (CT)


Pascal Tremblay

--Pascal Tremblay--
| 5 2 7
Alma, Canada
--Pascal Tremblay--

Pascal Tremblay
On 9/30/16, 1:53 PM

Here is our solution.

We have created a new module who override the existing stock_account module.

Two new fields are created on the virtual location of type "inventory".

These two new fields contain a debit and a credit account.

The new module add two lines in the account move associated to an internal transfert.

OUr code : https://github.com/lapagept/odoo-8/tree/master/virtual_location_inventory_account_move_lapagept

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 9/28/16, 6:21 PM
Seen: 201 times
Last updated: 9/30/16, 1:53 PM