Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Artificial Intelligence
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    • Referral Program
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

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

Subscribe

Get notified when there's activity on this post

This question has been flagged
salesdiscountV18
3 Replies
1703 Views
Avatar
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
Avatar
Discard
Avatar
Codesphere Tech
Best Answer

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
Avatar
Discard
Avatar
Jainesh Shah(Aktiv Software)
Best Answer

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
Avatar
Discard
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

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
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
ENTREPRISE V18-Automatic draft Delivery Notes on Sales Orders causing sequence gaps and date inconsistencies
sales V18
Avatar
Avatar
1
Dec 25
1607
About Total Discount Solved
sales discount
Avatar
Avatar
2
Jul 25
2714
Order Level Discount Based On Dollar Amount or Weight Of Items
sales discount
Avatar
Avatar
Avatar
2
May 25
2648
Deliverynote for customer with price and discount
sales deliverynote V18
Avatar
Avatar
1
Dec 25
1208
Discount rules
sales discount sale.order
Avatar
0
Nov 25
3
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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