Ir al contenido
Odoo Menú
  • Inicia sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de propiedades
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

Error while creating module

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
2 Respuestas
7641 Vistas
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
Descartar
Avatar
Sudhir Arya (ERP Harbor Consulting Services)
Mejor respuesta

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
Descartar
cn
Autor

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
Mejor respuesta

Hi,

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

can help you

1
Avatar
Descartar
cn
Autor

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

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

Sitio web hecho con

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