Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odgovori
6770 Prikazi

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?


Avatar
Opusti
Best Answer

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.

Avatar
Opusti
Best Answer

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

Avatar
Opusti
Best Answer

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

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
feb. 24
1947
1
jul. 23
2310
1
jun. 23
2836
1
apr. 23
2366
1
dec. 22
1856