| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Point of Sale (point_of_sale)
• Sales (sale_management) • Discuss (mail) • Inventory (stock) • Invoicing (account) |
| Lines of code | 161 |
| Technical Name |
last_price_update |
| License | LGPL-3 |
| Versions | 17.0 18.0 19.0 |
🔄 Last Customer Price Update
One-click button to update Sale Order and POS line prices to the last price charged to the same customer — searches both SO and POS history automatically.
📋 Overview
Last Customer Price Update is an Odoo 17 module that adds a "Last Price" button to both Sale Orders and the Point of Sale interface. With one click, it looks up the most recent price charged to the same customer for each product on the order and updates all line prices accordingly.
The module searches across both confirmed Sale Orders and completed POS Orders to find the latest price, ensuring accurate pricing regardless of which channel the customer last purchased from. If no previous order is found for a product, the default Odoo price is kept.
This is especially useful for businesses with repeat customers who negotiate special prices, wholesale buyers, or any scenario where consistency in customer-specific pricing matters.
⭐ Key Features
- ✓ Sale Order Button: "آخر سعر / Last Price" header button updates all SO line prices in one click
- ✓ POS Button: "Last Price" control button on the POS Product Screen updates current order lines
- ✓ Cross-Channel Search: Finds prices from both Sale Orders and POS Orders — picks the most recent
- ✓ Customer-Specific: Prices are matched per customer + product combination
- ✓ Safe Fallback: If no previous price is found for a product, the default price is kept unchanged
- ✓ Confirmation Dialog: SO button asks for confirmation before updating to prevent accidental changes
- ✓ Manual Price Lock: In POS, updated prices are marked as "manual" so pricelists don't override them
- ✓ Arabic / English: Bilingual labels and error messages (Arabic + English)
- ✓ Draft & Sent Only: SO button is only visible on Draft and Sent quotations — not confirmed orders
- ✓ Smart Exclusion: When updating a SO, the current order is excluded from the price search
⚡ How It Works
When the button is clicked, the module performs a two-source search for each product on the order, picking the most recent price:
|
👤
Customer Selected Partner is set on order |
→ |
🔍
Search SO + POS Find last price per product |
→ |
📅
Pick Most Recent Compare dates, pick latest |
→ |
✅
Update Prices All lines updated at once |
Price Search Logic
| Source | Criteria | States Searched |
|---|---|---|
| Sale Orders | Same partner + same product, ordered
by create_date
desc |
sale,
done
(confirmed & locked)
|
| POS Orders | Same partner + same product, ordered
by create_date
desc |
paid,
done,
invoiced
|
📥 Installation
Requirements
| Requirement | Details |
|---|---|
| Odoo Version | 17.0 (Community & Enterprise) |
| Depends On |
sale_management,
point_of_sale
|
| Python Libraries | None (standard Odoo only) |
| License | LGPL-3 |
Steps
| 1 |
Upload the module Copy the last_price_update
folder into your Odoo addons directory (e.g. /mnt/extra-addons/).
|
| 2 |
Update app list Go to Apps → Update Apps List |
| 3 |
Install the module Search for "Last Customer Price Update" and click Install. |
| 4 |
Clear browser cache Press Ctrl+Shift+R
to load the POS button assets.
|
📝 Usage: Sale Orders
| 1 | Open or create a Sale Order (must be in Draft or Sent state). |
| 2 | Make sure a Customer is selected on the order. |
| 3 | Add products to the order lines as usual. |
| 4 | Click the 📜 آخر سعر / Last Price button in the header bar. |
| 5 | A confirmation dialog appears: "Update all line prices to the last price for this customer?". Click OK. |
| 6 | All order line prices are updated to the last price found. Lines with no history keep their original price. |
🛒 Usage: Point of Sale
| 1 | Open Point of Sale and start or resume a session. |
| 2 | Select a Customer on the current order. |
| 3 | Add products to the order. |
| 4 |
Click the 🕐 آخر سعر / Last Price control button.
(Button turns yellow/warning when a customer is selected, grey otherwise) |
| 5 | All order line prices are updated via an RPC call to the server. Prices are locked as "manual" so pricelists won't override them on quantity changes. |
🚨 Error Messages
The module provides clear bilingual feedback in both contexts:
| Scenario | Message | Where |
|---|---|---|
| No customer selected | "Please select a customer first. / يرجى اختيار العميل أولاً" | SO & POS |
| No price history found | "No previous prices found for this customer. / لم يتم العثور على أسعار سابقة لهذا العميل" | SO & POS |
❓ Frequently Asked Questions
Does it search POS orders, Sale Orders, or both?
Both. The module searches confirmed Sale Orders (sale/done) and
completed POS Orders
(paid/done/invoiced),
then picks the one with the most recent date.
What happens if a product has no previous price for this customer?
The product's line price is left unchanged — the default Odoo price (from pricelist or product) stays. Only lines with a match in history are updated.
Will the pricelist override the updated price in POS?
No. When the price is updated in POS, the line's price_type
is set to "manual",
which prevents Odoo from recalculating it when the quantity changes.
Does the current order's price get included in the search?
No. When updating a Sale Order, the current SO is excluded from the search
(via exclude_so_id)
to avoid self-referencing.
Why don't I see the button on a confirmed Sale Order?
By design, the button is only visible on Draft and Sent quotations. Once confirmed, the order is locked and the button is hidden to prevent accidental price changes.
The POS button is grey / doesn't work
The button requires a customer to be selected on the POS order. Once you set a customer,
the button turns yellow and becomes active. If still not working, clear browser cache
(Ctrl+Shift+R)
and restart the POS session.
🤝 Support
For questions, bug reports, or feature requests, please contact the module developer:
./odoo-bin
-u last_price_update -d your_databaseAlways clear browser cache and restart POS sessions after upgrading.
Please log in to comment on this module