Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • e-learning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Conocimientos
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Cervecería
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y soporte técnico
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Explorar todos los sectores
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Servicios para partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyecto
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

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

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
4 Respuestas
12589 Vistas
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
Descartar
Avatar
Malik Imad Khan
Mejor respuesta

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
Descartar
Avatar
Adil Akbar
Mejor respuesta

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

Hope it helps,

Thanks

0
Avatar
Descartar
Avatar
Dương Nguyễn
Mejor respuesta

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
Descartar
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Mejor respuesta

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
Descartar
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?

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Inscribirse
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y totalmente integrado.

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