1

I have been developing a module for OpenERP 7. I wanted to know that how can I disable create/delete button for a specific function. Like I am clicking on a button to open a tree view. All I want is to disable the create button form top of that tree view. How can I achieve this in OpenERP? I don't have any other ml view for this tree view. I am calling the only tree view. But this time I don't need the create/discard button. Can anyone guide me how to do this? I have a button named "my_views". The code I used with this button is as:

context['prod1']='false'
        ctx = dict(context)
        print ctx['prod1']

        return {
           'type': 'ir.actions.act_window',
           'res_model': 'product.product',
           'view_type': 'form',
           'view_mode': 'tree,form',
           'target': 'current',
           'context':ctx,  
           'create':False,   
           'domain':[('id','in',domain)]
               } 

Then I am trying to use context.get in the xml of my required tree view of model as:

<tree create="context.get('prod1',false)"

but I am getting error:

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
Arsalan Sherwani
  • 889
  • 2
  • 25
  • 60
  • Showing some code of what you have tried might help solving this. – the Aug 19 '14 at 10:42
  • @Arsalan Sherwani see my answer at [This very same question][1] [1]: http://stackoverflow.com/questions/25379647/odoo-openerp-hiding-create-button-from-treeview/32904951#32904951 – Alessandro Ruffolo Oct 02 '15 at 10:11

1 Answers1

1

try this ,set create/delete as false so that button on top disable.

<tree string="my tree" create="false" delete='false'> </tree>

after this in this specific you can disable the create/delete button form top of that tree view.

BBBagadiya
  • 321
  • 2
  • 7