Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

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

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
developmentmodules
2 Răspunsuri
6648 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Nilmar Shereef

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

Andrea Mazzacani
Autor

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
Autor

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
Autor

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
Autor

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
Autor

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 :)

Imagine profil
Nilmar Shereef
Cel mai bun răspuns

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
Imagine profil
Abandonează
Imagine profil
Andrea Mazzacani
Autor Cel mai bun răspuns

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
Imagine profil
Abandonează
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!

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Odoo 18 - Custom Module - Error on nested class view Rezolvat
development modules
Imagine profil
Imagine profil
Imagine profil
2
iul. 25
3744
How to upgrade modules in a specific file?
development modules
Imagine profil
0
mar. 24
2546
Error: External ID not found in the system Rezolvat
development modules
Imagine profil
Imagine profil
Imagine profil
3
feb. 16
17535
How do I apply changes to and test the TDD Developer Workflow ? Rezolvat
development modules
Imagine profil
Imagine profil
1
mar. 15
5166
How to prevent some modules from loading
development modules
Imagine profil
Imagine profil
Imagine profil
Imagine profil
3
mar. 15
10432
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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