简体   繁体   中英

Openerp wizard treeview no action buttons

I have made a button(type=object) which calls this method:

def get_work(self, cr, uid, ids, context=None):
        #import pdb;pdb.set_trace()
        return {
        'name': 'Purchase Wizard',
        'view_type': 'form',
        'view_mode': 'tree,form',
        'res_model': 'mrp.bom.work',
        'type': 'ir.actions.act_window',
        'target': 'new',
        'context': {'bom_workcenter_id': ids[0]},
        'domain':[('bom_workcenter_id','=',ids[0])],
    }

and it works ok, but I can't add any button nor do I have a button to create.

What I get: http://i58.tinypic.com/r1h5p3.png

What I want: http://i62.tinypic.com/21981s4.png

What am I doing wrong?

By default it shows the create buttons unless you don't have permission to do so.

Check your tree view if create does not set create='false'.

Or just force it by adding attribute 'create':True, to your method return.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM