Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

Odoo8 Xpath ParseError: "ValidateError

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
xpathodoo8.0
5 Réponses
5564 Vues
Avatar
Jihane Hemicha

Hello, i'm using odoo8, and need to inherit "view_partner_form" and add a page inside notebook tag:
My record in xml view is : 

<record model="ir.ui.view" id="respartner_viewform">
<field name="name">respartner_form</field>
<field name="model">respartner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
         <form><xpath expr="/form/sheet/notebook" position="inside">
            <page string="Management System">
                 <group>
                     <field name="partnerform_ids" widget="one2many_list">
                         <tree >
                             <field name="id_type"/>
                             <field name="id_product"/>
                             <field name="valdate"/>
                        </tree>
                    </field>
                 </group>
 </page>
</xpath>
</form>
 </field>
</record>


And my module is : 

class respartner(models.Model):

    _name='respartner'

    _inherit='res.partner'

     partnerform_ids=fields.One2many('partnerform','id_partner',string="respartners")


But i get the following error : 

File "C:\Program Files (x86)\Odoo 8.0-20160715\server\openerp\models.py", line 1271, in _validate_fields raise ValidationError('\n'.join(errors))ParseError: "ValidateErrorField(s) `arch` failed against a constraint: Invalid view definition" while parsing file:///C:/Program Files (x86)/Odoo 8.0-20160715/server/openerp/addons/mgmsys/mgmsys.xml:28, near<record model="ir.ui.view" id="respartner_viewform"><field name="name">respartner_form</field><field name="model">respartner</field><field name="inherit_id" ref="base.view_partner_form"/> <field name="arch" type="xml"> <form><xpath expr="/form/sheet/notebook" position="inside"> <page string="Management System"> <group> <field name="partnerform_ids" widget="one2many_list"> <tree> <field name="id_type"/> <field name="id_product"/> <field name="reqdate"/> <field name="recdate"/> <field name="valdate"/> </tree> </field> </group> </page></xpath> </form> </field></record>


It must be a problem in xpath tag, but still can't figure it out ! 

1
Avatar
Ignorer
Avatar
Jihane Hemicha
Auteur Meilleure réponse
hank you ! the problems was in using the right module ! my mistake( beginner )Xpath does work ! .
<record model="ir.ui.view" id="respartner_viewform">
<field name="name">respartner_form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/> <field name="arch" type="xml">
<xpath expr="//notebook" position="inside">
<page string="sys">
 <group>
 <field name="partnerform_ids" widget="one2many_list">
<tree editable="bottom" >
 <field name="id_type"/>
 <field name="id_product"/>
 <field name="valdate"/>
</tree> </field>
 </group>
 </page>
</xpath>
</field></record>
0
Avatar
Ignorer
Avatar
legland
Meilleure réponse


0
Avatar
Ignorer
Avatar
Sehrish
Meilleure réponse

In Odoo/OpenERP we can inherit or use existing modules object/class/model and views. We can also inherit single field of existing modules. The question is why we need such inheritance.

The purpose of inheritance or why we need inheritance is given below:

  1. To change attributes of some fields which exists on existing/custom model (e.g. making fields readonly,invisible)

  2. To add/modify/delete old or new fields in existing/custom model (e.g. Product, Sales, HR, Fleet Management, Attendance modules model etc)

  3. We can also add buttons in already existing/custom model (form and tree) view by using inheritance

To get complete guidance about xpath and inheritance in odoo read: http://learnopenerp.blogspot.com/2018/01/inheritance-in-models-and-views.html

0
Avatar
Ignorer
Sehrish

Inheritance in Models and Views

http://learnopenerp.blogspot.com/2018/01/inheritance-in-models-and-views.html

Avatar
Bharat Parmar (bhp)
Meilleure réponse

This is not a proper way to inherit views.

try like this,

your_module.py

class respartner(models.Model):
     _inherit='res.partner'
     partnerform_ids=fields.One2many('partnerform','id_partner',string="respartners")

your_view.xml

<record id="respartner_inherit_viewform" model="ir.ui.view">			
    <field name="name">respartner_inherit_form</field>
    <field name="model">res.partner</field>
    <field name="inherit_id" ref="base.view_partner_form"/>
    <field name="arch" type="xml">
        <notebook position="inside">
            <page string="Management System">
                <group>
                    <field name="partnerform_ids" widget="one2many_list">
                        <tree>
                            <field name="id_type"/>
                            <field name="id_product"/>
                            <field name="valdate"/>
                        </tree>
                    </field>
                </group>
            </page>
        </notebook>
    </field>
</record>

 I hope this will help you.

0
Avatar
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
xpath problems with string Résolu
xpath odoo8.0
Avatar
Avatar
Avatar
3
juin 16
9805
how to implement joint piece in odoo 8 in one view
odoo8.0
Avatar
0
avr. 24
2635
what is the reason behind extra move? in stock
odoo8.0
Avatar
Avatar
Avatar
Avatar
4
nov. 23
6805
How to solve fields.function issue in odoo 8
odoo8.0
Avatar
0
oct. 23
2643
how to restrict create and delete access in one2many field tree view
odoo8.0
Avatar
0
déc. 22
3353
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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