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
    • Approvals
    • 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
    • Estate 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
    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

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
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

Hide discounts on order lines on quotations/invoices?

Subscribe

Get notified when there's activity on this post

This question has been flagged
discountquotationinvisible
1 Reply
10781 Views
Avatar
Wolfgang Steuer

Hi there,

I'm testing openerp since two weeks now and almost everything is fine so that we can use it in our company except for one fact:

I enabled "group_discount_per_so_line" in settings/sale. I created a quotation which has different discounts on certain order lines.

But when I print now the quotation, the user will see their discounts, which (in certain cases) should not be visible to the customer because our company sometimes gives negative discounts for certain customers.

The only way I found out to remove discounts, was to completely remove it from the report file (rml).

Another way I tried was to add another print action to the form with a different rml file which then shows the discounts again. But I does not matter which print button I use, it always takes the original rml report file.

I took a look in the code of the sale module, and it looks like, as soon as I enable per order line discounts, they will be visible in the report, no matter what.

When I use pricelists, I can say "visible discounts", when I uncheck this, this is only valid for pricelist discounts :(.

Is there a way to read this value "visible discounts" in the rml file, so that I can hide the per order line discounts as well?

Did anybody implement a (working) selection to print quotations with different rml files?

Thanks a lot!

My solution:

  1. I enabled developer mode (About OpenERP/Enable developer mode)
  2. I added a boolean field called "x_show_discounts" to sale.order
  3. I changed the rml of sale.order to check this field and if true, display discount otherwise hide it and reduce single prices:

...
<para style="terp_default_Right_9">[[ not o.x_show_discounts and formatLang(line.price_unit * (1 - line.discount / 100) , digits=get_digits(dp='Product Price')) or formatLang(line.price_unit , digits=get_digits(dp='Product Price'))]]</para>
...
<para style="terp_default_Centre_9">[[ o.x_show_discounts and formatLang(line.discount, digits=get_digits(dp='Discount')) or '']]</para>
...

The "line.price_unit * (1 - line.discount / 100)" is needed, otherwise the customer could calculate and see the discount again ...

Cheers

0
Avatar
Discard
Avatar
Brett Lehrer
Best Answer

You might want to try two completely separate reports (not just multiple RML files), and select between them based on what a particular field is set to. A good example of this is in the account_check_printing module:

http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/view/head:/account_check_writing/account_voucher.py

Check around line 61, the print_check function. So basically create a new module to inherit sale.order and add in a second report to hide the discounts and a boolean field on the partner to hide or unhide discounts in quotations. Then overwrite the report generating action with a button to check that partner and forward to the corresponding report.

0
Avatar
Discard
Wolfgang Steuer
Author

That sounds good. I will try it this weekend and keep you updated with my solution! Thx

Wolfgang Steuer
Author

I solved it in a different way, see my answer

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
Edit the Final Price in quotation lines and automatically update the discount Solved
accounting discount quotation
Avatar
Avatar
1
Oct 25
567
Adding Subtotal after discount in Quotation
sales discount subtotal quotation
Avatar
Avatar
Avatar
2
Aug 20
7909
Multiple lines in the quotation calculator
quotation
Avatar
0
Nov 25
967
Special rates for non profit organisations
discount
Avatar
Avatar
Avatar
2
Sep 25
1129
Design Quotation Template with dynamic variables
quotation
Avatar
0
Apr 25
3345
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 ภาษาไทย 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