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.


Do the categories really inherit their setup from their parent category?

Pascal Tremblay
on 3/22/15, 3:44 PM 1,194 views

Hey guys, look at this!

We have this category : All / Saleable.

All this setup is ok for us and it works.

We also have this category : Produits personnalisés

All the field are let empty.

We have a product in the category « Produits personnalisés »

When we try to validate a purchase order, we have this error.


     Define an expense account for this product: "Fourre-tout tissé" (id:2100).

But if I change the category of the product for « All / Saleable » instead of « All / Saleable / Produits personnalisés », all works great.

Questions :

1) Should the « Produits personnalisés » category inherit his parent category accounts????  It is what I thought... 

2) Should I fill all the setup of all our categories?



I have found the same question here. Not answered. 



Cyril Gaspard (GEM)

--Cyril Gaspard (GEM)--
| 5 6 8
Paris, France
--Cyril Gaspard (GEM)--

Forum contributor since 2008

Cyril Gaspard (GEM)
On 3/22/15, 6:49 PM


odoo verify first in the product if income, expense accounts (and for stock input, output too) are defined, if not, verify in the category, if not in the 2 you have your error message.

And no, category doen't inherit of parent category, see the code :

def _choose_account_from_po_line(self, cr, uid, po_line, context=None):

     fiscal_obj = self.pool.get('account.fiscal.position')

     property_obj = self.pool.get('ir.property')

     if po_line.product_id:

         acc_id = po_line.product_id.property_account_expense.id

         if not acc_id:

             acc_id = po_line.product_id.categ_id.property_account_expense_categ.id

         if not acc_id:

             raise osv.except_osv(_('Error!'), _('Define an expense account for this product: "%s" (id:%d).') % (po_line.product_id.name, po_line.product_id.id,))


Very nice from you to answer. Very interesting. I analyze and I come back.

Pascal Tremblay
on 3/22/15, 7:00 PM

Thanks both of you, Cyril and Pascal, for directing me to this post. So according to Cyril's answer, if I want the product categories to inherit their parent category's settings, I will have to do a code modification. Hmm. I am not good at that. :( Hope someone will provide a solution for this.

Mudi Vand
on 3/25/15, 3:14 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: 3/22/15, 3:44 PM
Seen: 1194 times
Last updated: 3/23/15, 2:53 PM