1. 程式人生 > >Odoo8中wizard定義xml中點選wizard按鈕之後呼叫方法'execute_method'

Odoo8中wizard定義xml中點選wizard按鈕之後呼叫方法'execute_method'

wizard定義程式碼示例:

<act_window id="requisition_distribute_out_by_line_action"
            multi="True"
            key2="client_action_multi"
            name="Distribute"
            src_model="hrp.stock.requisition.order.line"
            res_model="hrp.stock.requisition.order.line.distribute"
            view_mode="form"
            target="new"
            view_type="form"
            context="{'display_filter': 'line_process_out_transfer','execute_method':'get_out_distribute_items_view',
'on_tree':'1'}"/>
<act_window id="requisition_distribute_in_by_line_action"
            multi="True"
            key2="client_action_multi"
            name="Distribute"
            src_model="hrp.stock.requisition.order.line"
            res_model="hrp.stock.requisition.order.line.distribute"
            view_mode="form"
            target="new"
            view_type="form"
            context="{'display_filter': 'line_process_in_transfer','execute_method':'get_in_distribute_items_view',
'on_tree':'1'}"/>

第一點:在wizard被觸發之後呼叫的方法
execute_method:get_in_distribute_items_view
第二點:用來在一個模型的多個檢視下控制遮蔽顯示
‘display_filter’: ‘line_process_in_transfer’