为什么 OpenERP 在执行 tree_but_open 事件时会创建 2 个不同的线程。当我双击树中的一个项目时,它似乎为每次单击创建 2 个不同的线程,然后在每个线程中执行我的 Python 方法。
这是正常行为吗?
<record id="action_wash_st_method1" model="ir.actions.server">
<field name="type">ir.actions.server</field>
<field name="condition">True</field>
<field name="state">code</field>
<field name="model_id" ref="model_view_tree_display_address_list"/>
<field eval="5" name="sequence"/>
<field name="code">
self.view_calc_sales_tax(cr, uid, context)
</field>
<field name="name">wash state action request</field>
</record>
<record model="ir.values" id="action_wash_st_tax_trigger_method1" >
<field name="key2" eval="'tree_but_open'" />
<field name="model" eval="'view.tree.display.address.list'" />
<field name="name">Method1 Wash State</field>
<field name="value" eval="'ir.actions.server,%d'%action_wash_st_method1"/>
<field name="object" eval="True" />
</record>
OpenERP 输出:当我双击树/列表时,请注意我的方法中打印的 2 个不同的线程 ID。
********************before calling button_reset_taxes, 47494460417792
**************Entering button_reset_taxes: 47494460417792
2012-08-07 04:09:26,383 30080 INFO ? werkzeug: 71.195.148.241 - - [07/Aug/2012 04:09:26] "POST /web/action/run HTTP/1.1" 200 -
2012-08-07 04:09:26,402 30080 INFO ? werkzeug: 71.195.148.241 - - [07/Aug/2012 04:09:26] "POST /web/treeview/action HTTP/1.1" 200 -
2012-08-07 04:09:26,496 30080 INFO ? werkzeug: 71.195.148.241 - - [07/Aug/2012 04:09:26] "POST /web/session/eval_domain_and_context HTTP/1.1" 200 -
********************before calling button_reset_taxes, 47494452025088
**************Entering button_reset_taxes: 47494452025088
2012-08-07 04:09:26,590 30080 INFO ? werkzeug: 71.195.148.241 - - [07/Aug/2012 04:09:26] "POST /web/action/run HTTP/1.1" 200 -