Odoo Help


store=False brings error

Mathieu Laflamme
on 8/4/15, 5:29 PM 791 views

I added this field in res.partner:

 stock_owner_has_changed = fields.Boolean('Stock Owner Has Changed',
                                             help="This is to know if the change of stock owner was done on the UX")

I don't want to store this field in DB so I put store=False. But it crash... Set it to True and it runs!


2015-08-04 17:19:36,026 5288 INFO ? openerp.addons.report.models.report: Will use the Wkhtmltopdf binary at C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe
2015-08-04 17:19:37,295 5288 INFO ? openerp.http: HTTP Configuring static files
2015-08-04 17:19:45,240 5288 INFO odoo_8a openerp.modules.loading: loading 61 modules...
2015-08-04 17:19:53,072 5288 INFO odoo_8a openerp.modules.module: module isolate_stock_owners: creating or updating database tables
2015-08-04 17:19:53,217 5288 INFO odoo_8a openerp.addons.auth_crypt.auth_crypt: Hashing passwords, may be slow for databases with many users...
2015-08-04 17:19:53,391 5288 INFO odoo_8a openerp.modules.loading: loading isolate_stock_owners/views.xml
2015-08-04 17:19:54,377 5288 CRITICAL odoo_8a openerp.service.server: Failed to initialize database `odoo_8a`.
Traceback (most recent call last):
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\service\server.py", line 929, in preload_registries
    registry = RegistryManager.new(dbname, update_module=update_module)
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\modules\registry.py", line 370, in new
    openerp.modules.load_modules(registry._db, force_demo, status, update_module)
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\modules\loading.py", line 351, in load_modules
    force, status, report, loaded_modules, update_module)
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\modules\loading.py", line 255, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\modules\loading.py", line 176, in load_module_graph
    _load_data(cr, module_name, idref, mode, kind='data')
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\modules\loading.py", line 118, in _load_data
    tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\tools\convert.py", line 901, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\tools\convert.py", line 987, in convert_xml_import
    obj.parse(doc.getroot(), mode=mode)
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\tools\convert.py", line 853, in parse
    self._tags[rec.tag](self.cr, rec, n, mode=mode)
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\tools\convert.py", line 763, 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 "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\addons\base\ir\ir_model.py", line 1050, in _update
    model_obj.write(cr, uid, [res_id], values, context=context)
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\addons\base\ir\ir_ui_view.py", line 282, in write
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\api.py", line 363, in old_api
    result = method(recs, *args, **kwargs)
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\models.py", line 3775, in write
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\api.py", line 239, in wrapper
    return new_api(self, *args, **kwargs)
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\api.py", line 546, in new_api
    result = method(self._model, cr, uid, self.ids, *args, **kwargs)
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\models.py", line 3946, in _write
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\api.py", line 239, in wrapper
    return new_api(self, *args, **kwargs)
  File "C:\Users\laflammm\Desktop\GitHub\odoo\openerp\models.py", line 1270, in _validate_fields
    raise ValidationError('\n'.join(errors))
ParseError: "ValidateError
Field(s) `arch` failed against a constraint: Invalid view definition

Error details:
_description_searchable" while parsing file:///C:/Users/laflammm/Desktop/GitHub/odoo/addons_tc/isolate_stock_owners/views.xml:27, near
<record model="ir.ui.view" id="partner_stock_owner_inherit">
            <field name="name">partner.stock.owner.inherit</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="base.view_partner_form"/>
            <field name="arch" type="xml">
                <data><field name="user_id" position="after">
                    <field name="stock_owner_id" attrs="{'readonly':[('parent_id','!=',False)],'invisible':[('stock_owner','=',True)]}"/>                  
                <xpath expr="//page[@name='sales_purchases']//field[@name='supplier']" position="after">
                    <field name="stock_owner"/>               

The error is not funny, refering to my view that I didn't even touched.

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 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

Question tools

1 follower(s)


Asked: 8/4/15, 5:29 PM
Seen: 791 times
Last updated: 9/9/15, 10:59 PM