Odoo CE: Filter Manufacturing Orders by Lot/Serial and Add Custom Bulk Actions (XML Only)

open erp 📌 Overview

Managing manufacturing in Odoo Community Edition (CE) often requires practical customizations that improve speed, clarity, and traceability — especially if you're not using Odoo Studio or writing custom Python code.

In this article, we’ll walk through how to:

  • ✅ Add a custom search filter for Lot/Serial numbers in the Manufacturing Orders view
  • ✅ Customize the list view buttons to support real-world bulk actions like "Confirm" and "Produce All"
  • ✅ Understand the pros and cons of simplifying the manufacturing workflow

All of this is done using XML only — no custom modules, no Python, and no paid addons.

🎯 Use Case

“I want my manufacturing team to quickly search Manufacturing Orders by serial/lot number and also perform bulk actions like confirming and completing MOs on the same day — without relying on scheduled planning.”

This is a common real-world need in small to mid-sized production operations where speed and usability matter more than formal scheduling or work center routing.


🧩 Part 1: Custom Filter by Lot/Serial Number

❓ The Problem

Odoo does not include a built-in filter to search Manufacturing Orders (mrp.production) by the Lot/Serial number of the finished product.

Attempts to search via deeply nested relationships (like move_finished_ids.lot_ids.name) result in:

Unsearchable field “lot_ids” in path “move_finished_ids.lot_ids.name”

✅ The Solution

Use the lot_producing_id field — it’s a Many2one field linking directly to the finished product's Lot/Serial record.

🔧 XML Snippet

Edit the mrp.production search view:

<field name="lot_producing_id" string="Lot/Serial" filter_domain="[('lot_producing_id.name', 'ilike', self)]"/>

🧠 Bonus: Predefined Filters & Group By

<filter string="Has Lot/Serial" name="has_lot" domain="[('lot_producing_id', '!=', False)]"/>

<group expand="0" string="Group By...">
    <filter string="Lot/Serial" name="group_by_lot" domain="[]" context="{'group_by': 'lot_producing_id'}"/>
</group>

🧩 Part 2: Custom List View Buttons for Bulk Actions

By default, Odoo includes a "Plan" button, which schedules the MO for a future date — this isn't ideal if you want production to start today or want to skip unnecessary steps.

✅ The Real-World Fix

You can replace or add buttons to the list view header to allow bulk actions that better fit your workflow.

🔧 Modified List View (Header Buttons)

<list string="Manufacturing Orders" multi_edit="1" sample="1" decoration-info="state == 'done'">
    <header>
        <button name="action_confirm" type="object" string="Confirm"/>
        <button name="button_mark_done" type="object" string="Produce all"/>
        <!-- <button name="button_plan" type="object" string="Plan"/> -->
        <button name="action_assign" type="object" string="Check availability"/>
        <button name="action_cancel" type="object" string="Cancel"/>
    </header>
</list>
  • action_confirm — Confirms MOs instantly
  • button_mark_done — Completes production for all quantities
  • action_assign — Checks component availability
  • action_cancel — Cancels selected MOs
  • button_planCommented out to avoid future date scheduling

✅ Benefits (PROs)

  • Fast Workflow — Skip planning, go straight to production
  • Bulk Ready — Confirm or complete multiple MOs at once
  • 🧠 Simplified UX — Reduces confusion over planned dates
  • 📆 Uses Today’s Date — No need to adjust scheduled dates manually
  • 🧪 Good for Smaller Teams — Ideal where formal planning isn’t critical

⚠️ Limitations (CONs)

  • Skips Planning — No visibility into future work center load
  • No Work Order Trackingbutton_mark_done skips routing operations
  • ⚠️ Inventory Gaps Possible — If components are missing, auto-producing might cause inconsistencies
  • 🚫 Bypasses Gantt Views — Won’t appear properly in planned production timelines
  • 🔁 No Undo — Mass marking MOs as done is not easily reversible

🔁 Real-World Application Scenarios

This method is ideal for companies that:

  • Produce items on-demand without formal scheduling
  • Prefer a fast, streamlined interface
  • Rely on manual control or physical Kanban
  • Have bulk manufacturing needs (e.g., confirming or finishing 20+ MOs per day)

🧠 Pro Tips

  • Show lot_producing_id in the list view:
<field name="lot_producing_id"/>
  • Use attrs to show buttons only in certain states:
<button name="button_mark_done" type="object" string="Produce All"
        attrs="{'invisible': [('state', '!=', 'confirmed')]}"/>
  • Add a confirmation wizard for risky actions (future improvement)

📌 Final Summary

FeatureStatus
Lot/Serial Filter in MO Search View✔ Done (XML only)
Group by Lot/Serial✔ Done
Custom Bulk Action Buttons✔ Done
No Python or Studio used✔ Confirmed
Ideal for fast-paced, simplified manufacturing
Ideal for fast-paced, simplified manufacturing✔ Absolutely

🏁 Conclusion

This approach gives you a lean, operator-friendly manufacturing dashboard inside Odoo CE — without touching Python or requiring Odoo Studio.

It’s perfect for teams that:

  • Need speed over complexity
  • Don’t use detailed routing or work centers
  • Rely on simple Kanban workflows and fast turnaround
  • Want to empower staff with bulk action buttons for the most common operations

You get the job done faster, without losing visibility — and you can always scale up with more advanced logic later if needed.





💬 Questions or Next Steps?

If you're planning to:

  • ✅ Add custom buttons for other modules (e.g., Sales, Inventory)
  • ✅ Extend filtering to nested related models (like components, BOMs)
  • ✅ Set user permissions on who can see or use each button

…then stay tuned — we’ll cover more XML tips in upcoming posts!

Thanks for reading — and happy building with Odoo! 👨‍💻⚙️

Post a Comment

Previous Post Next Post