2017-06-21 488 views

回答

3
<act_window 
    id="act_test_test" 
    name="Am here" 
    res_model="account.move.line" 
    context="{'search_default_unreconciled':1, 'search_default_payable':1}" 
    domain="[('partner_id', '=', False)]" 
    src_model="account.invoice"/> 

在上面的示例代码中,act_window用于创建特定模型的窗口动作。这里是account.move.line'. That is res_model`用于定义资源模型。

现在你有一个动作,你需要从某个地方调用它。要做到这一点,你必须定义一个菜单链接。该任务由src_model完成。您定义了一个型号名称,菜单链接将出现在Action/More的子菜单form/list视图中。在上面的例子中,我定义了account.invoice,所以菜单将出现在'account.invoice model'的form/list view的'Action'下。 enter image description hereenter image description here

这就是我所理解的。希望它能帮助你。

相关问题