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

'Save as attachment prefix' doesn't work?

Subscribe

Get notified when there's activity on this post

This question has been flagged
reports
4 Replies
10512 Views
Avatar
nazarii

I'm currently using v 6.1. If i go to reports and fill field 'Save as attachment prefix' i. e. 'SO' next time i print this report it still has old name even after server restart. After investigation it appears that filename comes from Service name defined in report and this Service is registered each time you start the server. I tried to change this filename , even had success but the problem is that my code is rewriting report_name field each_time you print it and filename appears with one step back. Does anyone faced the same problem? Any help will be appreciated.

1
Avatar
Discard
evon_dun

how did you give the prefix name?

Avatar
Tilfried Weissenberger
Best Answer

having similar problem. the value from the field "Save as Attachment Prefix" is never used. Actually the PDF should also be persisted to the "Attachments", if a prefix is specified, but also this doesn't work.

my prefix for a Purchase Order is: ((object.name) + '_' + (object.state) + '_' + (time.ctime()) + ('.pdf'))

but I also tried a simple one like ('PO.pdf')

1
Avatar
Discard
Avatar
Michel Hugues
Best Answer

For pyhon shell syntax training, try this:

pyhon
>>> import time
>>> print "%s" % time.ctime()                               >>Sun Sep  7 22:05:46 2014
>>> print "%s" % time.ctime().split()[4]                >>2014
CTRL-D for quit shell

 

For attach pdf Sale Order in state 'progress' or 'manual' or 'done' with name 'SO001-2014.pdf', my prefix is:

(object.state in ('progress','manual','done')) and ((object.name or '').replace('/','')+'-'+ time.ctime().split()[4] +'.pdf')

 

 

0
Avatar
Discard
Luke Branch

@Michel,

Thanks, your prefix helped me partially get where I wanted to go in 8.0, however i'd like to ask if you know if it is possible to create a custom filename in this manner for printing in Aeroo Reports.

What I would like to do is have the Document state (eg. PO), document number (eg. 123456), and then a date/timestamp of when it was printed (eg. 2015-04-18#11_45) as the filename. So in my example above:

PO_123456_2015-04-18#11_45.xls

I'm just getting to grips with Aeroo, and it's an awesome little reporting engine, but I haven't managed to figure out this one yet. If you have time, any insight or advice would be very appreciated.

Avatar
Claudio Candito
Best Answer

please try with something like this:

(object.state in ('draft','approved')) and ('RfQ_'+(object.name + '_' + time.ctime()).replace('/','')+'.pdf')

Regards

claudio

0
Avatar
Discard
Avatar
Bole
Best Answer

I had simmilar problem, and finaly foud it out to be a strange bug... On fist print the document name is rendered correct, and stored with correct name, but the file that is downloaded after fisrt rendering is having OLD name value, so the first time you download the attachment it has wrong filename. Also, after downloading, check the name of attachment (clicking on attachments button on top of document page and there the name of document shows up corectly)... 
Instead of rewriting javascript that downloads the document, i just discard the first download, and download it againg from attachment so it gets the desired filename.. 
 

 

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
Code for page number in Body of Pdf report
reports
Avatar
Avatar
Avatar
2
Oct 25
3336
How to increase the width of a column on odoo quotation PDF?
reports
Avatar
Avatar
1
Oct 25
1127
Odoo Online (SaaS 18.4 Enterprise) – How to modify invoice report header without affecting other reports but keep default table content
reports
Avatar
Avatar
1
Aug 25
1799
Odoo .SH V17 how do I migrate a report from staging to production?
reports
Avatar
Avatar
1
Apr 25
2440
List of Sales in a Report
reports
Avatar
Avatar
1
Jul 24
2785
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