Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

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

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

Odoo 9.0 Website tutorial - Selling Courses

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
tutorialwebsite
2 Risposte
6411 Visualizzazioni
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
Abbandona
Avatar
ESB86043668 Blinkit Ingeniería Informática S.L.
Risposta migliore

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
Abbandona
Avatar
Mukarram Pasha
Risposta migliore

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
Abbandona
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Post correlati Risposte Visualizzazioni Attività
Why is using WebP images beneficial for your Odoo website? Risolto
tutorial website
Avatar
Avatar
2
dic 24
2111
I do not get described result when work in "Building a Website" tutorial
tutorial website
Avatar
0
set 21
2831
How do I remove the numbers from the slugs in my blog and blogpost? Risolto
website
Avatar
Avatar
Avatar
Avatar
3
set 25
2545
Login Website Risolto
website
Avatar
3
ott 25
149265
500 Server Error after upgrading from 18.0 to 18.4 Odoo Online
website
Avatar
Avatar
1
set 25
1911
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة 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 è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

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