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

V18: Discount resets to 0 when changing quantity on sales order line

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
salesdiscountV18
3 Odpowiedzi
1817 Widoki
Awatar
Benjamin Waroquier

Hello,

I am experiencing an issue on Odoo v18 (Enterprise, Odoo.sh).

When I set a discount (%) on a sales order line and then modify only the quantity, the discount is automatically reset to 0.

Steps to reproduce:

  1. Create a quotation
  2. Add a product
  3. Enter a discount (e.g. 10%)
  4. Save
  5. Change only the quantity on the same line

Result: the discount is reset to 0

Expected: the discount should remain unchanged if only the quantity is modified

This behavior is problematic for our users, as they often adjust quantities after applying commercial discounts.

I found a similar issue reported on OCB (issue #1300), so I’m wondering:

  • Is this a known bug in Odoo 18?
  • Is there a standard setting or workaround to prevent this?
  • Has anyone implemented a clean fix (without heavy customization)?

Any feedback would be greatly appreciated.

Thank you!

0
Awatar
Odrzuć
Awatar
Codesphere Tech
Najlepsza odpowiedź

Hello,
It is due to Pricelist on Sale order.
Method: def _compute_discount(self):
Explanation:
When you change a Quantity, Odoo automatically re-calculates the line to check if the Pricelist has a specific rule for that new amount. Since your manual discount isn't a "rule" in the Pricelist, Odoo resets the field to 0% to match its official records.

Hope this helps
Thanks
info@codespheretech.in

0
Awatar
Odrzuć
Awatar
Jainesh Shah(Aktiv Software)
Najlepsza odpowiedź

Hello Benjamin Waroquier,

This behavior usually occurs due to the Pricelist configuration.

When a Pricelist is applied to the Sales Order, Odoo recalculates the price and discount based on the pricelist rules whenever you modify certain fields like quantity. As a result, the manually entered discount gets reset and replaced by the discount defined in the pricelist.

However, if no pricelist is applied, Odoo will keep the manually entered discount unchanged when you modify the quantity.

So this is not necessarily a bug, but rather expected behavior when a pricelist with discount rules is active.

You may check:

  • If a pricelist is applied on the Sales Order
  • Whether the pricelist contains discount rules
  • If the "Discount Policy" in the pricelist affects how discounts are applied

As a workaround, you can:

  • Remove the pricelist, or
  • Adjust the pricelist configuration depending on your needs

If you have any questions, feel free to reach out.

Hope this helps!

 

Thanks and Regards,

Email: odoo@aktivsoftware.com

0
Awatar
Odrzuć
Awatar
Cybrosys Techno Solutions Pvt.Ltd
Najlepsza odpowiedź

Hi,

Changing the quantity on a sale order line triggers the product_id_change onchange method, which recomputes the unit price and the discount based on the pricelist rules for the new quantity. This is by design in Odoo's core because pricelist rules can be quantity-dependent (e.g., 10% discount for qty > 10). However, the side effect is that any manually entered discount is wiped out, which is the problem you are hitting.

Workarounds and fixes:
Option 1 — OCA Module (cleanest, no heavy customization)
sale_order_qty_change_no_recompute (https://apps.odoo.com/apps/modules/17.0/sale_order_qty_change_no_recompute)— this module prevents recomputing the unit price, discount, and pricelist item fields if only the quantity on a sales order line has changed.
Note: It is not available for Odoo 18. So, you must migrate it with small changes.

Option 2 — Use Pricelists instead of manual discounts

If your team always applies the same discount to a customer, set it directly on the customer pricelist rather than entering it manually on each line. Pricelist-based discounts survive quantity changes because the onchange recomputes them correctly.


Hope it helps

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ść
ENTREPRISE V18-Automatic draft Delivery Notes on Sales Orders causing sequence gaps and date inconsistencies
sales V18
Awatar
Awatar
1
gru 25
1743
About Total Discount Rozwiązane
sales discount
Awatar
Awatar
2
lip 25
2867
Order Level Discount Based On Dollar Amount or Weight Of Items
sales discount
Awatar
Awatar
Awatar
2
maj 25
2788
Deliverynote for customer with price and discount
sales deliverynote V18
Awatar
Awatar
1
gru 25
1340
Discount rules
sales discount sale.order
Awatar
0
lis 25
3
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