I have inheritted survey_user_input and added
lead_id = fields.Many2one(comodel_name='crm.lead', string='Crm Lead')
and i wanted to show this in the smart button
<button name="action_open_documents"
class="oe_right_oe_button_box"
icon="fa-star"
string="Lead"
type="object"
invisible="not lead_id" >
</button>
the method is :
def action_open_lead(self):
return {
'type': 'ir.actions.act_window',
'name': 'Lead',
'res_model': 'crm.lead',
'view_mode': 'form',
'res_id': self.lead_id.id,
'context': {'create': False}
}
the xpath is correct because the other buttons which i have creaqted in this model works but for this i get :
Field 'lead_id' used in modifier 'invisible' (not lead_id) is restricted to the group(s) base.group_no_one.
View error context:
{'file': '/home/guhan/odoo/opt/odoo-servicum-addons/servicum_fillout_integration/views/survey_user_input_inherit.xml',
'line': 1,
'name': 'survey.user.input.view.form.inherit',
'view': ir.ui.view(772,),
'view.model': 'survey.user_input',
'view.parent': ir.ui.view(560,),
'xmlid': 'survey_user_input_view_form_inherit'}
i get the error only when
invisible="not lead_id"
is present.i have no groups set up in the field definition. the lead_id many2one alone works , but it throws an error in the button . any help would be appreciated. Thanks