Community mailing list archives

community@mail.odoo.com

Re: Can't upgrade built-in modules after insttalling my custom module

by
Hieu Nguyen
- 12/02/2015 06:09:18
Dear Houssine,

Yes, I did. Otherwise my module doesn't work and extend the `product.template` in the first place, does it?

Here is my __init__.py:

# -*- coding: utf-8 -*-
from controllers import controllers
from .models import custom_product_template


My module structure:
__init__.py
__openerp__.py
models/__init__.py
models/custom_product_template.py
controllers/__init__.py
controllers/controllers.py
...

Regards,
Hieu

On 02/12/2015 17:36, Houssine BAKKALI wrote:
<blockquote cite="mid:CANNbhR-oLfH7q56hnWop1yR3hAPc9T9KGfZRyLdvJch2aUcC_w@mail.gmail.com" type="cite">
did you put the py file extending the product.template model with doc_filename in your __init__.py file?

2015-12-02 11:07 GMT+01:00 Hieu Nguyen <hieutngn@gmail.com>:
Dear Odoo Community,

After installing my custom module which extends some built-in models (such as `product.template`) by adding some custom fields,
I can NOT upgrade built-in modules such as `sale` neither by the web interface or by the `-u` parameter.

Here is the log when I tried to upgrade `sale` module (
`doc_filename` is my custom field which was added to `product.template` model):

015-12-02 09:50:06,669 7088 ERROR kkm-odoo-9.0 werkzeug: Error on request:
Traceback (most recent call last):
  File "/home/hieu/odoo_9.0/env/lib/python2.7/site-packages/werkzeug/serving.py", line 177, in run_wsgi
    execute(self.server.app)
  File "/home/hieu/odoo_9.0/env/lib/python2.7/site-packages/werkzeug/serving.py", line 165, in execute
    application_iter = app(environ, start_response)
  File "/home/hieu/odoo_9.0/odoo/openerp/service/server.py", line 245, in app
    return self.app(e, s)
  File "/home/hieu/odoo_9.0/odoo/openerp/service/wsgi_server.py", line 184, in application
    return application_unproxied(environ, start_response)
  File "/home/hieu/odoo_9.0/odoo/openerp/service/wsgi_server.py", line 170, in application_unproxied
    result = handler(environ, start_response)
  File "/home/hieu/odoo_9.0/odoo/openerp/http.py", line 1416, in __call__
    return self.dispatch(environ, start_response)
  File "/home/hieu/odoo_9.0/odoo/openerp/http.py", line 1390, in __call__
    return self.app(environ, start_wrapped)
  File "/home/hieu/odoo_9.0/env/lib/python2.7/site-packages/werkzeug/wsgi.py", line 588, in __call__
    return self.app(environ, start_response)
  File "/home/hieu/odoo_9.0/odoo/openerp/http.py", line 1565, in dispatch
    ir_http = request.registry['ir.http']
  File "/home/hieu/odoo_9.0/odoo/openerp/http.py", line 354, in registry
    return openerp.modules.registry.RegistryManager.get(self.db) if self.db else None
  File "/home/hieu/odoo_9.0/odoo/openerp/modules/registry.py", line 354, in get
    update_module)
  File "/home/hieu/odoo_9.0/odoo/openerp/modules/registry.py", line 385, in new
    openerp.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/home/hieu/odoo_9.0/odoo/openerp/modules/loading.py", line 333, in load_modules
    force, status, report, loaded_modules, update_module)
  File "/home/hieu/odoo_9.0/odoo/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 "/home/hieu/odoo_9.0/odoo/openerp/modules/loading.py", line 156, in load_module_graph
    _load_data(cr, module_name, idref, mode, kind='data')
  File "/home/hieu/odoo_9.0/odoo/openerp/modules/loading.py", line 98, in _load_data
    tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
  File "/home/hieu/odoo_9.0/odoo/openerp/tools/convert.py", line 852, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/home/hieu/odoo_9.0/odoo/openerp/tools/convert.py", line 939, in convert_xml_import
    obj.parse(doc.getroot(), mode=mode)
  File "/home/hieu/odoo_9.0/odoo/openerp/tools/convert.py", line 802, in parse
    self.parse(rec, mode)
  File "/home/hieu/odoo_9.0/odoo/openerp/tools/convert.py", line 805, in parse
    self._tags[rec.tag](self.cr, rec, de, mode=mode)
  File "/home/hieu/odoo_9.0/odoo/openerp/tools/convert.py", line 709, 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 "/home/hieu/odoo_9.0/odoo/openerp/api.py", line 232, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/hieu/odoo_9.0/odoo/openerp/addons/base/ir/ir_model.py", line 1080, in _update
    model_obj.write(cr, uid, [res_id], values, context=context)
  File "/home/hieu/odoo_9.0/odoo/openerp/api.py", line 232, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/hieu/odoo_9.0/odoo/openerp/addons/base/ir/ir_ui_view.py", line 374, in write
    context)
  File "/home/hieu/odoo_9.0/odoo/openerp/api.py", line 232, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/hieu/odoo_9.0/odoo/openerp/api.py", line 354, in old_api
    result = method(recs, *args, **kwargs)
  File "/home/hieu/odoo_9.0/odoo/openerp/models.py", line 3817, in write
    self._write(old_vals)
  File "/home/hieu/odoo_9.0/odoo/openerp/api.py", line 230, in wrapper
    return new_api(self, *args, **kwargs)
  File "/home/hieu/odoo_9.0/odoo/openerp/api.py", line 547, in new_api
    result = method(self._model, cr, uid, self.ids, *args, **kwargs)
  File "/home/hieu/odoo_9.0/odoo/openerp/models.py", line 3997, in _write
    recs._validate_fields(vals)
  File "/home/hieu/odoo_9.0/odoo/openerp/api.py", line 230, in wrapper
    return new_api(self, *args, **kwargs)
  File "/home/hieu/odoo_9.0/odoo/openerp/models.py", line 1272, in _validate_fields
    raise ValidationError('\n'.join(errors))
ParseError: "Invalid view definition

Error details:
Field `doc_filename` does not exist

Error context:
View `product.template.sale.order.button`
[view_id: 874, xml_id: sale.product_template_form_view_sale_order_button, model: product.template, parent_id: 442]
None" while parsing /home/hieu/odoo_9.0/odoo/addons/sale/sale_view.xml:525, near
<record model="ir.ui.view" id="product_template_form_view_sale_order_button">
            <field name="name">product.template.sale.order.button</field>
            <field name="model">product.template</field>
            <field name="inherit_id" ref="product.product_template_only_form_view"/>
            <field name="groups_id" eval="[(4, ref('base.group_sale_salesman'))]"/>
            <field name="arch" type="xml">
                <div name="button_box" position="inside">
                    <button class="oe_stat_button" name="action_view_sales" type="object" icon="fa-usd" groups="base.group_no_one">
                        <field string="Sales" name="sales_count" widget="statinfo"/>
                    </button>
                </div>
            </field>
        </record>


Regards,
Hieu

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe