跳至内容
菜单
此问题已终结
1 回复
7592 查看

Hi,

   How to make a view editable for only particular number of days , is it possible to do this using field view get function.....

形象
丢弃
最佳答案

How I achieve something like by using following piece of code:

@api.model
def fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False):
if view_type == 'form':
res['arch'] = self.fields_view_get_address(res['arch'])
record = self.env['crm.lead'].browse(self._context.get('params').get('id'))
# restrict modification and deletion of child ids
if record.parent_id:
res['arch'] = res['arch'][:6] + 'edit="false" delete="false" ' + res['arch'][6:]
elif record.stage_id.id == 4: # restrict edition of Purchased Lead
res['arch'] = res['arch'][:6] + 'edit="false" ' + res['arch'][6:]

return res
形象
丢弃
相关帖文 回复 查看 活动
2
11月 16
6397
1
9月 15
5049
3
8月 15
9175
1
7月 15
8615
1
3月 15
5779