Odoo Help


2 Answers
Royal Administrator United States
1/18/17, 4:23 PM

I would be interested as to what folks think about this patch to 9.0 openerp/modules/graph.py def add_modules, right before the line that starts "dependencies =".

The idea is that you add always_extends = ['module1', 'module2'] to the __openerp__.py of a 'new_module'.  Every other module that depends on module1 or module2 will also be treated as being dependent on new_module, which forces new_module to load before any other dependencies of module1 or module2.

I have found this useful especially when I am trying to insert a module in between existing ones.

Thoughts?  Did I do a good thing here?


        # jrook begin adding always_extends

raw_packages = packages
packages = []
extend_depends = {}

for p, info in raw_packages:
extend_depends[p] = []

for p, info in raw_packages:
always_extends = info.get('always_extends') or []
for extend in always_extends:
if extend in info['depends']:
for p2, info2 in raw_packages:
if p2 != p and extend in info2['depends']: # if another module depends on this always_extend
extend_depends[p2].append(p) # then treat other module as depending on this module also

for p, info in raw_packages:
info['depends'] = info['depends'] + extend_depends[p]
packages.append((p, info))

# jrook done adding always_extends

That's it.  Add to your graph.py, and use 'always_depends' in your __openerp__.py's.


Ray Carnes United States

--Ray Carnes--
| 10 7 11
Greater Los Angeles, United States
--Ray Carnes--

Business Analyst

OpenERP 6.1, 7.0; Odoo 8.0, 9.0, 10.0, 11.0 and 12.0.

Completed Odoo Functional and Technical Training.

Functional Areas:

  • CRM/Sales

  • Inventory

  • Manufacturing

  • Accounting

  • Purchasing

Major Skills:

  • Business Process Reengineering

  • Efficiency Consulting

  • User Needs and GAP Analysis;

  • Functional and Technical Design;

  • Prototyping and Proof of Concepts;

  • Requirements Specifications;

  • Agile Implementation;

  • Data Migration;

  • Configuration & Customization (UI and code);

  • Integration - Odoo and non Odoo Applications and Services;

  • Training and Knowledge Transfer;

  • Go Live Support;

  • Helpdesk;

  • Version Upgrades and Migration.

  • Accounting Expert.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

I am a skilled Communicator and I only take the serious things seriously!

Ray Carnes United States
1/2/17, 11:44 AM

View priority (sequence) defines the order of application during view inheritance:

View matching

  • if a view is requested by (model, type), the view with the right model and type, mode=primary and the lowest priority is matched

  • when a view is requested by id, if its mode is not primary its closest parent with mode primary is matched

View resolution

Resolution generates the final arch for a requested/matched primary view:

  1. if the view has a parent, the parent is fully resolved then the current view's inheritance specs are applied

  2. if the view has no parent, its arch is used as-is

  3. the current view's children with mode extension are looked up and their inheritance specs are applied depth-first (a child view is applied, then its children, then its siblings)

The result of applying children views yields the final arch


Ask a Question
Keep Informed
2 follower(s)
About This Community

This platform 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.

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now