Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

Hide Sale Order Create Button

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
odoo15CE
5 Antwoorden
1258 Weergaven
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
Annuleer
Avatar
D Enterprise
Beste antwoord

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
Annuleer
Avatar
Dhrumi (Wan Buffer Services)
Beste antwoord

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
Annuleer
Avatar
Adhichand
Auteur Beste antwoord

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

0
Avatar
Annuleer
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Beste antwoord

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
Annuleer
Adhichand
Auteur

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

Adhichand
Auteur

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
Beste antwoord

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
Annuleer
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
How to Display Monetary Field in Odoo 15 Qweb Report? Opgelost
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
okt. 24
1638
Odoo 15 CC: How to open Live chat window default Open
livechat odoo15CE autopopup
Avatar
0
jul. 24
1335
Odoo 15: Livechat Conversation history email not showing Image of user(operator)
livechat Image odoo15CE
Avatar
0
jul. 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) Opgelost
hr_expense OpenUpgrade odoo15CE odoo16CE
Avatar
Avatar
2
nov. 25
208
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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