Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
4411 มุมมอง

Hello,

I'm building a custom wizard that allows the user uploading an XLS file and importing it into a purchase order. For users' convenience I want to provide an XLS template so they download, fill and upload it back. I'm passing the template into the wizard as a read only Binary field with its value established through the _default_get function.

The problem is that when I open the wizard, the template field is locked and can't be downloaded. The data is there, and so is the filename, but when I pass the cursor over the filename it becomes a "forbidden" (🚫) sign.

How can I fix this?

Thanks.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi

I had the same problem with a wizard in Odoo 12. I think it is because lauching a wizard is not sufficient to set the value of some fields (even if you can pass the values of fields through the context and compute some other fields). I solved it by a button in the wizard. In your case, don't use a _default_get function, but compute the binary field upon clicking an "object" button (could be just a "Confirm" button). To avoid the button closing the wizard, you need a return to a ir.actions.act_window that reloads the wizard at the end of the function.

Pierre-François

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

Please do this.

<a href="#" onclick="window.open('/web_custom/static/src/index.html', '_blank')" >To Access Index Html Page</a>

Regards,

Silvestar

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ธ.ค. 22
3407
0
ม.ค. 22
2867
What is wizard ? แก้ไขแล้ว
3
พ.ย. 23
32521
0
ก.ค. 19
2535
4
ก.ค. 25
4937