I want to know that if its possible to set the visibility of a form's button based on how this form is being called. Like there are two forms 'A' and 'B'. Now the button on form 'A' calls the form 'B'. All I want to show the form 'B' button only if its called through that specific form 'A' button. I dont know how this will be achievable but I think I will have to set the attributes on the button of form B. But how to check if form A button is clicked. Thats where I am stuck. I need some guidance on this.Every help will be appreciated. I tired with this on form 'A':
def edits(self,cr,uid,ids,context=None): for id in ids:
deg_obj=self.pool.get('deg.form').browse(cr,uid,id)
my_id=int(deg_obj.my_products)
return{ 'view_type': 'form',
'view_mode': 'form',
'res_model': 'product.product',
'res_id':my_id,
'type': 'ir.actions.act_window',
'nodestroy':False,
'target': 'inline', }
And this in xml on form 'B':
<button name="saves" string="SAVE" type="object" invisible="context.get('product1')" />