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.


Customer Returns causing ever increasing Asset/Liability account growth - real-time Stock valuation

Sam Davey
on 6/12/14, 10:10 AM 1,110 views


When using real-time stock the purchase and sales process is easy to understand.

Purchasing - You receive goods and you debit 'Stock Valuation' and credit 'Stock Input'.   This 'Stock Input' value isn't a debt as such but it is a record that you have recevied goods which are yet to be invoiced. You then create an invoice from the incoming shipment and it debits 'Stock Input' and credits the 'Creditors Control Account'.  This is now a firm record of the debt you owe for the stock.  If you have entered all your invoices then the 'Stock Input' account should be zero.

Selling - You send goods and you credit 'Stock Valuation' and debit 'Stock Output'  Again the 'Stock Output' is a record of goods going out which are yet to be invoiced.  When you invoice the goods it credits 'Stock Output' and debits 'Debtors Control Account'.  If you have invoiced all the goods you have sent then the 'Stock Output' account should be zero.

Supplier Returns and Customer Returns DO NOT follow this logic.

Customer Return - You receive goods back to your warehouse by returning thre from a 'Delivery Order'.  The system debits 'Stock Valuation' and credits 'Stock Output'!!.  However when you create/confirm the Customer Refund it creates a journal entry that debits 'Stock Input'!! and credits the 'Debtors Control Account".  This makes no sense!  The more customer returns you process the more your Stock Output and Stock Input accounts increase.  Why does the 'Stock Journal' put a movement in one acount and the 'Customer Refund' put a movement in the other?.  The Stock Input is an asset and the Stock Output is a liability so the values do cancel each other out, but if I trade for a number of years my Current Assets and Current Liabilities are going to be huge (for no reason).

Now instead of the 'Stock Input' and 'Stock Output' being zero if your record keeping is up to date, they are instead skewed by how many returns you have processed.

I've been through the code and I can easily see why this happens:

in stock/stock.py (at line 2362 in the latest verison of v7) you will see this:

 journal_id, acc_src, acc_dest, acc_valuation = self._get_accounting_data_for_valuation(cr, uid, move, dest_company_ctx)
 reference_amount, reference_currency_id = self._get_reference_accounting_values_for_valuation(cr, uid, move, src_company_ctx)
 #goods return from customer
          if move.location_id.usage == 'customer':
               account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_dest, acc_valuation, reference_amount, reference_currency_id, context))]
               account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_src, acc_valuation, reference_amount, reference_currency_id, context))]


So my question:

What is the above conditional all about?  Any incoming stock (either from supplier or a customer) should be logged in the 'Stock Input' account.  Why does the above conditional switch the acc_dest with the acc_src and mess everthing up?


Kevin McMenamin

--Kevin McMenamin--
| 5 2 6
Auckland, New Zealand
--Kevin McMenamin--
Kevin McMenamin
On 6/15/14, 4:33 AM

core account_anglo_saxon has a number of known bugs. If you want a copy of our version email me at kevin.mcmenamin@solnet.co.nz and tell me what version you are running

where to find out this list of know bugs?

AD LIBITOM, michel Guénard
on 6/15/14, 6:23 AM

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

2 follower(s)


Asked: 6/12/14, 10:10 AM
Seen: 1110 times
Last updated: 3/16/15, 8:10 AM