Help

Welcome!

This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

0

Extending a osv_memory and use that column in xml

Avatar
Gert
0
0
2,354
..py file
class mrp_product_produce(osv.osv_memory):
    _inherit = "mrp.product.produce"

    _columns = {
        'test': fields.char('test')
    }

…xml file
 <record id="view_mrp_product_produce_wizard_sss" model="ir.ui.view">
            <field name="name">MRP Product Produce</field>
            <field name="model">mrp.product.produce</field>
            <field name="inherit_id" ref="mrp.view_mrp_product_produce_wizard"/>
            <field name="arch" type="xml">
                <data>
                	<xpath expr="(//field[@name='product_id'])[2]" position="after">
                		<field name="test"/>
                    </xpath>
                </data>
            </field>
        </record>

gives next error ;-(

2016-01-21 11:06:12,725 6351 INFO db_20160107 openerp.modules.module: module SSS_po_project_task: creating or updating database tables
2016-01-21 11:06:13,758 6351 INFO db_20160107 openerp.modules.loading: loading SSS_po_project_task/views/mrp_view.xml
2016-01-21 11:06:14,347 6351 ERROR db_20160107 openerp.addons.base.ir.ir_ui_view: Veld test` bestaat niet

Fout context:
Weergave`MRP Product Produce`
[view_id: 1288, xml_id: SSS_po_project_task.view_mrp_product_produce_wizard_sss, model: mrp.product.produce, parent_id: 907]
2016-01-21 11:06:14,348 6351 DEBUG db_20160107 openerp.models: Exception while validating constraint
Traceback (most recent call last):
File "/media/disk2/workspace/odoo8_sss/openerp/models.py", line 1251, in _validate_fields
valid = valid or fun(self._model, cr, uid, ids)
File "/media/disk2/workspace/odoo8_sss/openerp/addons/base/ir/ir_ui_view.py", line 202, in _check_xml
self.postprocess_and_fields(cr, uid, view.model, view_doc, view.id, context=context)
File "/media/disk2/workspace/odoo8_sss/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/media/disk2/workspace/odoo8_sss/openerp/addons/base/ir/ir_ui_view.py", line 806, in postprocess_and_fields
fields_def = self.postprocess(cr, user, model, node, view_id, False, fields, context=context)
File "/media/disk2/workspace/odoo8_sss/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/media/disk2/workspace/odoo8_sss/openerp/addons/base/ir/ir_ui_view.py", line 716, in postprocess
fields.update(self.postprocess(cr, user, model, f, view_id, in_tree_view, model_fields, context))
File "/media/disk2/workspace/odoo8_sss/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/media/disk2/workspace/odoo8_sss/openerp/addons/base/ir/ir_ui_view.py", line 716, in postprocess
fields.update(self.postprocess(cr, user, model, f, view_id, in_tree_view, model_fields, context))
File "/media/disk2/workspace/odoo8_sss/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/media/disk2/workspace/odoo8_sss/openerp/addons/base/ir/ir_ui_view.py", line 643, in postprocess
xarch, xfields = self.postprocess_and_fields(cr, user, field.comodel_name, f, view_id, ctx)
File "/media/disk2/workspace/odoo8_sss/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/media/disk2/workspace/odoo8_sss/openerp/addons/base/ir/ir_ui_view.py", line 832, in postprocess_and_fields
self.raise_view_error(cr, user, message, view_id, context)
File "/media/disk2/workspace/odoo8_sss/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/media/disk2/workspace/odoo8_sss/openerp/addons/base/ir/ir_ui_view.py", line 360, in raise_view_error
raise AttributeError(message)
AttributeError: Veld test` bestaat niet

Fout context:
Weergave`MRP Product Produce`
[view_id: 1288, xml_id: SSS_po_project_task.view_mrp_product_produce_wizard_sss, model: mrp.product.produce, parent_id: 907]
2016-01-21 11:06:14,362 6351 ERROR db_20160107 openerp.http: Exception during JSON request handling.
Traceback (most recent call last):
File "/media/disk2/workspace/odoo8_sss/openerp/http.py", line 537, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/media/disk2/workspace/odoo8_sss/openerp/http.py", line 574, in dispatch
result = self._call_function(**self.params)
File "/media/disk2/workspace/odoo8_sss/openerp/http.py", line 310, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/media/disk2/workspace/odoo8_sss/openerp/service/model.py", line 118, in wrapper
return f(dbname, *args, **kwargs)
File "/media/disk2/workspace/odoo8_sss/openerp/http.py", line 307, in checked_call
return self.endpoint(*a, **kw)
File "/media/disk2/workspace/odoo8_sss/openerp/http.py", line 803, in __call__
return self.method(*args, **kw)
File "/media/disk2/workspace/odoo8_sss/openerp/http.py", line 403, in response_wrap
response = f(*args, **kw)
File "/media/disk2/workspace/odoo8_sss/addons/web/controllers/main.py", line 948, in call_button
action = self._call_kw(model, method, args, {})
File "/media/disk2/workspace/odoo8_sss/addons/web/controllers/main.py", line 936, in _call_kw
return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
File "/media/disk2/workspace/odoo8_sss/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/media/disk2/workspace/odoo8_sss/openerp/addons/base/module/module.py", line 534, in button_immediate_upgrade
return self._button_immediate_function(cr, uid, ids, self.button_upgrade, context=context)
File "/media/disk2/workspace/odoo8_sss/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/media/disk2/workspace/odoo8_sss/openerp/addons/base/module/module.py", line 495, in _button_immediate_function
registry = openerp.modules.registry.RegistryManager.new(cr.dbname, update_module=True)
File "/media/disk2/workspace/odoo8_sss/openerp/modules/registry.py", line 370, in new
openerp.modules.load_modules(registry._db, force_demo, status, update_module)
File "/media/disk2/workspace/odoo8_sss/openerp/modules/loading.py", line 351, in load_modules
force, status, report, loaded_modules, update_module)
File "/media/disk2/workspace/odoo8_sss/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 "/media/disk2/workspace/odoo8_sss/openerp/modules/loading.py", line 176, in load_module_graph
_load_data(cr, module_name, idref, mode, kind='data')
File "/media/disk2/workspace/odoo8_sss/openerp/modules/loading.py", line 118, in _load_data
tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
File "/media/disk2/workspace/odoo8_sss/openerp/tools/convert.py", line 901, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
File "/media/disk2/workspace/odoo8_sss/openerp/tools/convert.py", line 987, in convert_xml_import
obj.parse(doc.getroot(), mode=mode)
File "/media/disk2/workspace/odoo8_sss/openerp/tools/convert.py", line 853, in parse
self._tags[rec.tag](self.cr, rec, n, mode=mode)
File "/media/disk2/workspace/odoo8_sss/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 "/media/disk2/workspace/odoo8_sss/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/media/disk2/workspace/odoo8_sss/openerp/addons/base/ir/ir_model.py", line 1025, in _update
model_obj.write(cr, uid, [res_id], values, context=context)
File "/media/disk2/workspace/odoo8_sss/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/media/disk2/workspace/odoo8_sss/openerp/addons/base/ir/ir_ui_view.py", line 273, in write
context)
File "/media/disk2/workspace/odoo8_sss/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/media/disk2/workspace/odoo8_sss/openerp/api.py", line 372, in old_api
result = method(recs, *args, **kwargs)
File "/media/disk2/workspace/odoo8_sss/openerp/models.py", line 3787, in write
self._write(old_vals)
File "/media/disk2/workspace/odoo8_sss/openerp/api.py", line 248, in wrapper
return new_api(self, *args, **kwargs)
File "/media/disk2/workspace/odoo8_sss/openerp/api.py", line 565, in new_api
result = method(self._model, cr, uid, self.ids, *args, **kwargs)
File "/media/disk2/workspace/odoo8_sss/openerp/models.py", line 3959, in _write
recs._validate_fields(vals)
File "/media/disk2/workspace/odoo8_sss/openerp/api.py", line 248, in wrapper
return new_api(self, *args, **kwargs)
File "/media/disk2/workspace/odoo8_sss/openerp/models.py", line 1272, in _validate_fields
raise ValidationError('\n'.join(errors))
ParseError: "ValidateError
Field(s) `arch` failed against a constraint: Invalid view definition

Meer info over fout:
Veld test` bestaat niet

Fout context:
Weergave`MRP Product Produce`
[view_id: 1288, xml_id: SSS_po_project_task.view_mrp_product_produce_wizard_sss, model: mrp.product.produce, parent_id: 907]" while parsing /media/disk2/workspace/odoo8_sss/custom_artissan/SSS_po_project_task/views/mrp_view.xml:21, near
<record id="view_mrp_product_produce_wizard_sss" model="ir.ui.view">
<field name="name">MRP Product Produce</field>
<field name="model">mrp.product.produce</field>
<field name="inherit_id" ref="mrp.view_mrp_product_produce_wizard"/>
<field name="arch" type="xml">
<data>
<xpath expr="(//field[@name='product_id'])[2]" position="after">
<field name="test"/>
</xpath>
</data>
</field>
</record>
2016-01-21 11:06:14,370 6351 INFO db_20160107 werkzeug: 10.0.0.64 - - [21/Jan/2016 11:06:14] "POST /web/dataset/call_button HTTP/1.1" 200 -
2016-01-21 11:06:32,661 6351 INFO db_20160107 openerp.modules.loading: loading 1 modules…
2016-01-21 11:06:32,684 6351 INFO db_20160107 openerp.modules.loading: 1 modules loaded in 0.02s, 0 queries
2016-01-21 11:06:33,400 6351 DEBUG db_20160107 openerp.modules.loading: Updating graph with 107 more modules
2016-01-21 11:06:33,440 6351 INFO db_20160107 openerp.modules.loading: loading 108 modules…
2016-01-21 11:06:41,515 6351 INFO db_20160107 openerp.modules.module: module SSS_po_project_task: creating or updating database tables
2016-01-21 11:06:42,663 6351 INFO db_20160107 openerp.modules.loading: loading SSS_po_project_task/views/mrp_view.xml
2016-01-21 11:06:43,565 6351 ERROR db_20160107 openerp.addons.base.ir.ir_ui_view: Veld test` bestaat niet


Can anyone help me please????
Avatar
Gert
Avatar
Discard
0 Answers

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!

Q&A Forum Regulations

Forum Regulations

By using the FAQ Forum on ERPOnline.vn website, you unconditionally agree to the following terms:

    1. Q&A Forum is a discussion environment to support each other in Odoo/ERPOnline implementation, in the spirit of "community support community", with internet address at: https://www.erponline.vn/forum/hoi-dap-7

    2. You are thoroughly responsible for the content submitted by you.

    3. DO NOT use the Q&A Forum for any activities that violate Vietnamese law and International Conventions to which Vietnam is a participant.

    4. DO NOT post content that is offensive, defamatory, or discredits other individuals or legal entities.

    5. DO NOT post advertisements or advertising content.

    6. DO NOT post content that is not related to management software and ERP in general as well as OpenERP and ERPOnline.vn in particular.

    7. DO NOT post copyrighted content or content, materials, products protected by Intellectual Property law without the written consent of the author.

    8. DO NOT embed images from other websites.

    9. You agree that all options, solutions, answers in the Q&A section on ERPOnline.vn website are for reference only. ERPOnline.vn website will not be liable if you have any damage when applying the plans given in the Q&A section on ERPOnline.vn website.

These terms and conditions may be amended to suit reality at any time without prior notice.