Ir al contenido
Odoo Menú
  • Iniciar 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 bienes inmuebles
    • 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

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
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

TypeError: 'NoneType' object is not subscriptable

Suscribirse

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

Se marcó esta pregunta
5 Respuestas
43606 Vistas
Avatar
SSS

Hello,

I am trying to display form fields in report but following error occur.

Error:​

odoo.addons.base.ir.ir_qweb.qweb.QWebException: 'NoneType' object is not subscriptable
Traceback (most recent call last):
File "/usr/local/sampada/eclipse-workspace/odoo11/odoo/addons/base/ir/ir_qweb/qweb.py", line 343, in _compiled_fn
return compiled(self, append, new, options, log)
File "<template>", line 1, in template_1018_120
File "<template>", line 2, in body_call_content_119
File "<template>", line 3, in body_call_content_118
TypeError: 'NoneType' object is not subscriptable

Error to render compiling AST
TypeError: 'NoneType' object is not subscriptable
Template: 1018
Path: /templates/t/t/t/div/t[1]
Node: <t t-if="data['form_date']"><span t-esc="data['from_date']">From Date:</span></t>​

.py file

from odoo import models, fields, api

class DataForReport(models.AbstractModel):

_name = 'report.survey_client.pl_report_template'#for report name must be 'report.module_name.template_id_of_report'

@api.multi
def get_Form_data(self, docid, data):
model_data = data['form']
return self.report_calculations(model_data)


@api.model
def report_calculations(self,data):

from_date = data['from_date']
to_date = data['to_date']
product_id = data['product_id']


template file:

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="pl_report_template_struct">
<t t-call="web.html_container">
<t t-call="web.external_layout">
<div class="page">

<center><span><strong><h2>Product Profit Loss</h2></strong></span></center>

<t t-if="data['form_date']"><span t-esc="data['from_date']">From Date:</span></t>
<t t-if="data['to_date']"><span t-esc="data['from_date']">To Date:</span></t>
<t t-if="data['product_id']"><span t-esc="data['product_id']">Product:</span></t>

</div>
</t>
</t>
</template>
</data>
</odoo>


Report File

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<report
id="pl_report_def"
string="Product Profit Loss"
model="form.data"
report_type="qweb-html"
file="survey_client.pl_report_template_struct"
name="survey_client.pl_report_template_struct"
/>

</data>
</odoo>

I have try all solution from internet but same error will occur.any  Please help.


0
Avatar
Descartar
Hilar Andikkadavath

Better to the report development from odoo documentation. https://www.odoo.com/documentation/10.0/reference/reports.html

Hilar Andikkadavath

*learn

OdooBot

Thanks @Hilar AK  for your help it's working.

On 13/08/19 8:00 PM, Hilar AK wrote:

*learn


Sent by Odoo S.A. using Odoo.

Avatar
Courses Training by 360DigiTMG
Mejor respuesta

Visit to know more details for above topic:  https://360digitmg.com/python-typeerror-nonetype-object-is-not-subsriptable

0
Avatar
Descartar
Avatar
germyrinn
Mejor respuesta

In general, the error means that you attempted to index an object that doesn't have that functionality. You are trying to subscript an object which you think is a list or dict, but actually is None. NoneType is the type of the None object which represents a lack of value, for example, a function that does not explicitly return a value will return None. 'NoneType' object is not subscriptable is the one thrown by python when you use the square bracket notation object[key] where an object doesn't define the __getitem__ method .  

More: http://net-informations.com/python/err/nonetype.htm





0
Avatar
Descartar
¿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 ภาษาไทย 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