Pular para o conteúdo
Odoo Menu
  • Entrar
  • Experimente grátis
  • Aplicativos
    Finanças
    • Financeiro
    • Faturamento
    • Despesas
    • Planilhas (BI)
    • Documentos
    • Assinar Documentos
    Vendas
    • CRM
    • Vendas
    • PDV Loja
    • PDV Restaurantes
    • Assinaturas
    • Locação
    Websites
    • Criador de Sites
    • e-Commerce
    • Blog
    • Fórum
    • Chat ao Vivo
    • e-Learning
    Cadeia de mantimentos
    • Inventário
    • Fabricação
    • PLM - Ciclo de Vida do Produto
    • Compras
    • Manutenção
    • Qualidade
    Recursos Humanos
    • Funcionários
    • Recrutamento
    • Folgas
    • Avaliações
    • Indicações
    • Frota
    Marketing
    • Redes Sociais
    • Marketing por E-mail
    • Marketing por SMS
    • Eventos
    • Automação de Marketing
    • Pesquisas
    Serviços
    • Projeto
    • Planilhas de Horas
    • Serviço de Campo
    • Central de Ajuda
    • Planejamento
    • Compromissos
    Produtividade
    • Mensagens
    • Aprovações
    • Internet das Coisas
    • VoIP
    • Conhecimento
    • WhatsApp
    Aplicativos de terceiros Odoo Studio Plataforma Odoo Cloud
  • Setores
    Varejo
    • Loja de livros
    • Loja de roupas
    • Loja de móveis
    • Mercearia
    • Loja de ferramentas
    • Loja de brinquedos
    Comida e hospitalidade
    • Bar e Pub
    • Restaurante
    • Fast Food
    • Hospedagem
    • Distribuidor de bebidas
    • Hotel
    Imóveis
    • Imobiliária
    • Escritório de arquitetura
    • Construção
    • Administração de propriedades
    • Jardinagem
    • Associação de proprietários de imóveis
    Consultoria
    • Escritório de Contabilidade
    • Parceiro Odoo
    • Agência de marketing
    • Escritório de advocacia
    • Aquisição de talentos
    • Auditoria e Certificação
    Fabricação
    • Têxtil
    • Metal
    • Móveis
    • Alimentação
    • Cervejaria
    • Presentes corporativos
    Saúde e Boa forma
    • Clube esportivo
    • Loja de óculos
    • Academia
    • Profissionais de bem-estar
    • Farmácia
    • Salão de cabeleireiro
    Comércio
    • Handyman
    • Hardware e Suporte de TI
    • Sistemas de energia solar
    • Sapataria
    • Serviços de limpeza
    • Serviços de climatização
    Outros
    • Organização sem fins lucrativos
    • Agência Ambiental
    • Aluguel de outdoors
    • Fotografia
    • Aluguel de bicicletas
    • Revendedor de software
    Navegar por todos os setores
  • Comunidade
    Aprenda
    • Tutoriais
    • Documentação
    • Certificações
    • Treinamento
    • Blog
    • Podcast
    Empodere a Educação
    • Programa de educação
    • Scale Up! Jogo de Negócios
    • Visite a Odoo
    Obtenha o Software
    • Baixar
    • Comparar edições
    • Releases
    Colaborar
    • Github
    • Fórum
    • Eventos
    • Traduções
    • Torne-se um parceiro
    • Serviços para parceiros
    • Cadastre seu escritório contábil
    Obtenha os serviços
    • Encontre um parceiro
    • Encontre um Contador
    • Conheça um consultor
    • Serviços de Implementação
    • Referências de Clientes
    • Suporte
    • Upgrades
    Github YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Faça uma demonstração
  • Preços
  • Ajuda

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

  • CRM
  • e-Commerce
  • Financeiro
  • Inventário
  • PoS
  • Projeto
  • MRP
All apps
É necessário estar registrado para interagir com a comunidade.
Todas as publicações Pessoas Emblemas
Marcadores (Ver tudo)
odoo accounting v14 pos v15
Sobre este fórum
É necessário estar registrado para interagir com a comunidade.
Todas as publicações Pessoas Emblemas
Marcadores (Ver tudo)
odoo accounting v14 pos v15
Sobre este fórum
Ajuda

Add button after Create and Import (Odoo11)

Inscrever

Seja notificado quando houver atividade nesta publicação

Esta pergunta foi sinalizada
viewbuttontemplate
2 Respostas
12248 Visualizações
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
Cancelar
Avatar
DHA Medic
Melhor resposta

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
Cancelar
Avatar
Hazem Mahmoud (Rising Systems AG)
Melhor resposta

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
Cancelar
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

Está gostando da discussão? Não fique apenas lendo, participe!

Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!

Inscreva-se
Publicações relacionadas Respostas Visualizações Atividade
View Override - Add attribute on action button
view inheritance button
Avatar
Avatar
Avatar
3
dez. 23
3630
How to replace Proforma Invoice template?
button template proforma
Avatar
0
jan. 21
4599
search_default does not work?.. Resolvido
view button search_default
Avatar
1
fev. 24
8645
[8.0] How to put a button at the label position? Resolvido
xml view button
Avatar
Avatar
1
abr. 17
4609
Display view from a button having type="object"
view button odooV8
Avatar
Avatar
Avatar
3
mar. 16
4735
Comunidade
  • Tutoriais
  • Documentação
  • Fórum
Open Source
  • Baixar
  • Github
  • Runbot
  • Traduções
Serviços
  • Odoo.sh Hosting
  • Suporte
  • Upgrade
  • Desenvolvimentos personalizados
  • Educação
  • Encontre um Contador
  • Encontre um parceiro
  • Torne-se um parceiro
Sobre nós
  • Nossa empresa
  • Ativos da marca
  • Contato
  • Empregos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidade
  • Segurança
الْعَرَبيّة 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 é um conjunto de aplicativos de negócios em código aberto que cobre todas as necessidades de sua empresa: CRM, comércio eletrônico, contabilidade, estoque, ponto de venda, gerenciamento de projetos, etc.

A proposta de valor exclusiva Odoo é ser, ao mesmo tempo, muito fácil de usar e totalmente integrado.

Site feito com

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