Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

Hide Sale Order Create Button

Odebírat

Get notified when there's activity on this post

This question has been flagged
odoo15CE
5 Odpovědi
1266 Zobrazení
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
Zrušit
Avatar
D Enterprise
Nejlepší odpověď

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
Zrušit
Avatar
Dhrumi (Wan Buffer Services)
Nejlepší odpověď

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
Zrušit
Avatar
Adhichand
Autor Nejlepší odpověď

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

0
Avatar
Zrušit
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Nejlepší odpověď

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
Zrušit
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
Nejlepší odpověď

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
Zrušit
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
How to Display Monetary Field in Odoo 15 Qweb Report? Vyřešeno
qweb-report odoo15CE
Avatar
Avatar
1
úno 25
2655
Update fields.Selection from SQL after SQL Connection is configured - Odoo 15
sql 15 odoo15CE
Avatar
1
říj 24
1638
Odoo 15 CC: How to open Live chat window default Open
livechat odoo15CE autopopup
Avatar
0
čvc 24
1336
Odoo 15: Livechat Conversation history email not showing Image of user(operator)
livechat Image odoo15CE
Avatar
0
čvc 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) Vyřešeno
hr_expense OpenUpgrade odoo15CE odoo16CE
Avatar
Avatar
2
lis 25
242
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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