Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
7453 มุมมอง

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
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
fields_view_get not being triggered แก้ไขแล้ว
2
พ.ย. 16
6167
New API style for fields_view_get? แก้ไขแล้ว
1
ก.ย. 15
4925
3
ส.ค. 15
8981
1
ก.ค. 15
8440
1
มี.ค. 15
5628