콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
7492 화면

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?


아바타
취소
베스트 답변

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.

아바타
취소
베스트 답변

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

아바타
취소
베스트 답변

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

아바타
취소
관련 게시물 답글 화면 활동
1
2월 24
2454
1
7월 23
2677
1
6월 23
3263
1
4월 23
2736
1
12월 22
2212