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.


Ununderstandable error inheriting account.invoice.line .. [Closed]

on 3/9/14, 8:04 PM 1,183 views

The Question has been closed

Sudhir Arya (SA)
on 03/18/2014 02:40:46

I tried to inherit account.invoice.line in the usual way taking a community module as template for that. After having installed my modification, I get the following error:

TypeError: The model "account.invoice.line" specifies an unexisting parent class "account.invoice.line" You may need to add a dependency on the parent class' module.

Any idea what this means?

This is my code:

from openerp.osv import orm

class account_invoice_line(orm.Model):
_inherit = "account.invoice.line"

def product_id_change(
    self, cr, uid, ids, product_id, uom_id, qty=0,
    name='', type='out_invoice', partner_id=False, fposition_id=False,
    price_unit=False, currency_id=False, context=None, company_id=None
    res = super(account_invoice_line, self).product_id_change(
        cr, uid, ids, product_id, uom_id, qty=qty,
        name=name, type=type, partner_id=partner_id,
        fposition_id=fposition_id, price_unit=price_unit,
        currency_id=currency_id, context=context, company_id=company_id
    if product_id:
        product_obj = self.pool.get('product.product')
            product = product_obj.browse(cr, uid, product_id, context=context)
            if (product and product.description and 'value' in res):
                res['value']['name'] = product.description
    return res


Sudhir Arya (SA)

--Sudhir Arya (SA)--
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow




Sudhir Arya (SA)
On 3/9/14, 11:17 PM

I guess it is because there is no dependency of account module in your __openerp__.py file.

Try to give dependency of account module in __openerp__.py file under depends section.

Restart your server, update the module list and try again.

Hope this will solve your issue.

Yes, indeed, you are right. After having inserted this dependency, there was an indentation error left, which I was able to fix then.

on 3/17/14, 11:01 AM

About This Community

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

Question tools

0 follower(s)


Asked: 3/9/14, 8:04 PM
Seen: 1183 times
Last updated: 3/16/15, 8:10 AM