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

Prevent Order Picking Creation in Point of Sale (POS)

Suscribirse

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

Se marcó esta pregunta
stock_pickingpoint_of_sale17.0
1 Responder
2012 Vistas
Avatar
Ing. Ang3l Barrera

Hello everyone,

I'm currently facing an issue where confirming a sale from the Point of Sale (POS) automatically generates an order picking (outgoing transfer). My requirement is to prevent the creation of the order picking while allowing the rest of the POS workflow to function as expected.


What I’ve Done So Far

To address this, I created a custom module that inherits the pos.order model and overrides the following methods:

  1. _create_order_picking
  2. _process_saved_order
  3. _process_order

Initially, I only overrode the _create_order_picking method. However, the issue persisted because other parts of the POS flow, like _process_saved_order and _process_order, still indirectly triggered the creation of the picking.

from odoo import models, api, _
import logging

class PosOrderInherit(models.Model):
    _inherit = 'pos.order'
    _logger = logging.getLogger(__name__)

    def _create_order_picking(self):
        """
        Avoid the creation of outgoing order pickings.
        """
        self.ensure_one()
        if self.config_id.picking_type_id:
            picking_type = self.config_id.picking_type_id
            self._logger.info(f"Picking type: {picking_type.code}")
            if picking_type.code == 'outgoing':
                self._logger.info("Picking type is outgoing, skipping picking creation.")
                return  # Do nothing, skip creation
        super(PosOrderInherit, self)._create_order_picking()

    def _process_saved_order(self, draft):
        """
        Skip saved order processing for outgoing picking types.
        """
        self.ensure_one()
        if self.config_id.picking_type_id:
            picking_type = self.config_id.picking_type_id
            self._logger.info(f"Processing saved order, picking type: {picking_type.code}")
            if picking_type.code == 'outgoing':
                self._logger.info("Skipping processing of saved order for outgoing type.")
                return self.id  # Return the current order ID
        return super(PosOrderInherit, self)._process_saved_order(draft).id

    @api.model
    def _process_order(self, order, draft, existing_order):
        """
        Skip processing if the picking type is outgoing.
        """
        pos_session = self.env['pos.session'].browse(order['data']['pos_session_id'])
        if pos_session.state in ('closing_control', 'closed'):
            order['data']['pos_session_id'] = self._get_valid_session(order['data']).id

        if order['data'].get('partner_id'):
            partner_id = self.env['res.partner'].browse(order['data']['partner_id'])
            if not partner_id.exists():
                order['data'].update({
                    "partner_id": False,
                    "to_invoice": False,
                })

        pos_order = existing_order or self.create(self._order_fields(order['data']))
        pos_order._link_combo_items(order['data'])
        pos_order = pos_order.with_company(pos_order.company_id)
        self = self.with_company(pos_order.company_id)
        self._process_payment_lines(order['data'], pos_order, pos_session, draft)

        pos_session._remove_capture_content(order['data'])

        if pos_order.config_id.picking_type_id.code == 'outgoing':
            self._logger.info("Order is outgoing. Skipping further processing.")
            return pos_order.id

        return pos_order._process_saved_order(draft).id

The Issue

  1. Despite these changes, the order picking is still being generated under certain conditions.
  2. I’ve confirmed that the overridden methods execute as intended (verified through logs), but the picking still appears.


Question

Is there another part of the POS workflow (or another method) that might be generating the order picking after _process_order and _process_saved_order?

Am I missing something in my approach, or is there a better way to completely skip the creation of the order picking while keeping the POS flow functional?

Any suggestions or insights will be greatly appreciated!

0
Avatar
Descartar
Avatar
Niyas Raphy (Walnut Software Solutions)
Mejor respuesta

Hi,
How about changing the product type to service ? will that solve your issue ?

Thanks

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

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

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
V9: Delivery order generated via POS for 'Delivery-Only' products
stock_picking point_of_sale v9
Avatar
0
oct 16
5006
Odoo 17 - Show new field in POS receipt Resuelto
reciept point_of_sale Point Of Sale 17.0
Avatar
Avatar
1
sept 25
4642
Can't close POS Session Validation Error Odoo 16 Resuelto
pos stock_picking transfer point_of_sale
Avatar
1
ene 25
3733
Can not create stock picking in Poin of Sale
pos stock_picking point_of_sale 10.0
Avatar
Avatar
Avatar
Avatar
4
ago 18
6701
in POS orderline is it possible to add background color to the discounted product line
17.0
Avatar
Avatar
1
nov 25
395
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 empresariales de código abierto que cubre 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