Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Trying to add fields to sale order form view give "AssertionError: Element openerp has extra content"

Subscribe

Get notified when there's activity on this post

This question has been flagged
developmentmodules
2 Replies
6591 Views
Avatar
Andrea Mazzacani

Hi all, I'm new in odoo development and i can't see the error in my code.

stack trace:

2016-11-03 07:26:07,201 1468 INFO BOMBO openerp.tools.convert: file:///C:/ODOO/server/openerp/addons/bomboneria_carla_new/views/bomboneria_sale_order.xml:3:0:ERROR:RELAXNGV:RELAXNG_ERR_EXTRACONTENT: Element openerp has extra content: 
data2016-11-03 07:26:07,203 1468 ERROR BOMBO openerp.modules.registry: Failed to load registryTraceback (most recent call last):
File "C:\ODOO\server\.\openerp\modules\registry.py", line 385, in new
File "C:\ODOO\server\.\openerp\modules\loading.py", line 338, in load_modules
File "C:\ODOO\server\.\openerp\modules\loading.py", line 237, in load_marked_modules
File "C:\ODOO\server\.\openerp\modules\loading.py", line 156, in load_module_graph
File "C:\ODOO\server\.\openerp\modules\loading.py", line 98, in _load_data
File "C:\ODOO\server\.\openerp\tools\convert.py", line 852, in convert_file
File "C:\ODOO\server\.\openerp\tools\convert.py", line 926, in convert_xml_import
File "lxml.etree.pyx", line 3313, in lxml.etree._Validator.assert_ (src\lxml\lxml.etree.c:159862)
AssertionError: Element openerp has extra content: data, line 3



My files:

bomboneria_sale_order.xml

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="sale_order_form_view_inherit" model="ir.ui.view" >
<field name="name">sale.order.form.inherit</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml" >
<!-- <xpath expr="//field[@name='template_id']" position="after">
<field name="activity_scope"/> </xpath> -->
</field>
</record>
</data>
</openerp>

bomboneria_sale_order.py

# -*- coding: utf-8 -*-# Copyright 2016 Omnia Sistemi# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import api, fields, models

class bomboneria_sale_order(models.Model):
     _inherit = 'sale.order'
_description = 'Ordine Bomboneria'
 _name = 'bomboneria.sale.order'

ceremony_type = fields.Selection([ ('1','Battesimo'), ('2','Crescita'), ('3','Comunione'), ('4','Matrimonio'), ('5','Festa'), ('6','Altro'), ], string = "Tipo di Evento", help = "Tipo di Evento")
down_payment = fields.Char(string = "Acconto", help = "Acconto")
delivery_extimated_date = fields.Date(string = "Data prevista Consegna", help = "Data prevista Consegna")

0
Avatar
Discard
Nilmar Shereef

Could you please provide your openerp file? Then I can test it

Andrea Mazzacani
Author

Added openerp in my answer :)

Nilmar Shereef

class bomboneria_sale_order(models.Model):

_inherit = 'sale.order'

_description = 'Ordine Bomboneria'

_name = 'bomboneria.sale.order'

Use '_name" for model naming

Andrea Mazzacani
Author

Ah sorry that was a copy/paste error. I used _name in .py file. Odoo.com don't let me modify original post

Nilmar Shereef

I constructed a module with your fields in Sale Order.

it works fine. Could you please try omitting _name , _description from py file

Andrea Mazzacani
Author

Same error :| . I tried installing module without view and works fine. All fields are added in sale.order. After that I tried to install module with xml file with tag <openerp> and <data> and work fine. When i add the <record> tag i get error. It is odoo 9.0 on a windows server machine.

Andrea Mazzacani
Author

Thank you for all your help. I tried removing _name and _description and still install it. I always get the problem when i try to inherit the sale.order form view. Have you used my xml code? I can't comment your reply, more karma needed.

Nilmar Shereef

Please have a look to my answer, I will attach my xml inside my answer

Andrea Mazzacani
Author

It works! Thank You! You just made my day! but i still can't notice why mine is wrong... any ideas?

Nilmar Shereef

I think your xml id may raise the issue. Anyway thanks :)

Avatar
Nilmar Shereef
Best Answer

Hi Andrea Mazzacani,
    I did the module with your fields, Please avoid _name, _description from your code. Also you wrote 'name' instead of _name. That may be issue. So please try  by deleting existing  one. Also ensure your mentioned fields are present in sale_order_form.


XML file:


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

<openerp>   

    <data>       

        <record id="sale_order_form_view_inher_c5" model="ir.ui.view" >            

        <field name="name">sale.order.oca.test3</field>           

        <field name="model">sale.order</field>           

        <field name="inherit_id" ref="sale.view_order_form"/>           

        <field name="arch" type="xml" >               

            <xpath expr="//field[@name='partner_id']" position="after">                       

                <field name="ceremony_type"/>                       

                <field name="down_payment"/>                       

                <field name="delivery_extimated_date"/>               

            </xpath>           

           </field>       

        </record>   

    </data>

</openerp>

5
Avatar
Discard
Avatar
Andrea Mazzacani
Author Best Answer

Hi Nilmar Shereef,

Thank you but I just tried your solution and  give the same result.  :/ I already did something similar in another module for res.partner without problems. Let's hope someone notice what's wrong.  :)

__openerp__.py

# -*- coding: utf-8 -*-
{
'name': 'Bomboneria Carla',
'description': """
Personalizzazioni Bomboneria Carla""",
'version': '10.0.1.0.0',
'license': 'AGPL-3',
 'author': 'Omnia Sistemi',
'depends': [
 'base',
 'sale',
 ],
 'data': [
 'views/bomboneria_sale_order.xml',
 ],
}
0
Avatar
Discard
Nilmar Shereef

Cleared this question. See the comments on the question.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Odoo 18 - Custom Module - Error on nested class view Solved
development modules
Avatar
Avatar
Avatar
2
Jul 25
3656
How to upgrade modules in a specific file?
development modules
Avatar
0
Mar 24
2493
Error: External ID not found in the system Solved
development modules
Avatar
Avatar
Avatar
3
Feb 16
17462
How do I apply changes to and test the TDD Developer Workflow ? Solved
development modules
Avatar
Avatar
1
Mar 15
5119
How to prevent some modules from loading
development modules
Avatar
Avatar
Avatar
Avatar
3
Mar 15
10360
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now