Przejdź do zawartości
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Sztuczna inteligencja
    • IoT
    • VoIP
    • Wiedza
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

Odoo 19 POS Pay Later – Need Review of Custom Implementation

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
javascriptpos
2 Odpowiedzi
1194 Widoki
Awatar
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
Awatar
Odrzuć
Awatar
Cybrosys Techno Solutions Pvt.Ltd
Najlepsza odpowiedź

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
Awatar
Odrzuć
Awatar
Muhammad Farooq Iqbal
Najlepsza odpowiedź

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
Awatar
Odrzuć
Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
I am customizing the POS receipt in Odoo 19.
javascript pos
Awatar
Awatar
1
cze 26
1164
Can anyone correct my code-iam coustmizing odoo 19 defualt pos reciept Rozwiązane
javascript pos
Awatar
Awatar
1
maj 26
1478
Odoo 19 POS Receipt Customization – Remove Default Unit Price and Show Custom MRP Line
javascript pos
Awatar
1
maj 26
1224
does odoo 17 allow to add button to Navbar header in point of sale session inside it to get dynamic data
javascript pos
Awatar
Awatar
1
lis 24
3787
How to add product in POS programmatically Rozwiązane
javascript pos
Awatar
Awatar
Awatar
Awatar
4
paź 24
7269
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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