Odoo Help

0

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

By
NSC
on 3/9/14, 8:04 PM 1,582 views

The Question has been closed

by
Sudhir Arya (ERP Harbor Consulting Services)
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

account_invoice_line()
1

Sudhir Arya (ERP Harbor Consulting Services)

--Sudhir Arya (ERP Harbor Consulting Services)--
11584
| 6 8 8
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 

LinkedIn

Blog

Stackoverflow

Sudhir Arya
ERP Harbor Consulting Services
skype: 
sudhir@erpharbor.com 
Sudhir Arya (ERP Harbor Consulting Services)
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.

NSC
on 3/17/14, 11:01 AM

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

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