Skip to Content
Menu
This question has been flagged
1 Reply
3497 Views

Hi. I am using odoo 11 / 12 (on two different deployements, but anyway the question is pretty much independent from the specific version).

I have been struggling a bit lately because i wanted to apply some changes to a specific report template, but there are already some modules which define changes on the same template, and this leads to several questions, some of which may be applied to customization in general (not only report templates)

1 - in which order are the changes executed? Is the first installed module executed before the subsequent ones? (i.e. if module A deletes an xml block and block B looks for something inside it, i'd expect B to throw an error). Is it possible to check the exact order in which such customizations are applied, and/or to change the order itseff?

2 - The previous point applies to normal views too, but at least in that case i can use "fields view get" using developer mode and get an idea about the structure of the resulting xml (if im not wrong). is there something similar for report templates?

3 - How can i be sure that some changes i make on my module A will not make parts of the system incompatible with subsequent modules that the user may want to install? Probably this is impossible, but maybe i'm missing something?

Thanks in advance, as always.

Avatar
Discard

Odoo Customization Tips:

Odoo is one of the best option for the ERP.

#odoo #openerp #ERP #customization

#tips #training #development #guide #python

These tips help you to get the basic idea about customization in odoo

https://github.com/sehrishnaz/learnopenerp/wiki

Best Answer

All views have a "Sequence" field (the technical field name is "priority") which determines the order that they apply to whatever view they inherit from. If your view has a lower Sequence, it will be applied before views that have a higher Sequence. The default sequence is 16 and most views don't change it.

Reports still use views (QWeb type views) underneath, so the same applies. You can just define your template with a lower Sequence if you're concerned about a different module changing something before your module gets the chance.

<template id="report_mymodule" inherit_id="other_module.report_other_view" priority="15"/>


To some degree, it's impossible to be wholly compatible with any 3rd party modules the user may want to install. As a rule of thumb, don't remove content; if you want to replace something, make it invisible so that it still exists in the XML (in case some other module tries to make changes based on that element).

Avatar
Discard
Author

Thank you Travis, this is a very useful answer! I didn't think of making stuff invisible, that will probably solve many issues i am getting.

Related Posts Replies Views Activity
1
Feb 16
6460
1
Jul 24
327
3
Jun 24
1249
2
Sep 23
1925
0
Jun 21
1121