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

Location capacity by volume

Subscribe

Get notified when there's activity on this post

This question has been flagged
inventoryOdoov18
1 Reply
2994 Views
Avatar
Cristofher Saquilme
Hello everyone, how could I configure the capacity of a storage location based on volume in odoo 18?
0
Avatar
Discard
Avatar
Gracious Joseph
Best Answer

In Odoo 18, you can configure the capacity of a storage location based on volume by utilizing custom fields, rules, and automation. Odoo doesn’t have a built-in feature for setting location capacity by volume, but this can be achieved with some customization. Here's how to implement it step-by-step:

1. Add a Volume Field to Storage Locations

You can add a custom field for volume capacity and use Odoo’s automated actions or custom modules to manage it.

Using Studio (If Available):

  1. Go to Inventory > Configuration > Locations.
  2. Open Odoo Studio (if enabled).
  3. Add the following fields:
    • Capacity Volume (m³):
      • Field Name: x_volume_capacity
      • Type: Float
      • Label: Volume Capacity
    • Current Volume Used (m³):
      • Field Name: x_volume_used
      • Type: Float
      • Label: Volume Used
  4. Save the changes.

Without Studio (Custom Module):

If Studio is unavailable, you can achieve this using a custom module. Here's an example:

pythonCopy codefrom odoo import models, fields, api

class StockLocation(models.Model):
    _inherit = 'stock.location'

    volume_capacity = fields.Float(string="Capacity Volume (m³)", help="Maximum volume the location can hold.")
    volume_used = fields.Float(string="Current Volume Used (m³)", compute='_compute_volume_used', store=True)

    @api.depends('quant_ids')
    def _compute_volume_used(self):
        for location in self:
            location.volume_used = sum(location.quant_ids.mapped(lambda q: q.quantity * q.product_id.volume))

2. Set Product Volume

Odoo already supports volume on the product level:

  1. Go to Inventory > Products.
  2. Open a product form view.
  3. Under the Inventory tab, ensure the "Volume" field is filled in.
    • This value represents the volume of a single unit of the product.

3. Automate Volume Calculation

Ensure the total volume of products in a location doesn’t exceed its capacity:

Using Automated Actions:

  1. Go to Settings > Technical > Automated Actions.
  2. Create a new automated action:
    • Model: stock.quant
    • Trigger: On Update or On Creation.
    • Condition: Add a condition to check if the location's volume_used exceeds volume_capacity.
    • Action: Prevent the transaction or notify the user.
    Example Python code for the action:
    pythonCopy codeif record.location_id.volume_capacity > 0 and record.location_id.volume_used > record.location_id.volume_capacity:
        raise Warning(f"Location {record.location_id.name} has exceeded its volume capacity!")
    

Using Custom Python Constraints:

You can enforce a constraint directly in the model:

pythonCopy codefrom odoo.exceptions import ValidationError

class StockLocation(models.Model):
    _inherit = 'stock.location'

    @api.constrains('quant_ids')
    def _check_volume_capacity(self):
        for location in self:
            if location.volume_capacity > 0 and location.volume_used > location.volume_capacity:
                raise ValidationError(f"Location {location.name} has exceeded its volume capacity!")

4. Enhance Stock Operations

You can further improve the process:

  1. Restrict Transfers: Add validation during stock picking to ensure the volume added to a location doesn’t exceed its capacity. Example:
    pythonCopy codeclass StockPicking(models.Model):
        _inherit = 'stock.picking'
    
        @api.constrains('move_line_ids')
        def _check_location_volume(self):
            for move_line in self.move_line_ids:
                location = move_line.location_dest_id
                if location.volume_capacity > 0 and (location.volume_used + move_line.product_id.volume * move_line.qty_done) > location.volume_capacity:
                    raise ValidationError(f"Cannot move products. Location {location.name} will exceed its volume capacity.")
    
  2. Add Alerts: Use server actions or scheduled actions to alert warehouse managers if a location is close to its capacity.

5. Reporting and Dashboard

  • Volume Utilization Report: Create a custom report using Odoo’s reporting tools to monitor locations’ volume utilization.
  • Dashboard Widget: Add a widget showing the top locations nearing their capacity.

Final Notes

  • User Training: Train warehouse staff on maintaining product volumes for accurate tracking.
  • Testing: Before deploying, test the configuration in a development or staging environment.

0
Avatar
Discard
Cristofher Saquilme
Author

Thanks Gracious, I was seeing that you can configure storage categories and have the option to add maximum weight, can't you add maximum volume there either? or in general for odoo 18 it does not have the maximum volume option?

Gracious Joseph

n Odoo 18, maximum weight is a built-in feature for storage locations, but maximum volume is not a native option provided out-of-the-box. However, it is possible to extend Odoo to include the maximum volume functionality for storage locations using customizations. Here's an explanation and possible solutions:

1. Maximum Weight in Odoo
Odoo allows you to configure a maximum weight for storage locations, which helps ensure that no more products are assigned to a location than it can physically handle. This is available under:

Inventory > Configuration > Locations (in the warehouse module).
2. Maximum Volume in Odoo
Out-of-the-Box Support
As of Odoo 18, there is no default feature to configure or track maximum volume for storage locations.
Customization Possibilities
You can implement the maximum volume feature by adding a custom field to the location configuration and logic to validate the total volume of products stored.

3. Customization to Add Maximum Volume
Here’s how you can add the maximum volume option:

Step 1: Add a Maximum Volume Field
Extend the stock.location Model: Create a custom module to add a maximum_volume field to storage locations.

from odoo import models, fields, api

class StockLocation(models.Model):
_inherit = 'stock.location'

maximum_volume = fields.Float(string="Maximum Volume (m³)", help="Maximum volume allowed for this location.")
current_volume = fields.Float(string="Current Volume (m³)", compute="_compute_current_volume", store=True)

@api.depends('quant_ids')
def _compute_current_volume(self):
for location in self:
total_volume = sum(quant.product_id.volume * quant.quantity for quant in location.quant_ids)
location.current_volume = total_volume
Add the Field to the Location Form View: Extend the form view to show the new field.

<record id="view_location_form_inherit" model="ir.ui.view">
<field name="name">stock.location.form.inherit</field>
<field name="model">stock.location</field>
<field name="inherit_id" ref="stock.view_location_form" />
<field name="arch" type="xml">
<xpath expr="//group[@name='location_usage']" position="after">
<group string="Capacity">
<field name="maximum_volume" />
<field name="current_volume" readonly="1" />
</group>
</xpath>
</field>
</record>
Step 2: Add Validation for Maximum Volume
Check Volume Before Adding Stock: Override the method responsible for updating inventory (e.g., stock.move).

from odoo import models, exceptions

class StockMove(models.Model):
_inherit = 'stock.move'

def _action_done(self):
for move in self:
location = move.location_dest_id
if location.maximum_volume > 0:
new_volume = location.current_volume + (move.product_id.volume * move.quantity_done)
if new_volume > location.maximum_volume:
raise exceptions.ValidationError(
f"Exceeding maximum volume for location {location.name}. Allowed: {location.maximum_volume} m³."
)
return super(StockMove, self)._action_done()
Test the Logic:

Ensure the logic prevents stock operations when the volume exceeds the limit.
Test various scenarios, including transfers and inventory adjustments.
4. Benefits of Adding Maximum Volume
Prevents overloading storage locations by volume.
Provides more precise control over inventory.
Helps align with physical warehouse constraints for volume-based planning.
5. Alternative: Explore Third-Party Modules
If developing a custom solution isn’t viable, check the Odoo App Store for third-party modules that may offer this functionality.

Cristofher Saquilme
Author

Thanks for your response Gracious

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
Odoo Inventory Valuation Report
inventory
Avatar
Avatar
Avatar
Avatar
3
Nov 25
7309
Inventory rotation or inventory turnover
inventory
Avatar
Avatar
1
Oct 25
1703
Lot/Serial Number Solved
inventory
Avatar
Avatar
Avatar
2
Sep 25
899
track inventory history
inventory
Avatar
Avatar
1
Aug 25
1758
SH V18 Using Products for Demos not relieving inventory properly Solved
inventory
Avatar
Avatar
1
Jun 25
1573
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