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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
To resolve this issue, you can try the following steps:
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.
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.
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.
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.
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
1
thg 2 24
|
1929 | ||
|
1
thg 7 23
|
2298 | ||
|
1
thg 6 23
|
2781 | ||
|
1
thg 4 23
|
2359 | ||
|
1
thg 12 22
|
1814 |