This question has been flagged
2 Replies
4682 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?

Avatar
Discard

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

Author

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

try this: purchase.report_purchasequotation

and this: purchase.report_purchaseorder_document

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

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." ...

Author

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.

Author Best Answer

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.

Avatar
Discard
Best Answer

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.

Avatar
Discard
Author

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