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

How to dynamically personalize the name of a file downloaded from Odoo?

Subscribe

Get notified when there's activity on this post

This question has been flagged
filequickstartQuickstart
2 Replies
1772 Views
Avatar
Abraham Ismael Torales Salazar (aits)

Is there a way to customize the name of the files I download from Odoo automatically, in order to, for example, add the name of the client?

0
Avatar
Discard
Avatar
Abraham Ismael Torales Salazar (aits)
Author Best Answer
  1. Enable developer mode from settings
  2. Enter Studio and open the report you want to edit. Click on "More".


Note: If you don’t have Studio you can look for the report inside the "Reports" model. Use CNTRL + K + "/" to look for this model.


3. Change “Printed Report Name” field

Example: 'Sale number ' + (object.name) + ' for ' + (object.partner_id.name)

Here you can use python expressions


Explanation of the structure:

  • Use quotes ('') in case you want to add specific text
  • Use “+” to concatenate different elements
  • Use object.field between parenthesis to specify a field to use. Make sure to use the technical name of the field

Or  

  • Put all the text between quotes (''), 
  • Inside this same text, specify the fields using “%s”, 
  • Add “%” out of the quotes 
  • Add all the technical names of the fields between parenthesis (adding “object”, and separated by commas as shown below)


Example: 'Sale number %s for %s' % (object.name, object.partner_id.name)


Note that you can retrieve fields from inside other related records like the name of the client in a sale order (object.partner_id.name), just make sure which fields are available in the corresponding model and use the technical name. You can even use new fields added with studio!


Tip: Enable developer mode from settings to see the technical name of the fields when positioning the mouse over the “?” symbol


Result of the example showed above: 


⚠️

Warning: If not done correctly, it will cause an error when trying to download the file


5
Avatar
Discard
Avatar
Vicente Gramuntell Bayarri (vigb)
Best Answer
If you are paying Studio:
  1. Open Studio in the model where is located the file:


2. Select the report

3. In developer mode, click on "more":

4. In this case, I am going to add the name of the client/provider:

(object.state in ('posted', 'sent') and 'Invoice_'  + (object.name)  +  '-'  + (object.partner_id.name))


Without Studio:


  1. Go to Settings/Technical/Actions/Reports
  2. Select the report:

This one is for invoices.


3
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
How do I connect the Epson TM-T88VII to Odoo?
quickstart Quickstart
Avatar
Avatar
2
Oct 25
1083
How to Set Customer-Specific Product Names Solved
quickstart Quickstart
Avatar
1
Nov 25
1711
✅ Odoo E-commerce: How to discriminate deliveries based on the type of clients
quickstart Quickstart
Avatar
0
Aug 25
1553
How can Import an existing Spreadsheets with formulas with out doing it manually? Solved
quickstart Quickstart
Avatar
2
Aug 25
2049
Does Odoo manage WebP ? Solved
quickstart Quickstart
Avatar
Avatar
Avatar
3
Jul 25
4812
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