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
    • 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
    • Inteligencia artificial
    • IoT
    • VoIP
    • Información
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Sectores
    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
    • Asesoría 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 corporativos
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Oficios
    • Servicios de mantenimiento
    • 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 vallas publicitarias
    • 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 asesoría 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
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Sobre este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Sobre este foro
Ayuda

Odoo 19 POS Pay Later – Need Review of Custom Implementation

Suscribirse

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

Esta pregunta ha sido marcada
javascriptpos
2 Respuestas
1190 Vistas
Avatar
Ashilkrishna

Hi everyone,

I am developing a custom "Pay Later" feature for Odoo POS (Odoo 19 )

My goal is:

  • Add a "Pay Later" button in the POS Payment Screen
  • Allow saving POS orders without immediate payment
  • Store a Boolean field is_pay_later in pos.order
  • Filter Pay Later orders from backend POS Orders

I have implemented:

  • Python model inheritance for pos.order
  • Frontend Order model patch
  • PaymentScreen patch
  • XML template inheritance
  • Backend form and search view inheritance
# -*- coding: utf-8 -*-
{
'name': 'POS Pay Later',
'version': '19.0.1.0.0',
'category': 'Point of Sale',
'summary': 'Allows POS orders to be paid at a later time.',
'description': """
This module adds a "Pay Later" functionality to the Point of Sale.
- A "Pay Later" button is added to the payment screen.
- Orders can be submitted without immediate payment.
- "Pay Later" orders can be retrieved and paid for at a later time.
""",
'author': 'ashil',
'website': 'https://yourwebsite.com',
'depends': ['point_of_sale'],
'data': [
'views/pos_order_views.xml',
],
'assets': {
'point_of_sale.assets': [
'zl_pos_pay_later/static/src/app/**/*',
],
},
'installable': True,
'application': True,
}
# -*- coding: utf-8 -*-
from odoo import api, fields, models

class PosOrder(models.Model):
_inherit = 'pos.order'

is_pay_later = fields.Boolean(
string='Is Pay Later',
default=False,
help="Indicates if this order was marked to be paid later."
)

@api.model
def _order_fields(self, ui_order):
# Override to extract the 'is_pay_later' flag from the frontend order data
order_fields = super(PosOrder, self)._order_fields(ui_order)
order_fields['is_pay_later'] = ui_order.get('is_pay_later', False)
return order_fields
/** @odoo-module */

import { PaymentScreen } from "@point_of_sale/app/screens/payment_screen/payment_screen";
import { patch } from "@web/core/utils/patch";
import { ConfirmPopup } from "@point_of_sale/app/utils/confirm_popup/confirm_popup";

patch(PaymentScreen.prototype, {
async validateOrder(isForceValidate) {
// If the order is marked as "Pay Later", skip payment validation
if (this.currentOrder.is_pay_later) {
// Bypass payment checks and directly create the order
this.env.services.pos.push_orders(this.currentOrder, { show_error: true });
// Show a confirmation popup
await this.popup.add(ConfirmPopup, {
title: this.env._t("Order Saved"),
body: this.env._t("The order has been saved and will be paid later."),
});
// Go to the next screen (receipt or product screen)
this.pos.showScreen(this.pos.getNextScreen());
return;
}
// Otherwise, proceed with the standard validation
return super.validateOrder(...arguments);
},

async clickPayLater() {
// Set the 'is_pay_later' flag on the current order
this.currentOrder.is_pay_later = true;
// Trigger order validation
await this.validateOrder(false);
},
});
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-name="zl_pos_pay_later.PaymentScreen" t-inherit="point_of_sale.PaymentScreen" t-inherit-mode="extension" owl="1">
<xpath expr="//div[hasclass('payment-buttons')]" position="inside">
<button class="btn btn-lg btn-secondary" t-on-click="clickPayLater">
Pay Later
</button>
</xpath>
</t>
</templates>
/** @odoo-module */

import { Order } from "@point_of_sale/app/models/order";
import { patch } from "@web/core/utils/patch";

patch(Order.prototype, {
setup() {
super.setup(...arguments);
this.is_pay_later = this.is_pay_later || false;
},

export_as_JSON() {
const json = super.export_as_JSON(...arguments);
json.is_pay_later = this.is_pay_later;
return json;
},

init_from_JSON(json) {
super.init_from_JSON(...arguments);
this.is_pay_later = json.is_pay_later;
},
});
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Add 'is_pay_later' to POS Order Form View -->
<record id="view_pos_pos_form_inherit_pay_later" model="ir.ui.view">
<field name="name">pos.order.form.inherit.pay.later</field>
<field name="model">pos.order</field>
<field name="inherit_id" ref="point_of_sale.view_pos_pos_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="after">
<field name="is_pay_later" readonly="1"/>
</xpath>
</field>
</record>

<!-- Add filter for Pay Later orders -->
<record id="view_pos_order_filter_inherit_pay_later" model="ir.ui.view">
<field name="name">pos.order.list.select.inherit.pay.later</field>
<field name="model">pos.order</field>
<field name="inherit_id" ref="point_of_sale.view_pos_order_filter"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='invoiced']" position="after">
<filter string="Pay Later" name="pay_later" domain="[('is_pay_later', '=', True)]"/>
</xpath>
</field>
</record>
</data>
</odoo>

Could someone please review whether my implementation approach is correct.

1
Avatar
Descartar
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Mejor respuesta

Hi,

Your implementation approach is generally correct. In Odoo POS, an order is considered paid only when the total payment amount covers the order total. If you want a Pay Later feature, the recommended approach is to create a dedicated payment method (for example, "Customer Account" or "Pay Later") and record the unpaid amount as a receivable linked to the selected customer, similar to how customer account payments work in POS.

A few points to review:

  • Make sure a customer is mandatory before allowing Pay Later, otherwise there is no partner to track the outstanding balance.
  • Verify that the accounting entries post the remaining amount to a receivable account rather than marking the order as fully paid.
  • Consider reusing or extending the existing Customer Account payment flow instead of bypassing the POS payment validation logic, as Odoo already supports customer balances and settlement later.
  • Ensure that subsequent payments can be reconciled against the outstanding receivable and that the customer's due amount is visible in both POS and Accounting.
  • Test edge cases such as partial payments, refunds, session closing, and invoiced orders to confirm the receivable balance remains consistent.

If your customization follows the standard receivable/accounting flow rather than simply forcing order validation with an unpaid balance, it will be much easier to maintain and will remain compatible with future Odoo upgrades.


Hope it helps

0
Avatar
Descartar
Avatar
Muhammad Farooq Iqbal
Mejor respuesta

Your approach is directionally correct, but I would not recommend bypassing the standard validateOrder() flow directly.

In POS, an order normally needs a payment line to be validated properly. If you save the order without payment, you may face issues with order state, receipt screen, accounting entries, and later payment reconciliation.

A safer approach is:

  1. Create a dedicated POS payment method called Pay Later or Customer Account.

  2. Add a payment line using that payment method.

  3. Mark the order with your custom Boolean is_pay_later = True.

  4. Let Odoo run the normal validateOrder() process.

  5. Filter those orders in the backend using your custom field.

This way, Odoo still creates the order through the standard POS flow, and your customization only identifies it as Pay Later.

Also, make sure your JS asset key is correct for Odoo 19 POS assets, and avoid using this.env.services.pos.push_orders() directly unless you are sure the API is still the same in your version.

In short: keep the standard payment/validation flow and add a special payment method + Boolean flag instead of skipping payment validation completely.

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
I am customizing the POS receipt in Odoo 19.
javascript pos
Avatar
Avatar
1
jun 26
1162
Can anyone correct my code-iam coustmizing odoo 19 defualt pos reciept Resuelto
javascript pos
Avatar
Avatar
1
may 26
1472
Odoo 19 POS Receipt Customization – Remove Default Unit Price and Show Custom MRP Line
javascript pos
Avatar
1
may 26
1221
does odoo 17 allow to add button to Navbar header in point of sale session inside it to get dynamic data
javascript pos
Avatar
Avatar
1
nov 24
3785
How to add product in POS programmatically Resuelto
javascript pos
Avatar
Avatar
Avatar
Avatar
4
oct 24
7266
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 Svenska ภาษาไทย 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