Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

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

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

Hide Sale Order Create Button

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
odoo15CE
5 Risposte
1259 Visualizzazioni
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
Abbandona
Avatar
D Enterprise
Risposta migliore

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
Abbandona
Avatar
Dhrumi (Wan Buffer Services)
Risposta migliore

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
Abbandona
Avatar
Adhichand
Autore Risposta migliore

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

0
Avatar
Abbandona
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Risposta migliore

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
Abbandona
Adhichand
Autore

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

Adhichand
Autore

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
Risposta migliore

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
Abbandona
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Post correlati Risposte Visualizzazioni Attività
How to Display Monetary Field in Odoo 15 Qweb Report? Risolto
qweb-report odoo15CE
Avatar
Avatar
1
feb 25
2650
Update fields.Selection from SQL after SQL Connection is configured - Odoo 15
sql 15 odoo15CE
Avatar
1
ott 24
1638
Odoo 15 CC: How to open Live chat window default Open
livechat odoo15CE autopopup
Avatar
0
lug 24
1335
Odoo 15: Livechat Conversation history email not showing Image of user(operator)
livechat Image odoo15CE
Avatar
0
lug 24
1442
Missing field string information for the field 'manual_reinvoice_done' from the 'hr.expense' model: since migration from 15.0 to 16.0 (OpenUpgrade) Risolto
hr_expense OpenUpgrade odoo15CE odoo16CE
Avatar
Avatar
2
nov 25
222
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة 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 è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

Website made with

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