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 taberna
    • 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
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • 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

Help review canceling purchase code

Suscribirse

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

Se marcó esta pregunta
codereview
2 Respuestas
5665 Vistas
Avatar
Ben Bernard

https://github.com/odoo/odoo/blob/b55cd571f522ae4ebf94ae4ac4924e6de50c13a0/addons/purchase/purchase.py#L684

  • should it be move.state, instead of pick.state?
  • and what about the case when user return some/all products?
0
Avatar
Descartar
Avatar
Ludo - 21South
Mejor respuesta

Typically, from the functional point of view, you can receive either all, none or some of the goods you ordered. There is also the option for the supplier to provide half of the goods in one go and the other half on backorder. So ultimately it is pretty hard to determine what has or has not been delivered yet and how you should handle the PO afterwards.

If you want to cancel the PO and base the decision on wheter or not goods have been delivered, you will have to decide if you should be able to cancel if a part of the order has already been delivered. If this is the case, use the related order moves. If you want only the entire to cancel, you should base that decision on the picking. Remember, 1 picking order can still hold 1 or more move lines related to a purchase order.

 

Note: This reasoning will only work if standard Odoo functionality is used. If you somehow modified the PO process, this might no longer be valid.

0
Avatar
Descartar
Ben Bernard
Autor

My issue is that in default code (and configuration) there is no way to cancel PO if some stock picking (incoming shipment) already done. I think it should be still can be cancelled as long as the incoming shipment is returned and process the delivery order (until 'done'). I update the code with that logic, but I'm still not sure the effect functionally.

Ludo - 21South

Partially agree with you there. The thing is prob. what we mean by the term "cancel". In my opinion it means something like "never happened". In that case and your situation, the PO did happen, which is proven by the items sent to you. If you return the items, still the original PO has taken place and I would personally therefore never cancel it. Unfortunately I can't think of an suitable alternative solution to this problem.

Avatar
Ben Bernard
Autor Mejor respuesta

If anyone have the same issue, I update the code and you can check it from the following gist.

https://gist.github.com/bbn-bernard/87a0f46af030e3d459e1

That code will allow you to cancel PO if it already have some shipment 'done' and returned all the shipment ('done').

That code cover the following use cases:

  • PO already have some delivery 'done', but suddendly the supplier have no stock of the remaining product in PO lines
  • user mistakenly add wrong product in PO lines, but some delivery already 'done'

 

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
Help me with this code.
code review
Avatar
Avatar
Avatar
2
jul 24
2199
.update() method not updating values
code
Avatar
0
sept 23
2614
Why is the hr.attendance date column called "name"?
code
Avatar
0
ago 16
4962
How to refresh the form view in coding in openerp 7?
code
Avatar
0
mar 15
5429
line code.
code
Avatar
0
jul 24
3437
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