~openerp-commiter/openobject-addons/trunk-extra-addons

« back to all changes in this revision

Viewing changes to base_external_referentials/module.py

  • Committer: Guewen Baconnier @ Camptocamp
  • Date: 2012-03-23 13:59:48 UTC
  • Revision ID: guewen.baconnier@camptocamp.com-20120323135948-wt38s3m3fju4pt3y
[MRG] from Sebastien Beau's branch lp:~sebastien.beau/openobject-addons/on-change-support-extra-addons in order to support tax computed by openerp in base_external_referentials / base_sale_multichannels

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import os
24
24
from tools import osutil
25
25
 
 
26
 
 
27
#The way I implement autoload feature is not stable https://code.launchpad.net/~sebastien.beau/openobject-server/autoload/+merge/84512
 
28
#Moreover hidding dependency look to be a bad idea
 
29
#I will remove this code soon after refactoring the module that use it
26
30
addons.load_module_graph_ori = addons.load_module_graph
27
31
 
28
32
def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules=None, **kwargs):
43
47
    return addons.load_module_graph_ori(cr, graph, status, perform_checks, skip_modules, **kwargs)
44
48
 
45
49
addons.load_module_graph = load_module_graph
 
50
 
 
51
 
 
52
#The funciton is_installed will be not merge https://code.launchpad.net/~sebastien.beau/openobject-server/add_function_is_installed/+merge/84474
 
53
#Hidding dependency seem not to be a good idea, I extend the class here in order to use this solution before finding a good one
 
54
class module(osv.osv):
 
55
    _inherit = "ir.module.module"
 
56
 
 
57
    def is_installed(self, cr, uid, module_name, context=None):
 
58
        return bool(self.search(cr, 1, [['name', '=', module_name], ['state', 'in', ['installed', 'to upgrade']]], context=context))
 
59