Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita 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
  • Proyectos
  • 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

Identify the action for the print button on Inventory application

Suscribirse

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

Se marcó esta pregunta
actionsOdoo12.0
1 Responder
6436 Vistas
Avatar
Paulo Matos

Dear all,

I am working on Odoo 12 and having problems on accessing the code that prints the "report delivery slip".
Odoo has 2 basic reports under Stock Picking: Picking Operations (action_report_picking) and Delivery Slip (action_report_delivery)

For the Picking Operations I can see Odoo has a method for printing and also the corresponding action:

     @api.multi
     def do_print_picking(self):
          self.write({'printed': True})
          return self.env.ref('stock.action_report_picking').report_action(self)

    <report
        string="Picking Operations"
        id="action_report_picking"
        model="stock.picking"
        report_type="qweb-pdf"
        name="stock.report_picking"
        file="stock.report_picking_operations"
        print_report_name="'Picking Operations - %s - %s' % (object.partner_id.name or '', object.name)"
      />

For the Delivery Slip, I only see an action and cannot find the method that calls it:

     <report
        string="Delivery Slip"
        id="action_report_delivery"
        model="stock.picking"
        report_type="qweb-pdf"
        name="stock.report_deliveryslip"
        file="stock.report_deliveryslip"
        print_report_name="'Delivery Slip - %s - %s' % (object.partner_id.name or '', object.name)"
      />

When I access Inventory | Deliveries, I can see 2 buttons depending on the document state:
 - When in draft or assigned, I can see a Print button that calls the "do_print_picking" method and this is ok. This will call the action_report_picking action;
 - When the stock operation is on "done" state, I can see another Print button with an ID instead of a method. In this case, the ID=154. This button is printing the action_report_delivery which I need to access;

This ID = 154 method has the following code under the xml:

    <button name="154" string="Print" attrs="{'invisible': ['|', ('state', '!=', 'done'), ('is_locked', '=', False)]}" type="action" groups="base.group_user"/>

What I need to do is to execute a code when this "action_report_delivery" is executed and I do not know how to do it because I cannot access the action ID.

I cannot find any code under StockPicking py file that calls this action.

Can anyone help me please?

Thank you all in advance

Best regards

PM

0
Avatar
Descartar
Avatar
Paresh Wagh
Mejor respuesta

Hi Paulo:

As you have rightly mentioned, the Print button is dynamically mapped to an action based on the state of the Delivery.

When the Delivery Order is in the "done" state, the Print button directly runs the report. The id (154) is used by the built in report engine to figure out which action (stock.action_report_delivery) is to be run.

For your requirement, you will have to extend the Picking (stock.picking) class and add a method with your custom code which then invokes the stock.action_report_delivery action to print the Delivery Slip. You will also have to extend the form view to have the Print button call your custom method.

Another thing to think of in this case, you may need to remove the "Delivery Slip" from the Print menu since this will not call your custom code and you may not want the user using this after you put your customization in place.

1
Avatar
Descartar
Paulo Matos
Autor

Hello, @Paresh Wagh

Thank you very much for your help.

Following your thoughts I was able to achieve what I need.

It was a litle tricky to remove "%(action_report_delivery)d" from xml but the problem was on fact that I had to include the inherited module name.

I have entered "%(stock.action_report_delivery)d" and everything is ok now.

Thank you once again

Best regards

PM

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

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

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
Custom Dashboard using js
Odoo12.0
Avatar
Avatar
1
abr 25
4597
How to Limit Pos Category in Odoo 12 Shop?
Odoo12.0
Avatar
0
mar 24
1921
Why don't window action access rights work?
actions
Avatar
Avatar
1
oct 23
9442
Why is the product_id initiated by default_product_id is NOT available during saving.
Odoo12.0
Avatar
0
oct 22
3075
compare the lines in one2many fields
Odoo12.0
Avatar
0
sept 22
2382
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • 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 estar 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