Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda

I'm new to Odoo and I feel lost. How to understand the flow of execution after I press some button (any button, validate SO, print order, etc etc). I'm using the debugger so I'm looking for a spot where I can set the breakpoint and then step down line-by-line to see what it does, which methods are invoked and such. (In PHP I would put it at some root controller)

For example, I'm in delivery order, print order button. In debug mode I see that when I click that button the method name is do_print_picking defined as :

@api.multi
def do_print_picking(self):
self.write({'printed': True})
return self.env["report"].get_action(self, 'stock.report_picking')

So how do I go from here, what does the last line really call? 

Avatar
Buang
Jawaban Terbai

I'm pretty sure that when you click that print button, that python function is executed, that function is declared as an action for that button in views/*_template.xml file, something like:


<button string="Print order" type="object" name="do_print_picking"/>

The last line calls an action coded in the .xml file located in views/*_template.xml as mentioned above, this action calls for a qweb report to be generated, I recomend you to watch some videos about odoo and qweb method, this is to generate pdfs when a print button is clicked.

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
1
Jun 25
695
2
Jul 25
1258
0
Mar 25
1262
2
Mar 25
1554
0
Nov 24
1097