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:RELAXNGV:RELAXNG_ERR_EXTRACONTENT: Element form has extra content: sheet [Closed]

By
priyankahdp
on 3/21/13, 3:38 AM 2,343 views

The Question has been closed

by
priyankahdp
on 04/20/2013 03:34:26

I'm going to developer work offer module.in that module if we selected the relevant division we can select workers for work offer for them (in plantation industry). tried with comparing lunch module (lunch order form) but i got this error. (OpenERP ver 7)

here is my view.xml

    <record model="ir.ui.view" id="bpl_work_offer_form">
        <field name="name">bpl.work.offer.form</field>
        <field name="model">bpl.work.offer</field>
        <field name="arch" type="xml">
            <form string='bpl_work_offer'>
                <sheet>
                    <group>
                        <group>
                            <field name='user_id' />
                        </group>
                        <group>
                            <field name='date_of_offer' />
                        </group>
                    </group>
                    <div name="Worker Selection"></div>
                    <separator string='Select workers' />
                    <field name='selected_workers_line_ids' nolabel='1'>
                        <tree string='List' editable='bottom'>
                            <field name='worker_id' />
                            <field name='is_selected' />
                        </tree>
                    </field>
                    <group class='oe_subtotal_footer oe_right'>
                        <field name='total_workers' />
                    </group>
                    <br />
                    <br />
                </sheet>
            </form>
        </field>
    </record>

here is my model class

class bpl_work_offer(osv.osv):
    _name = "bpl.work.offer"
    _description = "BPL Work Offer"
    _columns = {
        'user_id': fields.many2one('res.users', 'User Name'),
        'date_of_offer': fields.date('Date'),
        'bpl_company_id':fields.many2one('bpl.company.registration', 'Company', help='Company'),
        'bpl_estate_id':fields.many2one('bpl.estate.registration', 'Estate', help='Estate'),
        'bpl_division_id':fields.many2one('bpl.division.registration', 'Division', help='Division'),
        'payment_type': fields.selection([('normal_work', 'Normal Work'), ('cash_work', 'Cash Work'), ('contract_work', 'Contract Work')], 'Payment Type'),
        'select_by': fields.selection([('by_name', 'By Names'), ('by_count', 'By Count')], 'Select  By'),
        'work_type': fields.selection([('tea', 'Tea'), ('rubber', 'Rubber'), ('sundry', 'Sundry')], 'Work Type'),
        'total_workers': fields.integer('Total Workers'),
        'selected_workers_line_ids': fields.one2many('selected.workers.line', 'worker_id', 'Workers', ondelete="cascade"),
    }

bpl_work_offer()

class selected_workers_line_ids(osv.osv):
    _name = 'selected.workers.line'
    _description = 'lunch order line'
    _columns = {
        'worker_id':fields.many2one('bpl.worker', 'Worker', help='Worker'),
        'is_selected': fields.boolean('Select', help="Selected or not"),
        }

selected_workers_line_ids()

my error is like this

2013-03-21 06:31:50,137 7539 ERROR bpl openerp.addons.base.ir.ir_ui_view: <string>:2:0:ERROR:RELAXNGV:RELAXNG_ERR_EXTRACONTENT: Element form has extra content: sheet
2013-03-21 06:31:50,164 7539 ERROR bpl openerp.tools.convert: Parse error in /home/priyan/Software/openerp-7.0-20130309-002120/openerp/addons/bpl/bpl_view.xml:276: 
<record model="ir.ui.view" id="bpl_work_offer_form">
            <field name="name">bpl.work.offer.form</field>
            <field name="model">bpl.work.offer</field>
            <field name="arch" type="xml">
                <form string="bpl_work_offer">
........
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/osv/orm.py", line 1544, in _validate
    raise except_orm('ValidateError', '\n'.join(error_msgs))
except_orm: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')
2013-03-21 06:31:50,185 7539 INFO bpl werkzeug: 127.0.0.1 - - [21/Mar/2013 06:31:50] "POST /web/session/authenticate HTTP/1.1" 200 -

ERROR occur when going to save.please check where is the issue with my mapping with tables

Traceback (most recent call last):
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/sql_db.py", line 226, in execute
    res = self._obj.execute(query, params)
IntegrityError: insert or update on table "selected_workers_line" violates foreign key constraint "selected_workers_line_worker_id_fkey"
DETAIL:  Key (worker_id)=(1) is not present in table "bpl_worker".

2013-03-21 07:17:25,125 8275 ERROR bpl openerp.netsvc: Integrity Error
The operation cannot be completed, probably due to the following:
- deletion: you may be trying to delete a record while other records still reference it
- creation/update: a mandatory field is not correctly set
2
Shelton
On 3/21/13, 4:06 AM

In openerp 7 the form starts with

<form string="Invoice" version="7.0">

Also refer the views in other modules.For each field a separate group is not needed.

thanks Shelton..u saved my day

priyankahdp
on 3/21/13, 4:18 AM

there is no name field in 'selected.workers.line'. If you wish not to use it use 'rec_name'

Shelton
on 3/21/13, 4:36 AM

About This Community

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

Question tools

0 follower(s)

Stats

Asked: 3/21/13, 3:38 AM
Seen: 2343 times
Last updated: 3/16/15, 8:10 AM