Odoo Help

0

Field view get function

By
Umashankar Subramani
on 1/3/16, 11:43 PM 1,665 views

Hi,

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

0
Vikas Goyal
On 12/22/17, 6:22 AM

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

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 1/3/16, 11:43 PM
Seen: 1665 times
Last updated: 12/22/17, 6:22 AM