Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ

We are looking into adding a button to the Send & Print wizard on Invoice. We are currently using the OCA module `report_pdf_options` to make the print button directly printing the report instead of downloading it. I noticed that when you use that print option, it calls the `account_invoices` report action that is on the `account.move` model or the `account_invoices_without_payment` if you select the Invoices without payment from Print.


Anyway, I inherited that wizard view, modified it to add a button that calls that action like this:


It works, it does prints *a document* but not the correct one. The reason being is, I believe, since the wizard is on the `account.move.send` model, it is using the ID from that model and just printing whichever invoice matches that ID. The `account.move.send` model does have a `many2many` field called `move_ids`, I think I need to pass the ID from that field instead (so maybe `move_ids.id`), but I am just not sure how to do that when calling that action, through a context, maybe? I have tried using context with mixed result, of which, none of them were intended result, probably because I wasn't setting the right context. If anyone can point me to the right direction, that would be awesome.


Thanks!

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 7 24
735
1
thg 11 16
4497
1
thg 10 24
1294
0
thg 8 24
723
1
thg 6 24
1961