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

Odoo 9.0 Website tutorial - Selling Courses

Subscribe

Get notified when there's activity on this post

This question has been flagged
tutorialwebsite
2 Replies
6372 Views
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
Discard
Avatar
ESB86043668 Blinkit Ingeniería Informática S.L.
Best Answer

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
Discard
Avatar
Mukarram Pasha
Best Answer

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
Discard
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
Why is using WebP images beneficial for your Odoo website? Solved
tutorial website
Avatar
Avatar
2
Dec 24
2073
I do not get described result when work in "Building a Website" tutorial
tutorial website
Avatar
0
Sep 21
2812
How do I remove the numbers from the slugs in my blog and blogpost? Solved
website
Avatar
Avatar
Avatar
Avatar
3
Sep 25
2505
Login Website Solved
website
Avatar
3
Oct 25
149265
500 Server Error after upgrading from 18.0 to 18.4 Odoo Online
website
Avatar
Avatar
1
Sep 25
1839
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