Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
236 Zobrazení

I'm getting this error when i click an action button to print a report


Erreur client Odoo

UncaughtPromiseError > TypeError

Uncaught Promise > Cannot read properties of undefined (reading 'context')

Occured on 147.93.95.212:8069 on 2025-06-24 14:39:01 GMT

TypeError: Cannot read properties of undefined (reading 'context')
    at http://147.93.95.212:8069/web/assets/c7681b7/web.assets_web.min.js:27526:161
    at _executeReportAction (http://147.93.95.212:8069/web/assets/c7681b7/web.assets_web.min.js:9917:175)
    at doAction (http://147.93.95.212:8069/web/assets/c7681b7/web.assets_web.min.js:9930:328)
    at async Object.doActionButton (http://147.93.95.212:8069/web/assets/c7681b7/web.assets_web.min.js:9940:249)
    at async execute (http://147.93.95.212:8069/web/assets/c7681b7/web.assets_web.min.js:9547:266)
    at async executeButtonCallback (http://147.93.95.212:8069/web/assets/c7681b7/web.assets_web.min.js:9540:34)

Avatar
Zrušit
Autor

The problem is that the module works perfectly in local, but on the server it throws this error every time i click the print button

Step 1: Confirm the Report Exists on the Server
Run this in Odoo shell on the server:
./odoo-bin shell -d your_db_name

Then:
self.env.ref('your_module.report_template_id')

If this raises an error, then the report is not loaded on the server. Make sure the XML file where it’s defined is listed in your __manifest__.py under "data": [...].

Step 2: Fully Upgrade the Module on the Server

./odoo-bin -d your_db_name -u your_module_name

Step 3: Clear Frontend Assets (JS/XML Cache)

Odoo stores static files in bundles. Run:

./odoo-bin -d your_db_name --assets

Or delete all minified assets manually:

rm -rf /your/odoo/path/.local/share/Odoo/filestore/your_db_name/*web.assets*

then restart your odoo server

i hope it is usefull

Nejlepší odpověď

Hii,

i dont know your code but  here is some step please check in your code in your custom module if you create


Step 1: Make sure the report action is called correctly in Python

In your button method, return the report like this:

def action_print_report(self):

    self.ensure_one()  # makes sure you're on one record

    return self.env.ref('your_module.report_template_id').report_action(self)


Step 2: Check that the report is defined properly in XML

In your XML file (your_module/views/report.xml), make sure the report is defined like this:

<report

    id="report_template_id"

    model="your.model"

    string="My Report"

    report_type="qweb-pdf"

    name="your_module.report_template"

    file="your_module.report_template"

/>

If you're using a custom JS button, you must pass context manually.

If the issue remains, try updating the module and clearing your browser cache

i hope it is use full

Avatar
Zrušit