Odoo Help

0

Error in view arch: Invalid XML for View Architecture!

By
Kris Coenen
on 5/3/13, 6:00 AM 1,703 views

I want to add a field called loadnumber to a the purchase order form in the order lines but when i load the module i get the following error

Client Traceback (most recent call last):

  File "/home/kris/openerp/openerp/addons/web/http.py", line 195, in dispatch
    response["result"] = method(self, **self.params)
  File "/home/kris/openerp/openerp/addons/web/controllers/main.py", line 818, in authenticate
    req.session.authenticate(db, login, password, env)
  File "/home/kris/openerp/openerp/addons/web/session.py", line 116, in authenticate
    uid = self.proxy('common').authenticate(db, login, password, env)
  File "/home/kris/openerp/openerp/addons/web/session.py", line 31, in proxy_method
    result = self.session.send(self.service_name, method, *args)
  File "/home/kris/openerp/openerp/addons/web/session.py", line 104, in send
    raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)


Server Traceback (most recent call last):
  File "/home/kris/openerp/openerp/addons/web/session.py", line 90, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/home/kris/openerp/openerp/netsvc.py", line 295, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/kris/openerp/openerp/service/web_services.py", line 425, in dispatch
    return fn(*params)
  File "/home/kris/openerp/openerp/service/web_services.py", line 436, in exp_authenticate
    res_users = pooler.get_pool(db).get('res.users')
  File "/home/kris/openerp/openerp/pooler.py", line 49, in get_pool
    return get_db_and_pool(db_name, force_demo, status, update_module)[1]
  File "/home/kris/openerp/openerp/pooler.py", line 33, in get_db_and_pool
    registry = RegistryManager.get(db_name, force_demo, status, update_module)
  File "/home/kris/openerp/openerp/modules/registry.py", line 192, in get
    update_module)
  File "/home/kris/openerp/openerp/modules/registry.py", line 214, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/home/kris/openerp/openerp/modules/loading.py", line 343, in load_modules
    processed = load_marked_modules(cr, graph, states_to_load, force, status, report, loaded_modules, update_module)
  File "/home/kris/openerp/openerp/modules/loading.py", line 258, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/home/kris/openerp/openerp/modules/loading.py", line 190, in load_module_graph
    load_data(module_name, idref, mode)
  File "/home/kris/openerp/openerp/modules/loading.py", line 75, in <lambda>
    load_data = lambda *args: _load_data(cr, *args, kind='data')
  File "/home/kris/openerp/openerp/modules/loading.py", line 126, in _load_data
    tools.convert_xml_import(cr, module_name, fp, idref, mode, noupdate, report)
  File "/home/kris/openerp/openerp/tools/convert.py", line 954, in convert_xml_import
    obj.parse(doc.getroot())
  File "/home/kris/openerp/openerp/tools/convert.py", line 847, in parse
    self._tags[rec.tag](self.cr, rec, n)
  File "/home/kris/openerp/openerp/tools/convert.py", line 814, in _tag_record
    id = self.pool.get('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/kris/openerp/openerp/addons/base/ir/ir_model.py", line 956, in _update
    res_id = model_obj.create(cr, uid, values, context=context)
  File "/home/kris/openerp/openerp/addons/base/ir/ir_ui_view.py", line 102, in create
    return super(osv.osv, self).create(cr, uid, values, context)
  File "/home/kris/openerp/openerp/osv/orm.py", line 4473, in create
    self._validate(cr, user, [id_new], context)
  File "/home/kris/openerp/openerp/osv/orm.py", line 1546, in _validate
    raise except_orm('ValidateError', '\n'.join(error_msgs))
except_orm: ('ValidateError', u'Fout opgetreden bij het valideren van veld(en) arch: Invalid XML for View Architecture!')

This is my code i have written

in the purchase_order.xml

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
    <data>

        <record id="purchase_order_view_loadnumber" model="ir.ui.view">
            <field name="name">purchase order loadnumber</field>
            <field name="model">purchase.order</field>
            <field name="inherit_id" ref="purchase.purchase_order_form"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='product_uom']" position="after">
                    <field name="loadnumber"/>
                </xpath>
            </field>
        </record>

    </data>
</openerp>

Purchase_order.py

from openerp.osv import osv, fields

class inkoop_bestelling(osv.Model):

    _inherit ='purchase.order.line'

    _columns= {
        'loadnumber' : fields.char('Laadnummer'),
        }

I've" been looking for hours and can't find what's wrong with it

0
Kris Coenen
On 5/3/13, 6:42 AM

Changed it still the same error

0
Shelton
On 5/3/13, 6:15 AM

Please use class inkoop_bestelling(osv.osv): instead of class inkoop_bestelling(osv.Model):

Also, The char field should have a size attribute

0

Naresh Soni (nch)

--Naresh Soni (nch)--
Tiny ERP Pvt Ltd
http://www.odoo.com
1291
| 2 2 4
India
--Naresh Soni (nch)--

Team Lead, Odoo(Formerly OpenERP) Support & OPW

Naresh Soni (nch)
On 5/3/13, 7:09 AM

Hello Kris,

I see a problem here Why are you inheriting 'purchase.order.line' in your .py ? it should be purchase.order as you want to add 'loadnumber' to purchase order.

Thanks,

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.

Register

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

0 follower(s)

Stats

Asked: 5/3/13, 6:00 AM
Seen: 1703 times
Last updated: 3/16/15, 8:10 AM