在树状视图odoo 10的操作按钮中添加其他选项

时间:2018-07-04 03:20:26

标签: python-2.7 button treeview odoo-10

我想在树形视图的操作按钮中添加另一个选项。此外,在导出和删除中,我想添加“确认”选项。我不知道如何,请帮帮我。谢谢

enter image description here

3 个答案:

答案 0 :(得分:0)

case WM_CTLCOLORBTN:
case WM_CTLCOLORSTATIC: 
{
    char  class_Name[100];
    WNDCLASS lpcls{};

    SetBkMode((HDC)wParam, TRANSPARENT);

    GetClassName(hWnd, class_Name, 100); 
    GetClassInfo(frm.getInstance(), class_Name, &lpcls);

    for (int i = 0; i < frm.getControlCount(); i++)
    {
        if (frm.getControls().find(i)->second->getHandle() == (HWND)lParam)
        {

            // Obtain the control associated with the id.
            X3D::Windows::Control *ctrl = frm.getControls().find(i)->second;
            if (ctrl == NULL)
                return 0;

            // Check if this is a X3D Label control. 
            Label *lbl = dynamic_cast<X3D::Windows::Label*>(ctrl);

            if (lbl != NULL)
            {
                SetTextColor((HDC)wParam, lbl->getForeColor());
                break;
            }  
        }
    } 

    return  (LRESULT)lpcls.hbrBackground;
}  

答案 1 :(得分:0)

您可以通过这种方式进行:

<record id="id" model="ir.actions.act_window">
        <field name="name">Confirm Order</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">custom.model.name</field>
        <field name="view_type">form</field>
        <field name="view_mode">form</field>
        <field name="target">new</field>
    </record>

如果要为此选项添加自定义组,则可以在此处添加一个属性,例如:

<field name="groups_id" eval="[(4,ref('model.group_name'))]"/>

答案 2 :(得分:0)

我能够使弹出向导在其他模型中显示:

@IBInspectable open var leftImage : UIImage? {
    didSet{
        padding = UIEdgeInsets(top: 10, left: 24, bottom: 5, right: 5)
        let imageView = UIImageView(frame: CGRect(x: 8 , y: 5, width: 22, height: 22))
        imageView.image = leftImage
        self.leftView = imageView
        self.leftViewMode = .always
    }
}