Welcome!
This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.
Realizar a chamada de um formulário em uma janela apenas visualizável sem edição e sem os botões
Para a visualização das comandas no relatório de forma que não pudesse ser alterados os dados foi realizada a chamada de uma função restringindo o retorno de alguns dados, como: edit/delete/create e ocultando os botões que fazem parte do formulário de forma a ter apenas a visualização das informações do formulário reutilizando as funções.
def open_ticket(self): context = dict(self.env.context) context['create'] = False context['delete'] = False context['edit'] = False context['is_report'] = True return { 'type': 'ir.actions.act_window', 'name': 'Reffer Patient to Physician', 'res_model': 'cp.ticket', 'res_id': self.id, 'target': 'new', 'view_type': 'form', 'view_mode': 'form', 'views': [[False, 'form']], 'context': context, 'flags': {'form': {'mode': 'readonly'}} #por padrão é edit }
para que o botão seja ocultado é necessário a inserção de: invisible="context.get('is_report')"
<button name="nomedobotao" invisible="context.get('is_report')" type="object"/>
Your Answer
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
Keep Informed
About This Community
Moderation Tools
Question tools
Stats
Asked: 11/1/21, 10:27 PM |
Seen: 581 times |
Last updated: 11/1/21, 10:27 PM |