Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

Add button after Create and Import (Odoo11)

Naroči se

Get notified when there's activity on this post

This question has been flagged
viewbuttontemplate
2 Odgovori
12264 Prikazi
Avatar
arthur

Hello, I am trying to add a new button above the product tree view, right after the create and import buttons. I tried following these steps: https://www.odoo.com/pt_BR/forum/help-1/question/add-custom-button-to-list-view-header-90255, but wasn't successful. 

I have no clue of how I will actually call the action I want, but so far I can't even get the button to show up. can someone point out what I am missing? What I have so far is a view with the following lines:

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="vtex_connector.raizs" name="Template Name">
<t t-extend="ListView.buttons">
<t t-jquery="button.o_list_button_import" t-operation="after">
<button t-if="widget.modelName == 'product.template'" type="button" class="btn btn-primary oe_new_button" accesskey="f">
Upload
</button>
</t>
</t>
</template>
</data>
</odoo>
1
Avatar
Opusti
Avatar
DHA Medic
Best Answer

button.xml

<templates>
<t t-extend="ListView.buttons">
<t t-jquery="button.o_list_button_add" t-operation="after" >
<button type="button" t-if='widget.modelName == "m.dha.sig"'
class="btn btn-primary btn-sm o_list_button_upload">Upload
</button>
</t>
</t>
</templates>

__manifest__.py
'qweb':[
'static/src/xml/button.xml',
],
2
Avatar
Opusti
Avatar
Hazem Mahmoud (Rising Systems AG)
Best Answer

Hi 

For ListView:

<template xml:space="preserve">
    <t t-extend="ListView.buttons">
<t t-jquery="button.oe_list_add" t-operation="after">
<!-- Your button here -->
</t>
</t>
</template>

For FormView:

<t t-extend="FormView.buttons">
    <t t-jquery="button.oe_form_button_create" t-operation="after">
<button type="button">My button</button>
</t>
</t>
2
Avatar
Opusti
Sehrish

button.oe_form_button_create its not working in odoo15

Sehrish

xml:
<t t-name="library_management_system.my_test_button">
<button type="button" class="btn btn-secondary o_button_my_test">
My Test Button
</button>
</t>

<t t-extend="FormView.buttons" t-name="MyTestButtonFormView.buttons">
<t t-jquery="button.o_form_button_create" t-operation="after">
<t t-call="library_management_system.my_test_button"/>
</t>
</t>

.js code

odoo.define('library.rent.book.tree', function (require) {
"use strict";

var FormController = require('web.FormController');
var FormView = require('web.FormView');

var viewRegistry = require('web.view_registry');

function renderMyTestButton() {
if (this.$buttons) {
var self = this;
// var lead_type = self.initialState.getContext()['default_type'];
this.$buttons.on('click', '.o_button_my_test', function () {
self.do_action({
name: 'My Test Button',
type: 'ir.actions.act_window',
res_model: 'library.books',
target: 'new',
views: [[false, 'form']],
// context: {'is_modal': true, 'default_lead_type': lead_type},
});
});
}
}

var MyTestButtonFormController = FormController.extend({
willStart: function() {
console.log('-=-=-=-=-',this)
var self = this;
var ready = this.getSession().user_has_group('base.group_erp_manager')
.then(function (is_erp_manager) {
if (is_erp_manager) {
self.buttons_template = 'MyTestButtonFormView.buttons';
}
});
return Promise.all([this._super.apply(this, arguments), ready]);
},
renderButtons: function () {
this._super.apply(this, arguments);
renderMyTestButton.apply(this, arguments);
}
});

var MyTestButtonFormView = FormView.extend({
config: _.extend({}, FormView.prototype.config, {
Controller: MyTestButtonFormController,
}),
});

viewRegistry.add('library_rent_book_form_button', MyTestButtonFormView);

});

The issue is button not showing in form view header

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

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

Prijavi
Related Posts Odgovori Prikazi Aktivnost
View Override - Add attribute on action button
view inheritance button
Avatar
Avatar
Avatar
3
dec. 23
3635
How to replace Proforma Invoice template?
button template proforma
Avatar
0
jan. 21
4613
search_default does not work?.. Solved
view button search_default
Avatar
1
feb. 24
8646
[8.0] How to put a button at the label position? Solved
xml view button
Avatar
Avatar
1
apr. 17
4619
Display view from a button having type="object"
view button odooV8
Avatar
Avatar
Avatar
3
mar. 16
4758
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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 a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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