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
    • Affiliate Program
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Productivity
  3. Attachment Size Limit v 20.0
  4. Sales Conditions FAQ

Attachment Size Limit

by Awins
Odoo

$ 86.56

v 20.0 Third Party
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Versions 16.0 17.0 18.0 19.0 20.0
You bought this module and need support? Click here!
Versions 16.0 17.0 18.0 19.0 20.0
  • Description
  • Manifest
  • License
Apps / Awins / attachment_upload_size_rule

Attachment Size Limit

Set a max file size and the allowed file types per model and per user group, refuse anything else on the server with a message that names the file, and keep a log of every refused upload.

Install›Configure›Use
/odoo/contacts/16 · signed in as Marc Demo, attaching a 7.4 MB scan
Attachment Size Limit in the Odoo backend
Odoo17.0, 18.0, 19.0, 20.0
EditionsCommunity, Enterprise
Works withDiscuss (mail) and General Settings (base_setup). The rules work on any model with attachments; the screenshots use Contacts.
LicenceOPL-1, 79 EUR
Tests10 automated, run on every version
Moduleattachment_upload_size_rule

The situation

Standard Odoo has one upload limit for the whole database (web.max_file_upload_size, 128 MB by default) and no file type check. A salesperson drops a 48 MB phone video on a contact, someone attaches setup_drivers.exe to a vendor, and the filestore and the backups grow every week. Nobody sees it happen, because nothing refuses the file and nothing records it.

With the module you write upload rules: Contacts take PDF and images up to 5 MB, administrators get 10 MB there, every employee gets 20 MB elsewhere. The server picks the most specific rule for the document and the user, refuses a file that breaks it with a message such as "signed_contract_scan.pdf is 7.4 MB, larger than the 5 MB allowed on Contact by the rule Contacts: PDF and images up to 5 MB", and writes a line in Rejected Uploads.

What it adds

Attachment Upload Rules
Rules per model, group and company
Each rule has a Model, User Groups, a Company, Max Size (MB), Allowed Extensions and Allowed MIME Types (image/* works). Leave Model or User Groups empty to cover every model or every user.
Without it: Standard Odoo has a single size limit for all files, all users and all documents, and accepts any file type.
Scope
The most specific rule wins
A rule with a model and groups beats a rule with only a model, which beats a rule with only groups, which beats the default rule. Between equals, a company rule comes first, then the lowest sequence.
ir.attachment
Checked on the server
The check runs when an attachment is created or its content replaced, so it covers the chatter, the attachment fields on forms, the Attachments menu and files sent through the API. The error names the file, its size or type, the limit, the document type and the rule.
Attach files
Refused before the upload
The chatter asks the server about the file first. A refused file shows a red Upload refused notice at once instead of uploading for a minute and failing at the end.
Rejected Uploads
Log of refused files
Date, user, document type, record, file name, size, reason (File too large or File type not allowed), limit and rule. Group by user, model or rule, and open the list from the rule with the Rejected Uploads button.
Keep Rejected Uploads
Daily cleanup
A scheduled action deletes log lines older than the number of days you set (30 after install). 0 keeps them all.
Administrators Bypass Rules
Optional bypass for admins
When ticked, members of Settings (Administration) can upload any file. Code that runs as the superuser, such as most scheduled actions and OdooBot, is never stopped.
skip_attachment_upload_rule
Server files are left alone
Report PDFs, files from incoming emails and email templates, image and binary fields, asset bundles and website pages are not uploads and are never blocked. Your own code can pass this context key to skip the check.

Getting started

Install

Open Apps, clear the Apps filter, search for Attachment Size Limit and click Activate. It needs Discuss (mail) and General Settings, which install with it if they are missing. No rule exists after install, so nothing changes until you create one.

Apps › attachment_upload_size_rule › Activate
Configure

Open Settings, find Attachment Uploads and click Upload Rules. Create a rule, pick the Model and User Groups it applies to (or leave them empty), and set Max Size (MB), Allowed Extensions such as pdf, docx, xlsx, and Allowed MIME Types such as image/*. Leave both type lists empty to accept any type. In the same block, choose whether administrators bypass the rules and how many days Rejected Uploads keeps its lines.

Settings › General Settings › Attachment Uploads Settings for Attachment Size Limit
Use

Users attach files as they always do. A file that fits the rule goes through. A file that is too large or of a type the rule doesn't list is refused with the reason, and the refusal shows up in Settings › Technical › Attachment Uploads › Rejected Uploads, where you can see who tried what and adjust a rule if it is too strict.

The rules list on Odoo 20: scope, model, user groups and the limit of each rule, with the number of refused files.
The rules list on Odoo 20: scope, model, user groups and the limit of each rule, with the number of refused files.
Rejected Uploads: who tried to attach which file, where, how large, and the rule that refused it.
Rejected Uploads: who tried to attach which file, where, how large, and the rule that refused it.

Fine print

Which rule applies when several match?
The most specific one: model and groups, then model, then groups, then the default rule without model and groups. Archived rules and rules of another company are ignored. The Scope column shows the level of each rule.
Are images measured before or after Odoo shrinks them?
Before. The size checked is the size of the file the user picked, so the number in the message is the one they see in their file browser.
Do email attachments and printed PDFs count?
No. Files that arrive by email, report PDFs saved as attachments and the files an email template generates are created by the server and skip the rules. Only files a user uploads are checked.
Where can I run it?
On Odoo.sh and on your own server, Community or Enterprise, versions 17.0 to 20.0. Odoo Online doesn't accept third-party modules.
What doesn't it do?
It checks attachments, not binary fields: a file stored in a Binary or Image field of a model (a product image, a document field on a custom model) is not limited. It reads the file type from the extension and the content the server sees; it does not scan files for viruses or check what is inside a ZIP. The early check in the chatter is a convenience; the attachment fields on forms upload first and get the refusal from the server. It does not change the global web.max_file_upload_size, and it does not delete or shrink files that were attached before a rule existed.
Can you adapt it for us?
Yes. Email odoo.expert.111@gmail.com with your Odoo version and what you'd like changed.

Log

20.0.1.0.0 · Oct 2026
First release, published for Odoo 17.0 to 20.0.

Can a rule also cover the files in a binary field?

Tell us the model and the field, and we will tell you whether the same rule check fits it.

Email odoo.expert.111@gmail.com
QR code: email Awins about this module

Also by Awins

Stock Analytic Accounting Stock Analytic Accounting stock_move_analytic_distribution
Project Member Access Project Member Access project_member_only_access
Product Label Designer Product Label Designer product_label_designer
Awins builds small Odoo modules that do one job. attachment_upload_size_rule · 20.0.1.0.0
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies Discuss (mail)
Lines of code 659
Technical Name attachment_upload_size_rule
LicenseOPL-1
Odoo Proprietary License v1.0

This software and associated files (the "Software") may only be used (executed,
modified, executed after modifications) if you have purchased a valid license
from the authors, typically via Odoo Apps, or if you have received a written
agreement from the authors of the Software (see the COPYRIGHT file).

You may develop Odoo modules that use the Software as a library (typically
by depending on it, importing it and using its resources), but without copying
any source code or material from the Software. You may distribute those
modules under the license of your choice, provided that this license is
compatible with the terms of the Odoo Proprietary License (For example:
LGPL, MIT, or proprietary licenses similar to this one).

It is forbidden to publish, distribute, sublicense, or sell copies of the Software
or modified copies of the Software.

The above copyright notice and this permission notice must be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author or have a question related to your purchase, please use the support page.
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

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