This question has been flagged
1 Reply
8427 Views

I am using V7 on Ubuntun 12.10

I created a custom module creating a new product object that extends product.product with one field and successfully installed it. I would like to uninstall it and re-install it again to make sure everything is allright.

When uninstalling, I have the following error : No such external ID currently defined in the system: product.cat1

Below the full error message and my code

Client Traceback (most recent call last):
  File "/opt/openerp/server/openerp/addons/web/http.py", line 195, in dispatch
    response["result"] = method(self, **self.params)
  File "/opt/openerp/server/openerp/addons/web/controllers/main.py", line 1082, in call_button
    action = self._call_kw(req, model, method, args, {})
  File "/opt/openerp/server/openerp/addons/web/controllers/main.py", line 1070, in _call_kw
    return getattr(req.session.model(model), method)(*args, **kwargs)
  File "/opt/openerp/server/openerp/addons/web/session.py", line 43, in proxy
    result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw)
  File "/opt/openerp/server/openerp/addons/web/session.py", line 31, in proxy_method
    result = self.session.send(self.service_name, method, *args)
  File "/opt/openerp/server/openerp/addons/web/session.py", line 104, in send
    raise xmlrpclib.Fault(openerp.tools.exception_to_unicode(e), formatted_info)


Server Traceback (most recent call last):
  File "/opt/openerp/server/openerp/addons/web/session.py", line 90, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/opt/openerp/server/openerp/netsvc.py", line 289, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/opt/openerp/server/openerp/service/web_services.py", line 614, in dispatch
    res = fn(db, uid, *params)
  File "/opt/openerp/server/openerp/osv/osv.py", line 169, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/opt/openerp/server/openerp/osv/osv.py", line 123, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/opt/openerp/server/openerp/osv/osv.py", line 179, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/opt/openerp/server/openerp/osv/osv.py", line 166, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/opt/openerp/server/openerp/addons/base/module/module.py", line 496, in button_immediate_uninstall
    return self._button_immediate_function(cr, uid, ids, self.button_uninstall, context=context)
  File "/opt/openerp/server/openerp/addons/base/module/module.py", line 476, in _button_immediate_function
    _, pool = pooler.restart_pool(cr.dbname, update_module=True)
  File "/opt/openerp/server/openerp/pooler.py", line 39, in restart_pool
    registry = RegistryManager.new(db_name, force_demo, status, update_module)
  File "/opt/openerp/server/openerp/modules/registry.py", line 214, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/opt/openerp/server/openerp/modules/loading.py", line 349, in load_modules
    processed = load_marked_modules(cr, graph, states_to_load, force, status, report, loaded_modules, update_module)
  File "/opt/openerp/server/openerp/modules/loading.py", line 260, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/opt/openerp/server/openerp/modules/loading.py", line 195, in load_module_graph
    load_demo_xml(module_name, idref, mode)
  File "/opt/openerp/server/openerp/modules/loading.py", line 76, in <lambda>
    load_demo_xml = lambda *args: _load_data(cr, *args, kind='demo_xml')
  File "/opt/openerp/server/openerp/modules/loading.py", line 128, in _load_data
    tools.convert_xml_import(cr, module_name, fp, idref, mode, noupdate, report)
  File "/opt/openerp/server/openerp/tools/convert.py", line 954, in convert_xml_import
    obj.parse(doc.getroot())
  File "/opt/openerp/server/openerp/tools/convert.py", line 847, in parse
    self._tags[rec.tag](self.cr, rec, n)
  File "/opt/openerp/server/openerp/tools/convert.py", line 805, in _tag_record
    f_val = self.id_get(cr, f_ref)
  File "/opt/openerp/server/openerp/tools/convert.py", line 824, in id_get
    res = self.model_id_get(cr, id_str)
  File "/opt/openerp/server/openerp/tools/convert.py", line 833, in model_id_get
    return model_data_obj.get_object_reference(cr, self.uid, mod, id_str)
  File "/opt/openerp/server/openerp/tools/cache.py", line 18, in lookup
    r = self.lookup(self2, cr, *args)
  File "/opt/openerp/server/openerp/tools/cache.py", line 46, in lookup
    value = d[key] = self.method(self2, cr, *args)
  File "/opt/openerp/server/openerp/addons/base/ir/ir_model.py", line 861, in get_object_reference
    data_id = self._get_id(cr, uid, module, xml_id)
  File "/opt/openerp/server/openerp/tools/cache.py", line 18, in lookup
    r = self.lookup(self2, cr, *args)
  File "/opt/openerp/server/openerp/tools/cache.py", line 46, in lookup
    value = d[key] = self.method(self2, cr, *args)
  File "/opt/openerp/server/openerp/addons/base/ir/ir_model.py", line 854, in _get_id
    raise ValueError('No such external ID currently defined in the system: %s.%s' % (module, xml_id))
ValueError: No such external ID currently defined in the system: product.cat1

My file : __openerp__.py

{
        "name" : "Products Apparel Syang",
        "version" : "1.0",
        "author" : "Syang",
        "category" : "Generic Modules/Inventory Control",
        "description": "Add a field to product to handle color and size",
        "depends" : ["product"],
        "init_xml" : [],
        "demo_xml" : [],
        "update_xml" : [],
        "installable": True,
        "active": False
}

My file : product_apparel_syang.py :

from osv import fields, osv
class product_apparel_syang(osv.osv):
        _name = "product.apparel.syang"
        _inherit = "product.product"
        _description = "Add colors and size property to a product"
        _columns = {
                'product_color' : fields.integer('Product', help="color of the product")
        }
product_apparel_syang()
Avatar
Discard
Best Answer

The error you see is:

ValueError: No such external ID currently defined in the system: product.cat1

This means that the product category with that ID (product.cat1, i.e the old Sellable category) is missing, while a module that depends on it is being installed. The server logs should mention the name of the XML file being loaded, right before the error trace. Note that this is strange because this product category does not exist in v7 anymore, so even forcing an update of the product module will not re-create it and fix the issue. Maybe you mixed 7.0 modules with older ones?

In any case you should double-check your module list, apparently another module is being installed while the uninstall of your own module is processed (installing/upgrading/uninstalling a module processes all module management tasks at once).

This error is probably not caused by your module unless it contains more code than what you've shown...

Avatar
Discard
Author

Great thank you. Looking the log, I found error message concerning product_variant_multi who was "pending uninstall". So I cancel the uninstall of product_variant_multi, try to uninstall again my module and it works. Thanks again.