can't override any function of account_invoice_line

Asked by Anael Lorimier on 2013-08-01

I have created a class that inherits from "account.invoice.line" and I have redefined the fields_view_get()

But my fields_view_get() is never called.

I tried with other function, and none is called.

I added some fields in this model, and those fields are correctly added, so my module is read.

Openobject-addons rev : 9305
Openobject-server rev : 5038

Question information

English Edit question
Odoo Addons (MOVED TO GITHUB) Edit question
No assignee Edit question
Solved by:
Serpent Consulting Services
Last query:
Last reply:

Seems more like a Question!


Would you please make sure:
1. Syntax is right!
2. there is no zip file that does the mess.

You may share the code and we can help you.



Here is the link of a bitbucket project. Install that module in a new base with those version of openerp :

addons : 9285
server: 5038
web: 3994

You should see that my view is loaded in the menu Invoicing/Suppliers/Supplier Invoices.
But the fields view get and the function called when validating the invoice is not called.

Thank you !

Florent Aide (florent-aide) said : #4

I have installed this module in a fresh database with nothing else installed and I can confirm that:

the view is modified and the test column appears in the invoice lines one2many widget
the model contains the new column definition

the fields_view_get() method is not called when loading the form view (no print in console)
the finalize_invoice_move_lines() is not called when I validate the invoice (no print in console)

I took a quick look and found that you have overridden f_v_g() of invoice line.

While opening the invoice view, lines are internal architecture, so they do not call f_v_g() method.

And, there is no form view for o2m now on web, so again for form view the method does not get called.

Try to remove the internal tree view and see if you get it called.


I'm sorry for this mistake,

I was sure that there were a basic error but can't get it.. Indeed, I call the fields view get of invoice line instead of calling the fields view get of invoice.

Thank you for the answer.


Thanks Serpent Consulting Services, that solved my question.

Welcome Lorimier.