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

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
2044 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.

Registrarse
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
5021
Odoo 17 - Show new field in POS receipt Resuelto
reciept point_of_sale Point Of Sale 17.0
Avatar
Avatar
1
sept 25
4666
Can't close POS Session Validation Error Odoo 16 Resuelto
pos stock_picking transfer point_of_sale
Avatar
1
ene 25
3765
Can not create stock picking in Poin of Sale
pos stock_picking point_of_sale 10.0
Avatar
Avatar
Avatar
Avatar
4
ago 18
6714
in POS orderline is it possible to add background color to the discounted product line
17.0
Avatar
Avatar
1
nov 25
418
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.

Sitio web hecho con

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