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

How to create or get new external ID for custom reports

Suscribirse

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

Se marcó esta pregunta
reportserrorsv14
1 Responder
4137 Vistas
Avatar
David Saint

Hi there, I'm fairly new to odoo14 and I am getting this error while trying to build a new custom report.


ValueError: External ID not found in the system: account.account_tag_operating_activities

So, I created two new xml files with the respective menu and the respective tags to use, both .xml files are references in the manifest.py:

This is where the menu xml file:
xml version="1.0" encoding="utf-8"?>



id="action_report_indirect_cash_flow" model="ir.actions.client">
name="name">indirect cash flow
name="tag">account_report
name="context" eval="{'model': 'account.cash.flow.report.indirect'}"/>




id="menu_action_reports_indirect_cash_flow"
name="indirect cash flow"
action="action_report_indirect_cash_flow"
parent="account.account_reports_legal_statements_menu"
groups="account.group_account_readonly"
/>


This is the tags file:

xml version="1.0" encoding="utf-8"?>

noupdate="1">


id="account_tag_operating_activities" model="account.account.tag">
name="name">Cash Generated From Operations
name="applicability">accounts


id="account_tag_operational_free_cash" model="account.account.tag">
name="name">Free cash flow from operations
name="applicability">accounts


id="account_tag_non_operational_cash" model="account.account.tag">
name="name">Non operational cash flow
name="applicability">accounts




Here is the custom model that I'm building:


# -*- coding: utf-8 -*-
from odoo import models, fields, api, _


class AccountCashFlowReportIndirect(models.AbstractModel):
_name = 'account.cash.flow.report.indirect'
_description = 'Cash Flow Report'
_inherit = 'account.report'

filter_date = {'mode': 'range', 'filter': 'today'}
filter_comparison = None
filter_journals = True
filter_unfold_all = False
filter_all_entries = False

@api.model
def _get_tags_per_account(self, tag_ids):

tags_per_accounts = {}

query = '''
SELECT
DISTINCT account_account_id,
ARRAY_AGG(account_account_tag_id)
FROM account_account_account_tag
WHERE account_account_tag_id IN %s
GROUP BY account_account_id
'''
params = [tag_ids]

self._cr.execute(query, params)
for account_id, tags in self._cr.fetchall():
tags_per_accounts[account_id] = tags
return tags_per_accounts

@api.model
def _get_lines(self, options, line_id=None):
tag_operations = self.env.ref('account.account_tag_operating_activities').id
# tag_operational_free_cash = self.env.ref('account.account_tag_operational_free_cash').id
# tag_non_operational_cash = self.env.ref('account_tag_non_operational_cash').id
# tag_ids = (tag_operations, tag_operational_free_cash, tag_non_operational_cash)
# result = self._get_tags_per_account(tag_ids)
print(tag_operations)


So, my error is when I'm trying to get the id of any of the created tags I get the

ValueError: External ID not found in the system.


Any suggestion or idea on what I might be doing wrong? When I check the table accounts_accounts_tags I can see the tags that I've created, the same when I check ir_model_data table in my local database.


Any response is kindly appreciated.






0
Avatar
Descartar
Avatar
Niyas Raphy (Walnut Software Solutions)
Mejor respuesta

Hi,

In the python code, it seems you are looking for a record with external id: account.account_tag_operating_activities, but i think the record with id account_tag_operating_activities is created in the custom module right ?


If yes, please update the above code to your_module_name.account_tag_operating_activities instead of account.account_tag_operating_activities.


Thanks

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
Publicaciones relacionadas Respuestas Vistas Actividad
lxml.etree.XMLSyntaxError: Document is empty, line 1, column 1
errors v14
Avatar
Avatar
1
may 24
4545
Header missing on reports Resuelto
invoices reports v14
Avatar
Avatar
Avatar
2
may 23
5692
How to hide reports from print menu in odoo 14 ? Resuelto
xml reports v14
Avatar
Avatar
2
ene 23
12779
Error printing invoices Odoo 9c
printing reports errors
Avatar
Avatar
1
may 16
4279
Getting image field from backend and set it as background image in report qweb
report reports odoo v14
Avatar
Avatar
1
nov 22
4363
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.

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