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

Odoo 9.0 Website tutorial - Selling Courses

S'inscrire

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

Cette question a été signalée
tutorialwebsite
2 Réponses
6399 Vues
Avatar
Pieter Paulussen

 I have a question about the 'Selling Courses' part of the Odoo tutorial.

This is the output of the server when I want to open the website. Apparantly there is a problem with the parsing of the xml file. But I think the cause has to be that the "website_sale.categ_others" is just not recognised. Or perhaps it has something to do with the depends import in the __openerp__.py file.

At this point I've gone from copy/pasting every change in the code to my files, but this has shown no effect. 

Apparantly I'm missing something here. I've included all code that I currently have at the bottom of this question.

Server output file:

2016-04-06 14:41:00,101 8468 INFO ? openerp: OpenERP version 9.0c
2016-04-06 14:41:00,101 8468 INFO ? openerp: addons paths: ['/home/pieterpaulussen/.local/share/Odoo/addons/9.0', u'/odoo/odoo-server/openerp/addons', u'/odoo/odoo-server/addons']
2016-04-06 14:41:00,101 8468 INFO ? openerp: database: default@default:default
2016-04-06 14:41:00,242 8468 INFO ? openerp.service.server: HTTP service (werkzeug) running on 0.0.0.0:8069
2016-04-06 14:41:03,120 8468 INFO ? openerp.addons.bus.models.bus: Bus.loop listen imbus on db postgres
2016-04-06 14:41:03,554 8468 INFO ? openerp.addons.report.models.report: Will use the Wkhtmltopdf binary at /usr/local/bin/wkhtmltopdf
2016-04-06 14:41:03,746 8468 INFO ? openerp.http: HTTP Configuring static files
2016-04-06 14:41:03,787 8468 INFO testdatabase1 openerp.modules.loading: loading 1 modules...
2016-04-06 14:41:03,810 8468 INFO testdatabase1 openerp.modules.loading: 1 modules loaded in 0.02s, 0 queries
2016-04-06 14:41:03,858 8468 INFO testdatabase1 openerp.modules.loading: loading 53 modules...
2016-04-06 14:41:03,865 8468 INFO testdatabase1 passlib.registry: registered crypt handler 'pbkdf2_sha512': <class 'passlib.handlers.pbkdf2.pbkdf2_sha512'>
2016-04-06 14:41:03,866 8468 INFO testdatabase1 passlib.registry: registered crypt handler 'md5_crypt': <class 'passlib.handlers.md5_crypt.md5_crypt'>
2016-04-06 14:41:04,759 8468 INFO testdatabase1 openerp.modules.module: module academy: creating or updating database tables
2016-04-06 14:41:04,880 8468 INFO testdatabase1 openerp.modules.loading: loading academy/security/ir.model.access.csv
2016-04-06 14:41:04,910 8468 INFO testdatabase1 openerp.modules.loading: loading academy/views/views.xml
2016-04-06 14:41:05,022 8468 INFO testdatabase1 openerp.modules.loading: loading academy/views/templates.xml
2016-04-06 14:41:05,049 8468 INFO testdatabase1 openerp.modules.loading: loading academy/data.xml
2016-04-06 14:41:05,054 8468 ERROR testdatabase1 openerp.modules.registry: Failed to load registry
Traceback (most recent call last):
File "/odoo/odoo-server/openerp/modules/registry.py", line 386, in new
openerp.modules.load_modules(registry._db, force_demo, status, update_module)
File "/odoo/odoo-server/openerp/modules/loading.py", line 334, in load_modules
force, status, report, loaded_modules, update_module)
File "/odoo/odoo-server/openerp/modules/loading.py", line 237, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
File "/odoo/odoo-server/openerp/modules/loading.py", line 156, in load_module_graph
_load_data(cr, module_name, idref, mode, kind='data')
File "/odoo/odoo-server/openerp/modules/loading.py", line 98, in _load_data
tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
File "/odoo/odoo-server/openerp/tools/convert.py", line 851, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
File "/odoo/odoo-server/openerp/tools/convert.py", line 938, in convert_xml_import
obj.parse(doc.getroot(), mode=mode)
File "/odoo/odoo-server/openerp/tools/convert.py", line 801, in parse
self.parse(rec, mode)
File "/odoo/odoo-server/openerp/tools/convert.py", line 804, in parse
self._tags[rec.tag](self.cr, rec, de, mode=mode)
File "/odoo/odoo-server/openerp/tools/convert.py", line 700, in _tag_record
f_val = self.id_get(cr, f_ref)
File "/odoo/odoo-server/openerp/tools/convert.py", line 782, in id_get
res = self.model_id_get(cr, id_str, raise_if_not_found)
File "/odoo/odoo-server/openerp/tools/convert.py", line 793, in model_id_get
raise_if_not_found=raise_if_not_found)
File "/odoo/odoo-server/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/odoo/odoo-server/openerp/addons/base/ir/ir_model.py", line 982, in xmlid_to_res_model_res_id
return self.xmlid_lookup(cr, uid, xmlid)[1:3]
File "/odoo/odoo-server/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "<string>", line 2, in xmlid_lookup
File "/odoo/odoo-server/openerp/tools/cache.py", line 85, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/odoo/odoo-server/openerp/addons/base/ir/ir_model.py", line 972, in xmlid_lookup
raise ValueError('External ID not found in the system: %s' % (xmlid))
ParseError: "External ID not found in the system: website_sale.categ_others" while parsing /odoo/odoo-server/addons/academy/data.xml:4, near
<record model="product.public.category" id="category_courses">
<field name="name">Courses</field>
<field name="parent_id" ref="website_sale.categ_others"/>
</record>
2016-04-06 14:41:05,198 8468 INFO testdatabase1 werkzeug: 127.0.0.1 - - [06/Apr/2016 14:41:05] "GET / HTTP/1.1" 500 -
2016-04-06 14:41:05,230 8468 ERROR testdatabase1 werkzeug: Error on request:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 177, in run_wsgi
execute(self.server.app)
File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 165, in execute
application_iter = app(environ, start_response)
File "/odoo/odoo-server/openerp/service/server.py", line 245, in app
return self.app(e, s)
File "/odoo/odoo-server/openerp/service/wsgi_server.py", line 184, in application
return application_unproxied(environ, start_response)
File "/odoo/odoo-server/openerp/service/wsgi_server.py", line 170, in application_unproxied
result = handler(environ, start_response)
File "/odoo/odoo-server/openerp/http.py", line 1488, in __call__
return self.dispatch(environ, start_response)
File "/odoo/odoo-server/openerp/http.py", line 1462, in __call__
return self.app(environ, start_wrapped)
File "/usr/lib/python2.7/dist-packages/werkzeug/wsgi.py", line 579, in __call__
return self.app(environ, start_response)
File "/odoo/odoo-server/openerp/http.py", line 1637, in dispatch
ir_http = request.registry['ir.http']
File "/odoo/odoo-server/openerp/http.py", line 360, in registry
return openerp.modules.registry.RegistryManager.get(self.db) if self.db else None
File "/odoo/odoo-server/openerp/modules/registry.py", line 355, in get
update_module)
File "/odoo/odoo-server/openerp/modules/registry.py", line 386, in new
openerp.modules.load_modules(registry._db, force_demo, status, update_module)
File "/odoo/odoo-server/openerp/modules/loading.py", line 334, in load_modules
force, status, report, loaded_modules, update_module)
File "/odoo/odoo-server/openerp/modules/loading.py", line 237, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
File "/odoo/odoo-server/openerp/modules/loading.py", line 156, in load_module_graph
_load_data(cr, module_name, idref, mode, kind='data')
File "/odoo/odoo-server/openerp/modules/loading.py", line 98, in _load_data
tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
File "/odoo/odoo-server/openerp/tools/convert.py", line 851, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
File "/odoo/odoo-server/openerp/tools/convert.py", line 938, in convert_xml_import
obj.parse(doc.getroot(), mode=mode)
File "/odoo/odoo-server/openerp/tools/convert.py", line 801, in parse
self.parse(rec, mode)
File "/odoo/odoo-server/openerp/tools/convert.py", line 804, in parse
self._tags[rec.tag](self.cr, rec, de, mode=mode)
File "/odoo/odoo-server/openerp/tools/convert.py", line 700, in _tag_record
f_val = self.id_get(cr, f_ref)
File "/odoo/odoo-server/openerp/tools/convert.py", line 782, in id_get
res = self.model_id_get(cr, id_str, raise_if_not_found)
File "/odoo/odoo-server/openerp/tools/convert.py", line 793, in model_id_get
raise_if_not_found=raise_if_not_found)
File "/odoo/odoo-server/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/odoo/odoo-server/openerp/addons/base/ir/ir_model.py", line 982, in xmlid_to_res_model_res_id
return self.xmlid_lookup(cr, uid, xmlid)[1:3]
File "/odoo/odoo-server/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "<string>", line 2, in xmlid_lookup
File "/odoo/odoo-server/openerp/tools/cache.py", line 85, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/odoo/odoo-server/openerp/addons/base/ir/ir_model.py", line 972, in xmlid_lookup
raise ValueError('External ID not found in the system: %s' % (xmlid))
ParseError: "External ID not found in the system: website_sale.categ_others" while parsing /odoo/odoo-server/addons/academy/data.xml:4, near
<record model="product.public.category" id="category_courses">
<field name="name">Courses</field>
<field name="parent_id" ref="website_sale.categ_others"/>
</record>
__openerp__.py:
...
'category': 'Tutorials',
'version': '0.1',
# any module necessary for this one to work correctly
'depends': ['base', 'mail', 'website_sale'],
# always loaded
'data': [
'security/ir.model.access.csv',
'views/views.xml',
'views/templates.xml',
'data.xml',
],
# only loaded in demonstration mode
'demo': [
'demo/demo.xml',
],
}


views.xml

<openerp>
<data>
<record id="action_academy_teachers" model="ir.actions.act_window">
<field name="name">Academy teachers</field>
<field name="res_model">academy.teachers</field>
</record>
<record id="academy_teacher_form" model="ir.ui.view">
<field name="name">Academy teachers: form</field>
<field name="model">academy.teachers</field>
<field name="arch" type="xml">
<form>
<sheet>
<label for="name"/>
<field name="name"/>
<label for="biography"/>
<field name="biography"/>
<field name="course_ids">
<tree string="Courses" editable="bottom">
<field name="name"/>
</tree>
</field>
</sheet>
</form>
</field>
</record>
<record id="action_academy_courses" model="ir.actions.act_window">
<field name="name">Academy courses</field>
<field name="res_model">academy.courses</field>
</record>
<record id="academy_course_search" model="ir.ui.view">
<field name="name">Academy courses: search</field>
<field name="model">academy.courses</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="teacher_id"/>
</search>
</field>
</record>
<record id="academy_course_list" model="ir.ui.view">
<field name="name">Academy courses: list</field>
<field name="model">academy.courses</field>
<field name="arch" type="xml">
<tree string="Courses">
<field name="name"/>
<field name="teacher_id"/>
</tree>
</field>
</record>
<record id="academy_course_form" model="ir.ui.view">
<field name="name">Academy courses: form</field>
<field name="model">academy.courses</field>
<field name="arch" type="xml">
<form>
<sheet>
<label for="name"/>
<field name="name"/>
<label for="teacher_id"/>
<field name="teacher_id"/>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<menuitem sequence="0" id="menu_academy" name="Academy"/>
<menuitem id="menu_academy_content" parent="menu_academy" name="Academy Content"/>
<menuitem id="menu_academy_content_teachers" parent="menu_academy_content" action="action_academy_teachers"/>
</data>
</openerp>


models.py

# -*- coding: utf-8 -*-
from openerp import models, fields, api
class Teachers(models.Model):
_name = 'academy.teachers'
name = fields.Char()
biography = fields.Html()
course_ids = fields.One2many(
'product.template', 'teacher_id', string="Courses")
class Courses(models.Model):
_inherit = 'product.template'
teacher_id = fields.Many2one('academy.teachers', string="Teacher")


data.xml

<openerp>
<data>
<record model="product.public.category" id="category_courses">
<field name="name">Courses</field>
<field name="parent_id" ref="website_sale.categ_others"/>
</record>
</data>
</openerp>


demo.xml

<openerp>
<data>
<record id="padilla" model="academy.teachers">
<field name="name">Diane Padilla</field>
</record>
<record id="carrol" model="academy.teachers">
<field name="name">Jody Carrol</field>
</record>
<record id="vaughn" model="academy.teachers">
<field name="name">Lester Vaughn</field>
</record>
<record id="course0" model="product.template">
<field name="name">Course 0</field>
<field name="teacher_id" ref="padilla"/>
<field name="public_categ_ids" eval="[(4, ref('academy.category_courses'), False)]"/>
<field name="website_published">True</field>
<field name="list_price" type="float">0</field>
<field name="type">service</field>
</record>
<record id="course1" model="product.template">
<field name="name">Course 1</field>
<field name="teacher_id" ref="padilla"/>
<field name="public_categ_ids" eval="[(4, ref('academy.category_courses'), False)]"/>
<field name="website_published">True</field>
<field name="list_price" type="float">0</field>
<field name="type">service</field>
</record>
<record id="course2" model="product.template">
<field name="name">Course 2</field>
<field name="teacher_id" ref="vaughn"/>
<field name="public_categ_ids" eval="[(4, ref('academy.category_courses'), False)]"/>
<field name="website_published">True</field>
<field name="list_price" type="float">0</field>
<field name="type">service</field>
</record>
</data>
</openerp>


1
Avatar
Ignorer
Avatar
ESB86043668 Blinkit Ingeniería Informática S.L.
Meilleure réponse

The solution given by Mukarram Pasha is valid also for Odoo 10 with the following modifications:

__manifest__.py (works without module 'base') 

...
# any module necessary for this one to work correctly  
    'depends': ['website_sale'], 
...

data.xml (initial tag changed to odoo in v10)

<odoo><data>
<record model="product.public.category" id="category_courses">
    <field name="name">Courses</field>
    <field name="parent_id" />
  </record>
</data></odoo>

 Thanks you Mukarram.

0
Avatar
Ignorer
Avatar
Mukarram Pasha
Meilleure réponse

Make changes to your following files:

In __openerp__.py file:

remove 'mail' dependency since 'website_sale' already has its own mail module.

...
    'category': 'Tutorials',
    'version': '0.1',
 
    # any module necessary for this one to work correctly
    'depends': ['base', 'website_sale'],

    # always loaded
    'data': [
        'security/ir.model.access.csv',
        'views/views.xml', '
        'views/templates.xml',
        'data.xml',
    ],

    # only loaded in demonstration mode
    'demo': [
        'demo/demo.xml',
    ],
}

In data.xml file:

remove ref="website_sale.categ_others" 

<openerp>
     <data>
         <record model="product.public.category" id="category_courses">
             <field name="name">Courses</field>
             <field name="parent_id"/>
         </record>
    </data>
</openerp>

In views.xml file remove all views of academy.course since it is now inherited from 'product.template'.


I hope this will help. worked for me.

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é
Why is using WebP images beneficial for your Odoo website? Résolu
tutorial website
Avatar
Avatar
2
déc. 24
2099
I do not get described result when work in "Building a Website" tutorial
tutorial website
Avatar
0
sept. 21
2829
How do I remove the numbers from the slugs in my blog and blogpost? Résolu
website
Avatar
Avatar
Avatar
Avatar
3
sept. 25
2527
Login Website Résolu
website
Avatar
3
oct. 25
149265
500 Server Error after upgrading from 18.0 to 18.4 Odoo Online
website
Avatar
Avatar
1
sept. 25
1895
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