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.


How do you override an XML view that is only called from within another view?

Jeff Beidler
on 1/15/15, 4:05 PM 815 views

If a view template is defined in an XML file, why would Odoo say it can't find the External ID of that view, when you try to inherit/override it?  It is included from another view via the "<t t-raw=...>" tag.  Does that make it "unlisted" somehow, and how would one go about customizing it?

For example, the template with ID "report_purchasequotation_document" appears (so far as I can tell) to only be called from within "report_purchasequotation" by the directive <t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'purchase.report_purchasequotation_document')"/>.  When I try to inherit from "report_purchasequotation_document", Odoo says, "External ID not found".  What gives?

use the manage forms debug select and find report_purchasequotation_document the look at the external ID in that row. Inherit that external ID.

John Baldwin
on 1/16/15, 1:59 PM

Unfortunately, debug mode isn't available when viewing an HTML report (ie., when you click "print" from an RFQ.)

Jeff Beidler
on 1/16/15, 2:11 PM

try this: purchase.report_purchasequotation

John Baldwin
on 1/16/15, 2:52 PM

and this: purchase.report_purchaseorder_document

John Baldwin
on 1/16/15, 2:56 PM

sorry about the last I meant this one: purchase.report_purchasequotation_document

John Baldwin
on 1/16/15, 2:57 PM

Those are the matching external IDs I found under Settings>User Interface>Views> search box term "purchase". You should be able to inherit from that. You left off the preceeding "purchase." ...

John Baldwin
on 1/16/15, 3:00 PM

I've found and tried those before. If you use "purchase.report_purchasequotation_document", Odoo says (in the Python traceback) that the External ID does not exist. If you use "purchase.report_purchasequotation", then it accepts that, but you can't override any of the elements of "purchase.report_purchasequotation_document", because they don't exist in the parent, which outputs the contents of "purchase.report_purchasequotation_document" via the "" directive.

Jeff Beidler
on 1/16/15, 4:05 PM
Jeff Beidler
On 1/19/15, 4:20 PM

There may have been a bug in the way Odoo created a database under whatever previous version I was running.  I updated and created a clean database, and now everything seems to work as expected.  I am able to override "purchase.report_purchasequotation_document" via simple inheritance.

John Baldwin
On 1/16/15, 1:49 PM

You have to do a seperate override of the second view. I ran accross that problem and drove myself nuts trying to figure it out. In CRM there are several smart buttons incorporated into the res.partner view. I don't need this information in my system and they were taking up valuable space. Due to the fact that they were included from various modules by inherited views and xpath paths, I had to find each and target those inherited views to remove them. The nice part was that using the internal debug mode I just went to manage views and could see the inherited views in the res.partner view list. After that it was easy to remove or (invisible='1') hide them.

Do you mean override the calling view? That's what I'm trying to do now - replace the view called in the directive.

Jeff Beidler
on 1/16/15, 1:53 PM

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

1 follower(s)


Asked: 1/15/15, 4:05 PM
Seen: 815 times
Last updated: 3/16/15, 8:10 AM