Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • E-learning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Sociale media-marketing
    • E-mailmarketing
    • Sms-marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Horeca & Hospitality
    • Bar en café
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van mede-eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brouwerij
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Diensten
    • Klusjesman
    • IT-hardware & ondersteuning
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Alle bedrijfstakken bekijken
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijsprogramma
    • Scale Up! Business Game
    • Odoo bezoeken
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Partner worden
    • Diensten voor partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

Error while creating module

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
2 Antwoorden
7657 Weergaven
Avatar
cn

I get an error while trying to create my own module.
The error appears when I try to install the module (from a tutorial). I think it is to do with the xml file test.xml. But I just cannot see the error in it. Please help. I am using OpenERP version 6.1.1 (I cannot upgrade for now). Thank you. Here is the error output:

Client Traceback (most recent call last):
File "/opt/OpenObject/openerp-6.1-1/openerp/addons/web/common/http.py", line 180, in dispatch
response["result"] = method(controller, self, *self.params)
File "/opt/OpenObject/openerp-6.1-1/openerp/addons/web/controllers/main.py", line 498, in authenticate
req.session.authenticate(db, login, password, env)
File "/opt/OpenObject/openerp-6.1-1/openerp/addons/web/common/session.py", line 73, in authenticate
uid = self.proxy('common').authenticate(db, login, password, env)
File "/opt/OpenObject/openerp-6.1-1/openerp/addons/web/common/openerplib/main.py", line 117, in proxy
result = self.connector.send(self.service_name, method, *args)
File "/opt/OpenObject/openerp-6.1-1/openerp/addons/web/common/http.py", line 608, in send
raise xmlrpclib.Fault(openerp.tools.exception_to_unicode(e), formatted_info)


Server Traceback (most recent call last):
File "/opt/OpenObject/openerp-6.1-1/openerp/addons/web/common/http.py", line 593, in send
return openerp.netsvc.dispatch_rpc(service_name, method, args)
File "/opt/OpenObject/openerp-6.1-1/openerp/netsvc.py", line 360, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/opt/OpenObject/openerp-6.1-1/openerp/service/web_services.py", line 397, in dispatch
return fn(
params)
File "/opt/OpenObject/openerp-6.1-1/openerp/service/web_services.py", line 408, in exp_authenticate
res_users = pooler.get_pool(db).get('res.users')
File "/opt/OpenObject/openerp-6.1-1/openerp/pooler.py", line 50, in get_pool
return get_db_and_pool(db_name, force_demo, status, update_module)[1]
File "/opt/OpenObject/openerp-6.1-1/openerp/pooler.py", line 33, in get_db_and_pool
registry = RegistryManager.get(db_name, force_demo, status, update_module, pooljobs)
File "/opt/OpenObject/openerp-6.1-1/openerp/modules/registry.py", line 180, in get
update_module, pooljobs)
File "/opt/OpenObject/openerp-6.1-1/openerp/modules/registry.py", line 202, in new
openerp.modules.load_modules(registry.db, force_demo, status, update_module)
File "/opt/OpenObject/openerp-6.1-1/openerp/modules/loading.py", line 334, in load_modules
processed = load_marked_modules(cr, graph, states_to_load, force, status, report, loaded_modules)
File "/opt/OpenObject/openerp-6.1-1/openerp/modules/loading.py", line 253, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules)
File "/opt/OpenObject/openerp-6.1-1/openerp/modules/loading.py", line 193, in load_module_graph
load_data(module_name, idref, mode)
File "/opt/OpenObject/openerp-6.1-1/openerp/modules/loading.py", line 92, in <lambda>
load_data = lambda *args: _load_data(cr, *args, kind='data')
File "/opt/OpenObject/openerp-6.1-1/openerp/modules/loading.py", line 138, in _load_data
tools.convert_xml_import(cr, module_name, fp, idref, mode, noupdate, report)
File "/opt/OpenObject/openerp-6.1-1/openerp/tools/convert.py", line 988, in convert_xml_import
relaxng.assert_(doc)
File "lxml.etree.pyx", line 3016, in lxml.etree._Validator.assert_ (src/lxml/lxml.etree.c:125483)
AssertionError: Did not expect element templates there, line 2

---------------------------------------------------------------------------

Below are the contents of my files



addons/web_example/__init__.py:

#!/usr/bin/python

++++++++++++++++++++++++++++++++++++++++++++++
addons/web_example/__openerp__.py:

{
'name': "Web Example",
'category': "Hidden",
'description':"A basic web example module",
'depends': ['web'],
'data':["static/xml/test.xml",'web_example.xml'],
'js': ["static/openerp/first_module.js"],
}

++++++++++++++++++++++++++++++++++++++++++++++
addons/web_example/web_example.xml:

<?xml version="1.0" encoding="utf-8" ?>
<openerp>
<data>
<record model="ir.actions.act_window" id="action_client_example">
<field name="name">web_example_class</field>
<field name="res_model">web_example_class</field>
<!--<field name="tag">example.action</field>-->
</record>

<record model="ir.ui.view" id="test_form_view">
<field name="name">test.form</field>
<field name="model">web_example_class</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="test">
<field name="numero" widget="test" />
</form>
</field>
</record>
<menuitem name="WEB EXAMPLE" action="action_client_example" id="menu_client_example"/>
</data>
</openerp>

++++++++++++++++++++++++++++++++++++++++++++++

addons/web_example/static/openerp/first_module.js:

alert("Before function");
openerp.web_example = function(openerp){
openerp.web.form.widgets.add('test','openerp.web.form.test');
openerp.web.form.test = openerp.web.form.FieldChar.extend(
{
template:'test_button',
init: function(){
this._super.apply(this,arguments);
this._start = null;
console.log('INIT');
},
start: function(){
console.log('START');
$('button#bstart').click(this.myfunction);
},
myfunction:function(){
alert("moja funkcja");
console.log("From function");
}
}
)
};


alert("After fnction");

++++++++++++++++++++++++++++++++++++++++++++++
addons/web_example/static/xml/test.xml:

<?xml version="1.0" encoding="utf-8" ?>
<templates>
<div t-name="test_button" t-attf-class="base #{cls}" class="oe_web_example">
<p>
<button name="dosomething" type="button" id="bstart">start</button>
</p>
</div>
</templates>


0
Avatar
Annuleer
Avatar
Sudhir Arya (ERP Harbor Consulting Services)
Beste antwoord

Files that contains qweb templates are placed under qweb in __openerp__.py file.

Remove test.xml file from data and put it in qweb in __openerp__.py like this:

'qweb': ['static/xml/test.xml'],

Hope this will solve your problem.

5
Avatar
Annuleer
cn
Auteur

Hi Sudhir. I did as you said and the error message disappeared. Normally this module should have displayed a button, but it doesn't.When I install/update the module, I get the alert messages "Before function" and "After function", but no button is displayed. Would you know what is missing? Thanks once more.

Ankit H Gandhi(AHG)

Thanks @sudhir arya This code is very help for me

Avatar
Hadooc, Borni DHIFI
Beste antwoord

Hi,

https://accounts.openerp.com/forum/Help-1/question/16336#16338

can help you

1
Avatar
Annuleer
cn
Auteur

Hi Borni. Thanks for the link. I am on it right now reading one of the tutorials.

Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Partner worden
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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