Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
3 Răspunsuri
8084 Vizualizări

Record does not exist or has been deleted. (Record: ir.actions.report(1,), User: 1), i get this error when clicking the run manually button ,  i want to send mail with attachment as a pdf report, how can i solve this ?

report = self.env.ref(
'partner_ledger_automatic_send.action_report_send_partner_ledger').with_context(
partner_id=partner.id, company_id=company.id,
rec=record.id)
print(report, "report")
print(record, "record")
data_record = base64.b64encode(
report._render_qweb_pdf(record.id)[0])
print(data_record, "data_record")


it didn't print the data_record why?


Imagine profil
Abandonează
Cel mai bun răspuns

To resolve this issue, you can try the following steps:

  1. Check the value of record.id and ensure that it is a valid ID of an existing record. Verify that the record is not deleted or missing.

  2. If you are passing the record.id from another part of the code, make sure that the value is retrieved correctly and that it corresponds to a valid record in the database.

  3. Ensure that the action_report_send_partner_ledger refers to a valid report action ID. Verify that the report action exists and is correctly defined in your codebase.

  4. Confirm that the report action referenced in self.env.ref() has the appropriate access rights for the current user. Ensure that the user executing the code has the necessary privileges to access and run the report.

Regarding the issue with data_record not being printed, it might be due to the previous error causing the execution to halt before reaching that print statement. The error message you mentioned could be raised when attempting to render the report using report._render_qweb_pdf(record.id)[0], which would prevent the subsequent lines of code from executing.

Make sure to address the "Record does not exist or has been deleted" error first. Once the issue is resolved, the code should continue executing, and you should see the data_record value printed as expected.

If the problem persists, consider checking the logs or enabling additional logging to gather more information about the error and its source.

Imagine profil
Abandonează
Cel mai bun răspuns

I have same issue but I have no idea what it means. can any one explain in simple terms?

Imagine profil
Abandonează
Cel mai bun răspuns

Hey, did you resolve this?
Please help me as well, I am facing the same error.

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
feb. 24
2867
1
iul. 23
3148
1
iun. 23
3714
1
apr. 23
3006
1
dec. 22
2470