Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

Custom code: odoo19 pdf report ValueError: External ID not found in the system

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
odooodoo19pdf reports
3 Replies
1065 Rodiniai
Portretas
Arjun Baidya

def monthly_attendance_pdf_report(self):
days_of_month = self.get_days_of_month(self.date_from, self.date_to)
datas = self.monthly_all_employee_attendance_generate()
employees_attendances = datas.get('attendance_details', [])
company = self.company
grouped_attendance_details = defaultdict(list)
for attendance in employees_attendances:
department = attendance.get('department', 'No Department')
grouped_attendance_details[department].append(attendance)
company_data = {
'company_name': company.name,
'company_street': company.street or '',
'company_street2': company.street2 or '',
'company_city': company.city or '',
'company_country': company.country_id.name or '',
'date_from': self.date_from.strftime('%B - %Y'),
'date_to': self.date_to.strftime('%Y-%m-%d'),
}
return self.env.ref('module_name.action_monthly_attendance_pdf_report').report_action(None, data={'attendance_details': grouped_attendance_details, 'days_of_month': days_of_month, 'company_data': company_data})

<report
id="action_monthly_attendance_pdf_report"
model="monthly.employee.attendance.wizard"
string="monthly_attendance_report"
report_type="qweb-pdf"
name="module_name.report_monthly_all_emp_attendance"
file="module_name.report_monthly_all_emp_attendance"
paperformat="module_name.corporate_standard_attendance_format"
print_report_name="monthly_attendance_Report"
/>


I use this code but shows error

 return self.env.ref('hr_reports.action_monthly_attendance_pdf_report').report_action(None, data={'attendance_details': grouped_attendance_details, 'days_of_month': days_of_month, 'company_data': company_data})
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/arjun/odoo_dev/odoo19/odoo/odoo/orm/environments.py", line 166, in ref
    res_model, res_id = self['ir.model.data']._xmlid_to_res_model_res_id(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/arjun/odoo_dev/odoo19/odoo/odoo/addons/base/models/ir_model.py", line 2232, in _xmlid_to_res_model_res_id
    return self._xmlid_lookup(xmlid)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/arjun/odoo_dev/odoo19/odoo/odoo/tools/cache.py", line 98, in lookup
    return self.lookup(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/arjun/odoo_dev/odoo19/odoo/odoo/tools/cache.py", line 155, in lookup
    value = self.method(*args, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/arjun/odoo_dev/odoo19/odoo/odoo/addons/base/models/ir_model.py", line 2225, in _xmlid_lookup
    raise ValueError('External ID not found in the system: %s' % xmlid)
ValueError: External ID not found in the system: hr_reports.action_monthly_attendance_pdf_report


Why it shows this error in odoo19 ?

0
Portretas
Atmesti
Portretas
Codesphere Tech
Best Answer

Hello Arjun,
Reference from Odoo 19 default:

<record id="action_account_original_vendor_bill" model="ir.actions.report">

            <field name="name">Original Bills</field>

            <field name="model">account.move</field>

            <field name="binding_model_id" ref="model_account_move"/>

            <field name="report_type">qweb-pdf</field>

            <field name="report_name">account.report_original_vendor_bill</field>

            <field name="report_file">account.report_original_vendor_bill</field>

            <field name="attachment">'original_vendor_bill.pdf'</field>

            <field name="attachment_use">True</field>

            <field name="domain" eval="[('move_type', 'in', ('in_invoice', 'in_refund', 'in_receipt')), ('message_main_attachment_id', '!=', False)]"/>

        </record>

Hope it is helpful.

0
Portretas
Atmesti
Portretas
Marvin Accuweb.Cloud
Best Answer


Hi @Arjun Baidya,

The error appears because Odoo cannot find the report record in its internal database (ir.model.data). This usually means the report XML file wasn’t properly loaded during installation or update.

Please check the following points:

  1. Ensure your report definition is properly wrapped within <odoo> and </odoo> tags.
  2. Confirm that your report XML file (for example, report_monthly_attendance.xml) is included inside the data section of your module’s manifest file, not under demo.
  3. After updating the manifest, upgrade your module using the Odoo update command to reload all XML files and register the report again.
  4. You can also upgrade it from the Odoo interface by going to Apps → Upgrade hr_reports.
  5. If the issue continues, open the Odoo shell and check whether the report ID exists in the system. If it’s missing, that means the XML file still hasn’t been loaded correctly.

Once the XML file is properly loaded and the module has been upgraded, Odoo will be able to locate hr_reports.action_monthly_attendance_pdf_report, and the PDF report will generate without any issue.




0
Portretas
Atmesti
Portretas
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,


The error occurs because Odoo cannot find the XML ID hr_reports.action_monthly_attendance_pdf_report.

You defined the report in your custom module, not hr_reports.

The correct reference is module_name.action_monthly_attendance_pdf_report.

Ensure the <report> XML is included in the data section of __manifest__.py.

Use self.env.ref('module_name.action_monthly_attendance_pdf_report') in your method.

Make sure the module is installed and the XML file is loaded.

Update the module

After these steps, Odoo will find the XML ID and generate the report without error.


Hope it helps.

0
Portretas
Atmesti
Arjun Baidya
Autorius

Hello,
Thanks for your comment.
But my module name is hr_reports so hr_reports.action_monthly_attendance_pdf_report
in below i given code again
class MonthlyAllEmployeeAttendanceShow(models.TransientModel):
_name = 'monthly.employee.attendance.wizard'

def monthly_attendance_pdf_report(self):
days_of_month = self.get_days_of_month(self.date_from, self.date_to)
datas = self.monthly_all_employee_attendance_generate()
employees_attendances = datas.get('attendance_details', [])
company = self.company
grouped_attendance_details = defaultdict(list)
for attendance in employees_attendances:
department = attendance.get('department', 'No Department')
grouped_attendance_details[department].append(attendance)
company_data = {
'company_name': company.name,
'company_street': company.street or '',
'company_street2': company.street2 or '',
'company_city': company.city or '',
'company_country': company.country_id.name or '',
'date_from': self.date_from.strftime('%B - %Y'),
'date_to': self.date_to.strftime('%Y-%m-%d'),
}
return self.env.ref('hr_reports.action_monthly_attendance_pdf_report').report_action(None, data={'attendance_details': grouped_attendance_details, 'days_of_month': days_of_month, 'company_data': company_data})

report.xml
<report
id="action_monthly_attendance_pdf_report"
model="monthly.employee.attendance.wizard"
string="monthly_attendance_report"
report_type="qweb-pdf"
name="hr_reports.report_monthly_all_emp_attendance"
file="hr_reports.report_monthly_all_emp_attendance"
paperformat="hr_reports.corporate_standard_attendance_format"
print_report_name="monthly_attendance_Report"
/>

template file
some portion code
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template id="report_monthly_all_emp_attendance">
<t t-call="web.html_container">
<t t-call="web.internal_layout">
<div class="page" style="padding-top:10px;">
<div class="row">
<div class="col-xs-12">
<div class="company-info text-center" style="line-height: 1;">
<p style="line-height: 0.5;">
<b>
<t t-esc="company_data['company_name']"/>
</b>
</p>
<p style="line-height: 0.5;">
<t t-esc="company_data['company_street']"/>,
<t t-esc="company_data['company_street2']"/>,
<t t-esc="company_data['company_city']"/>,
<t t-esc="company_data['company_country']"/>
</p>
<p style="line-height: 0.5;">
<b>Attendance for the month of:</b>
<t t-esc="company_data['date_from']"/>
</p>
</div>

so where is the probem?
in my menifest file all file I added

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registracija
Related Posts Replies Rodiniai Veikla
Odoo 19 online: images won´t print on pdf reports
ImageList odoo19 Online pdf reports
Portretas
Portretas
Portretas
2
spal. 25
425
邮箱无法正常使用
odoo
Portretas
Portretas
1
lapkr. 25
2223
Return Process in Odoo 19 EE
deliveryorder returns return_products odoo odoo19
Portretas
Portretas
1
lapkr. 25
147
SOC 1 Report
odoo
Portretas
0
lapkr. 25
146
How do I go about this error? I am trying to uninstall a module
odoo
Portretas
Portretas
1
lapkr. 25
3442
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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