Pular para o conteúdo
Odoo Menu
  • Entrar
  • Experimente grátis
  • Aplicativos
    Finanças
    • Financeiro
    • Faturamento
    • Despesas
    • Planilhas (BI)
    • Documentos
    • Assinar Documentos
    Vendas
    • CRM
    • Vendas
    • PDV Loja
    • PDV Restaurantes
    • Assinaturas
    • Locação
    Websites
    • Criador de Sites
    • e-Commerce
    • Blog
    • Fórum
    • Chat ao Vivo
    • e-Learning
    Cadeia de mantimentos
    • Inventário
    • Fabricação
    • PLM - Ciclo de Vida do Produto
    • Compras
    • Manutenção
    • Qualidade
    Recursos Humanos
    • Funcionários
    • Recrutamento
    • Folgas
    • Avaliações
    • Indicações
    • Frota
    Marketing
    • Redes Sociais
    • Marketing por E-mail
    • Marketing por SMS
    • Eventos
    • Automação de Marketing
    • Pesquisas
    Serviços
    • Projeto
    • Planilhas de Horas
    • Serviço de Campo
    • Central de Ajuda
    • Planejamento
    • Compromissos
    Produtividade
    • Mensagens
    • Aprovações
    • Internet das Coisas
    • VoIP
    • Conhecimento
    • WhatsApp
    Aplicativos de terceiros Odoo Studio Plataforma Odoo Cloud
  • Setores
    Varejo
    • Loja de livros
    • Loja de roupas
    • Loja de móveis
    • Mercearia
    • Loja de ferramentas
    • Loja de brinquedos
    Comida e hospitalidade
    • Bar e Pub
    • Restaurante
    • Fast Food
    • Hospedagem
    • Distribuidor de bebidas
    • Hotel
    Imóveis
    • Imobiliária
    • Escritório de arquitetura
    • Construção
    • Administração de propriedades
    • Jardinagem
    • Associação de proprietários de imóveis
    Consultoria
    • Escritório de Contabilidade
    • Parceiro Odoo
    • Agência de marketing
    • Escritório de advocacia
    • Aquisição de talentos
    • Auditoria e Certificação
    Fabricação
    • Têxtil
    • Metal
    • Móveis
    • Alimentação
    • Cervejaria
    • Presentes corporativos
    Saúde e Boa forma
    • Clube esportivo
    • Loja de óculos
    • Academia
    • Profissionais de bem-estar
    • Farmácia
    • Salão de cabeleireiro
    Comércio
    • Handyman
    • Hardware e Suporte de TI
    • Sistemas de energia solar
    • Sapataria
    • Serviços de limpeza
    • Serviços de climatização
    Outros
    • Organização sem fins lucrativos
    • Agência Ambiental
    • Aluguel de outdoors
    • Fotografia
    • Aluguel de bicicletas
    • Revendedor de software
    Navegar por todos os setores
  • Comunidade
    Aprenda
    • Tutoriais
    • Documentação
    • Certificações
    • Treinamento
    • Blog
    • Podcast
    Empodere a Educação
    • Programa de educação
    • Scale Up! Jogo de Negócios
    • Visite a Odoo
    Obtenha o Software
    • Baixar
    • Comparar edições
    • Releases
    Colaborar
    • Github
    • Fórum
    • Eventos
    • Traduções
    • Torne-se um parceiro
    • Serviços para parceiros
    • Cadastre seu escritório contábil
    Obtenha os serviços
    • Encontre um parceiro
    • Encontre um Contador
    • Conheça um consultor
    • Serviços de Implementação
    • Referências de Clientes
    • Suporte
    • Upgrades
    Github YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Faça uma demonstração
  • Preços
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Financeiro
  • Inventário
  • PoS
  • Projeto
  • MRP
All apps
É necessário estar registrado para interagir com a comunidade.
Todas as publicações Pessoas Emblemas
Marcadores (Ver tudo)
odoo accounting v14 pos v15
Sobre este fórum
É necessário estar registrado para interagir com a comunidade.
Todas as publicações Pessoas Emblemas
Marcadores (Ver tudo)
odoo accounting v14 pos v15
Sobre este fórum
Ajuda

Hide Sale Order Create Button

Inscrever

Seja notificado quando houver atividade nesta publicação

Esta pergunta foi sinalizada
odoo15CE
5 Respostas
1269 Visualizações
Avatar
Adhichand

I’m trying to customize the Sales module so that the "Create" button is hidden only in the Sale Orders view, but it should remain visible for Quotations.

What I’ve tried:

  • Adding a domain/context check in the XML view.
  • Overriding the can_create method (no effect).
  • Applying security rules — but it hides the button in both views.

My use case:

I want users to only be able to create Quotations, not direct Sale Orders.

💡 Question:

What is the best way to achieve this? Can we apply a condition in XML or through context in action_orders to hide the "Create" button?

Thanks in advance!

0
Avatar
Cancelar
Avatar
D Enterprise
Melhor resposta

This

Best Practice Approach

Odoo lets you control the visibility of the "Create" button by setting the context in the action with the flag:

'context': {'hide_create_button': True}

Then, in the XML view, you check that context and hide the button accordingly.

Step 1: Inherit the "Sales Orders" action and set the context

<odoo> <record id="action_orders_hide_create" model="ir.actions.act_window"> <field name="name">Sales Orders (No Create)</field> <field name="type">ir.actions.act_window</field> <field name="res_model">sale.order</field> <field name="view_mode">tree,form</field> <field name="domain">[('state', 'not in', ('draft',))]</field> <field name="context">{'hide_create_button': True}</field> </record> <!-- Override menu to point to the new action --> <menuitem id="sale.menu_sale_order" action="action_orders_hide_create"/> </odoo>

This keeps "Quotations" untouched (default behavior), and applies the modified context only in the Sales Orders view.

Step 2: Inherit the tree/form view and hide the "Create" button based on context

<record id="view_order_tree_inherit_hide_create" model="ir.ui.view"> <field name="name">sale.order.tree.hide.create</field> <field name="model">sale.order</field> <field name="inherit_id" ref="sale.view_order_tree"/> <field name="arch" type="xml"> <xpath expr="//tree" position="attributes"> <attribute name="create">not context.get('hide_create_button')</attribute> </xpath> </field> </record>

You can repeat the same for the form view if needed, though usually the button only appears in the list.


i hope it is use full

0
Avatar
Cancelar
Avatar
Dhrumi (Wan Buffer Services)
Melhor resposta

Use Record Rules or Access Rights

  • Go to Settings → Users & Companies → Groups
  • Select the group (e.g., Sales / User: Own Documents Only)
  • In the “Access Rights” tab, remove “create” access from the sale.order model.

👉 This disables the button and also prevents backend creation.

0
Avatar
Cancelar
Avatar
Adhichand
Autor Melhor resposta

Thank you For Response, But This Is The Way To Remove Create In Lines As It Applies In One2Many 

0
Avatar
Cancelar
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Melhor resposta

Hi,

How to Hide the “Create” Button in Sale Orders View Only


Enable Developer Mode

Go to Settings → Activate Developer Mode.


Navigate to Sale Orders

Open Sales → Orders → Sale Orders.


Access the View Editor

Click the Debug icon (top-right), then choose “Edit View: List” (not “Edit Action”).


Update the View Architecture

In the XML code, find the <tree> tag and modify it like this:



<tree ............. create="false">

Save Your Changes


That’s it! The “Create” button will now be hidden only in the Sale Orders list view, your Quotations view remains untouched.


Hope it helps

0
Avatar
Cancelar
Adhichand
Autor

Thank You, But This Hides The List View Create But When A Form Opens The Create Button still Visible

Adhichand
Autor

Have Found The Solution Used def fields_view_get Function In Odoo 15 To Achieve this, Thank You For The Help!

@api.model
def fields_view_get(self, view_id=None, view_type="form", toolbar=True, submenu=False, **kwargs):
res = super(SaleOrder, self).fields_view_get(
view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=submenu, **kwargs
)
if view_type == 'form':
doc = etree.XML(res['arch'])
context = self.env.context
allow_create = context.get("default_order_sequence") or context.get("order_sequence")
doc.attrib['create'] = 'false' if allow_create else 'true'
res['arch'] = etree.tostring(doc, encoding='unicode')

return res

Avatar
Ard van Someren
Melhor resposta

Are the answers in this post helpful?  https://www.odoo.com/forum/help-1/how-do-i-remove-create-but-leave-create-and-edit-282603

0
Avatar
Cancelar
Está gostando da discussão? Não fique apenas lendo, participe!

Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!

Inscreva-se
Publicações relacionadas Respostas Visualizações Atividade
How to Display Monetary Field in Odoo 15 Qweb Report? Resolvido
qweb-report odoo15CE
Avatar
Avatar
1
fev. 25
2656
Update fields.Selection from SQL after SQL Connection is configured - Odoo 15
sql 15 odoo15CE
Avatar
1
out. 24
1639
Odoo 15 CC: How to open Live chat window default Open
livechat odoo15CE autopopup
Avatar
0
jul. 24
1339
Odoo 15: Livechat Conversation history email not showing Image of user(operator)
livechat Image odoo15CE
Avatar
0
jul. 24
1444
Missing field string information for the field 'manual_reinvoice_done' from the 'hr.expense' model: since migration from 15.0 to 16.0 (OpenUpgrade) Resolvido
hr_expense OpenUpgrade odoo15CE odoo16CE
Avatar
Avatar
2
nov. 25
252
Comunidade
  • Tutoriais
  • Documentação
  • Fórum
Open Source
  • Baixar
  • Github
  • Runbot
  • Traduções
Serviços
  • Odoo.sh Hosting
  • Suporte
  • Upgrade
  • Desenvolvimentos personalizados
  • Educação
  • Encontre um Contador
  • Encontre um parceiro
  • Torne-se um parceiro
Sobre nós
  • Nossa empresa
  • Ativos da marca
  • Contato
  • Empregos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidade
  • Segurança
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo é um conjunto de aplicativos de negócios em código aberto que cobre todas as necessidades de sua empresa: CRM, comércio eletrônico, contabilidade, estoque, ponto de venda, gerenciamento de projetos, etc.

A proposta de valor exclusiva Odoo é ser, ao mesmo tempo, muito fácil de usar e totalmente integrado.

Site feito com

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now