Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

How to add new button near the create button in odoo 16

Odoberať

Get notified when there's activity on this post

This question has been flagged
4 Replies
12578 Zobrazenia
Avatar
keyaan janis

Hi all, 

I'm new to odoo. Somebody, please tell me. How to add a button near create button in odoo 16. 

0
Avatar
Zrušiť
Avatar
Malik Imad Khan
Best Answer

Hello Keyaan,

a button cannot be created with the Studio and has to be created with writing a new view or editing an existing one and then adding the code for a button.


Here below are the steps for creating a button:

1) First create a server action by going to the Settings=> Technicals => Server actions.


 Code in the above screenshot: records.action_confirm()   

Once the server action is saved, look at the url and note the number that is after id. In my case, it was 540.


2) Then go to the Technical => views => create new view. 


By Following the above steps, you will be able to create a button before the confirm button in the Sales module. 


1
Avatar
Zrušiť
Avatar
Adil Akbar
Best Answer

Hi, you can follow this: https://youtu.be/MCEKCBA7zGk

Hope it helps,

Thanks

0
Avatar
Zrušiť
Avatar
Dương Nguyễn
Best Answer

Hi I have this tutorial module which will help you
https://apps.odoo.com/apps/modules/16.0/d_button_near_create_button/

0
Avatar
Zrušiť
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hello,

In Odoo we can add buttons near the 'Create' button by extending the view.

For example, if we need to add an 'Upload' button near the 'Create' Button in the Kanban view then extend 'KanbanView.buttons'.

Example

<templates>


    <t t-extend="KanbanView.buttons" t-name="BillsKanbanView.buttons">


        <t t-jquery="button" t-operation="after">


            <button type="button" class="btn btn-secondary  on_upload"  


         name="upload_button">


                Upload


            </button>


        </t>


    </t>


</templates>


if you want to replace the Create button then set the 't-operation' value to 'replace'

<t t-jquery="button" t-operation="replace">

we can also specify the model by adding conditions like

<button t-if="widget.modelName == '<model_name>'">Upload</button>

After adding the button we can create a function in js,
by extending 'web.KanbanController' you can add an action for the newly created button

Example

odoo.define('example.uploadButton', function(require) {
var KanbanController = require('web.KanbanController');
var KanbanButton = KanbanController.extend({
buttons_template: '',
events: _.extend({}, KanbanController.prototype.events, {
'click .on_upload': '_onUpload',
},
_onUpload: function(){
// this function will execute the Button click
}
}

Regards

0
Avatar
Zrušiť
Cybrosys Techno Solutions Pvt.Ltd

In order to add button in tree view, try the following:
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-inherit="web.ListView.Buttons" t-inherit-mode="extension">
<xpath expr="//*[@class='btn btn-secondary fa fa-download o_list_export_xlsx']"
position="after">
<button type="button" class="btn btn-secondary o_list_new_button"
t-on-click="actionDef">New Button</button>
</xpath>
</t>
</templates>

Gautam

hello,
I am stuck in opening a record from list view when target is new in js action. Can you explain this using example?

Enjoying the discussion? Don't just read, join in!

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

Registrácia
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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