can't override any function of account_invoice_line

Asked by Anael Lorimier

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

Language:
English Edit question
Status:
Solved
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Serpent Consulting Services
Solved:
Last query:
Last reply:
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) said :
#1

Seems more like a Question!

Revision history for this message
Serpent Consulting Services (serpent-consulting-services) said :
#2

Lorimier,

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.

Thanks.

Revision history for this message
Anael Lorimier (anael-lorimier) said :
#3

Hello

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

https://bitbucket.org/alorimier/account_invoice_inherit

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 !

Revision history for this message
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)

Revision history for this message
Best Serpent Consulting Services (serpent-consulting-services) said :
#5

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.

Thanks.

Revision history for this message
Anael Lorimier (anael-lorimier) said :
#6

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.

Regards.

Revision history for this message
Anael Lorimier (anael-lorimier) said :
#7

Thanks Serpent Consulting Services, that solved my question.

Revision history for this message
Serpent Consulting Services (serpent-consulting-services) said :
#8

Welcome Lorimier.