"""
给用户弹出窗口增加修改权限
:return:
"""
self.ensure_one()
mass_mailing_copy = self.copy()
if mass_mailing_copy:
context = dict(self.env.context)
context['form_view_initial_mode'] = 'edit'
return {
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'sale.order',
'res_id': mass_mailing_copy.id,
'context': context,
}
return False
还可以增加只读权限 'form_view_initial_mode': 'readonly'