Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
4309 Lượt xem

In sales order, after writing all the information required for the sale order.


I want to create a button "Work Order"  that generates a PDF automatically with a few information written in the fields, this document will create a custom PDF that I'm gonna modify, but all I want is that this button generates the PDF adding some of the Sale Order info that I just wrote in the required fields, such as: Client name, Quantity and the premade Sale Number created by the system.


Sorry if I am not very clear here :(

Ảnh đại diện
Huỷ bỏ

so do I only change the variables ['report'], module_name and template_name? and what do you mean by template name? What file extension is that?

Câu trả lời hay nhất

first create function like 

@api.multi

    def print_work_order(self):

        return self.env['report'].get_action(self, 'module_name.template_name')

and assign this fuction to your button.

make sure you have created action for report

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 5 25
2160
3
thg 2 23
6594
2
thg 12 21
5377
1
thg 4 25
3981
0
thg 8 19
2514