Odoo Help

Welcome!

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

0

Error installing eCommerce Delivery By Odoo SA

By
Michael Scorpio
on 9/1/16, 8:32 AM 148 views

Any ideas as to what's going on here?

Odoo Server Error
Traceback (most recent call last):
  File "/opt/odoo/odoo-server/openerp/http.py", line 643, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/odoo-server/openerp/http.py", line 680, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/odoo-server/openerp/http.py", line 316, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/service/model.py", line 118, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/http.py", line 309, in checked_call
    result = self.endpoint(*a, **kw)
  File "/opt/odoo/odoo-server/openerp/http.py", line 959, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/odoo-server/openerp/http.py", line 509, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 896, in call_button
    action = self._call_kw(model, method, args, {})
  File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 884, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/addons/base/module/module.py", line 459, in button_immediate_install
    return self._button_immediate_function(cr, uid, ids, self.button_install, context=context)
  File "/opt/odoo/odoo-server/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/addons/base/module/module.py", line 533, in _button_immediate_function
    registry = openerp.modules.registry.RegistryManager.new(cr.dbname, update_module=True)
  File "/opt/odoo/odoo-server/openerp/modules/registry.py", line 386, in new
    openerp.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/opt/odoo/odoo-server/openerp/modules/loading.py", line 338, in load_modules
    loaded_modules, update_module)
  File "/opt/odoo/odoo-server/openerp/modules/loading.py", line 237, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/opt/odoo/odoo-server/openerp/modules/loading.py", line 156, in load_module_graph
    _load_data(cr, module_name, idref, mode, kind='data')
  File "/opt/odoo/odoo-server/openerp/modules/loading.py", line 98, in _load_data
    tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
  File "/opt/odoo/odoo-server/openerp/tools/convert.py", line 851, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/opt/odoo/odoo-server/openerp/tools/convert.py", line 938, in convert_xml_import
    obj.parse(doc.getroot(), mode=mode)
  File "/opt/odoo/odoo-server/openerp/tools/convert.py", line 801, in parse
    self.parse(rec, mode)
  File "/opt/odoo/odoo-server/openerp/tools/convert.py", line 804, in parse
    self._tags[rec.tag](self.cr, rec, de, mode=mode)
  File "/opt/odoo/odoo-server/openerp/tools/convert.py", line 708, in _tag_record
    id = self.pool['ir.model.data']._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
  File "/opt/odoo/odoo-server/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/addons/base/ir/ir_model.py", line 1138, in _update
    res_id = model_obj.create(cr, uid, values, context=context)
  File "/opt/odoo/odoo-server/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/api.py", line 354, in old_api
    result = method(recs, *args, **kwargs)
  File "/opt/odoo/odoo-server/addons/delivery/models/delivery_carrier.py", line 227, in create
    res = super(DeliveryCarrier, self).create(vals)
  File "/opt/odoo/odoo-server/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 4134, in create
    record = self.browse(self._create(old_vals))
  File "/opt/odoo/odoo-server/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/api.py", line 490, in new_api
    result = method(self._model, cr, uid, *args, **old_kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 4190, in _create
    record_id = self.pool[table].create(cr, user, tocreate[table], context=context)
  File "/opt/odoo/odoo-server/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/addons/product/product.py", line 1197, in create
    product_id = super(product_product, self).create(cr, uid, vals, context=ctx)
  File "/opt/odoo/odoo-server/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/api.py", line 354, in old_api
    result = method(recs, *args, **kwargs)
  File "/opt/odoo/odoo-server/addons/mail/models/mail_thread.py", line 232, in create
    thread = super(MailThread, self).create(values)
  File "/opt/odoo/odoo-server/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 4134, in create
    record = self.browse(self._create(old_vals))
  File "/opt/odoo/odoo-server/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/api.py", line 490, in new_api
    result = method(self._model, cr, uid, *args, **old_kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 4190, in _create
    record_id = self.pool[table].create(cr, user, tocreate[table], context=context)
  File "/opt/odoo/odoo-server/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/addons/stock_account/product.py", line 76, in create
    return super(product_template, self).create(cr, uid, vals, context=context)
  File "/opt/odoo/odoo-server/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/addons/product/product.py", line 690, in create
    product_template_id = super(product_template, self).create(cr, uid, vals, context=context)
  File "/opt/odoo/odoo-server/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/api.py", line 354, in old_api
    result = method(recs, *args, **kwargs)
  File "/opt/odoo/odoo-server/addons/mail/models/mail_thread.py", line 232, in create
    thread = super(MailThread, self).create(values)
  File "/opt/odoo/odoo-server/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 4134, in create
    record = self.browse(self._create(old_vals))
  File "/opt/odoo/odoo-server/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/api.py", line 490, in new_api
    result = method(self._model, cr, uid, *args, **old_kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 4272, in _create
    tuple([u[2] for u in updates if len(u) > 2])
  File "/opt/odoo/odoo-server/openerp/sql_db.py", line 141, in wrapper
    return f(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/sql_db.py", line 220, in execute
    res = self._obj.execute(query, params)
ParseError: "null value in column "categ_id" violates not-null constraint
DETAIL:  Failing row contains (310, null, 1.00, null, 1, 0, 1, 1, null, 2016-09-01 11:35:23.722581, 1, t, null, null, null, 1, null, 1, null, null, null, 2016-09-01 11:35:23.722581, t, f, Free delivery charges, consu, null, 7, none, receive, t, manual, order).
" while parsing /opt/odoo/odoo-server/addons/delivery/data/delivery_data.xml:12, near
<record id="free_delivery_carrier" model="delivery.carrier">
            <field name="name">Free delivery charges</field>
            <field name="fixed_price">0</field>
            <field name="free_if_more_than" eval="True"/>
            <field name="amount">1000</field>
            <field name="sequence">1</field>
            <field name="delivery_type">fixed</field>
            <field name="product_type">service</field>
            <field name="product_sale_ok" eval="False"/>
            <field name="partner_id" ref="res_partner_delivery"/>
        </record>



Ok, I've been able to get the module installed by editing the XML and adding the missing column. I've taken a guess and used 1, but I have no idea what it's referencing. My question now is; how has this happened? Is it another module has added the non-nullable column to the table? If so, it seems to me to be poor practise as you're bound to prevent other modules from being able to install.

Michael Scorpio
on 9/1/16, 8:06 PM
0

Ray Carnes

--Ray Carnes--
15717
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

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. 

Ray Carnes
On 9/1/16, 7:38 PM

My guess is someone deleted the product category "All" in the database where you are trying to install.  This breaks the function that looks for a default product category, returning a NULL/False value - so when Odoo tries to import the XML shown in the error message, it fails because Product Category is a required field.

Sorry about the delay. I've taken a look and the product category is there. I have however learned a little more;

The problem also occurs installing POS in the same database. Using a fresh database and installing all of the apps that are installed in the problem database followed by installing POS works. I've tried turning on SQL logging and checking the queries and trying to follow the code (which isn't easy) and didn't get anywhere. I've found that on a clean install and removing all product categories before installing POS results in an a foreign key constraint violation which is exaclty what one would expect; what did surprise however is that the value being inserted for categ_id was 1. This got me hunting for where this mysterious value came from. I compared my problem DB with a clean install and found a row in ir_model_data with a model of 'product.category' and res_id of 1. The name attribute in the clean DB was 'product_category_all' and on the problem DB was 'All'. Updating the name attribute in the problem DB to match the clean DB fixed the problem and I was able to install POS.

The question is obvously; how did this happen? What activities would change this attribute or result in different attributes on install?

Michael Scorpio
on 10/7/16, 5:31 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 9/1/16, 8:32 AM
Seen: 148 times
Last updated: 9/2/16, 4:46 AM