This module extends the functionality of Manufacturing Orders to
automatically transfer produced by-products to the associated Sale Order
once the Manufacturing Order is closed. This allows for easier invoicing
and management of by-products sold to customers.
Scenario
A contract manufacturer processes materials supplied by a client. During
this process, in addition to any primary output, a variable quantity of
by-products is inevitably generated. The client is obligated to purchase
these by-products from the contract manufacturer.
Problem
At the time of sale order creation, it is impossible to accurately
determine the quantity of by-products that will be produced from the
manufacturing process. Therefore, these by-products cannot be initially
included on the sales order for invoicing. Traditional Odoo MRP
workflows are designed for planned production, not for dynamic
by-product quantification for sales.
Solution
This module automates the process of adding the actual, measured
quantities of produced by-products to the corresponding sales order.
Once the Manufacturing Order (MO) for the client’s material is completed
(marked as ‘done’):
- The module identifies all by-products that were actually produced
during that specific MO.
- It filters these by-products, adding only those that are configured
as “Can be Sold” (``sale_ok=True``).
- It then adds these filtered by-products, along with their actual
quantities, as new lines (or updates existing lines) on the original
sales order linked to that MO.
- These by-product lines are flagged to ensure they do not trigger new
manufacturing orders or procurement requests, as their supply comes
directly from the completed production.
Benefits
- Accurate Invoicing: Ensures clients are correctly billed for all
by-products generated during the contract manufacturing process,
preventing revenue loss.
- Streamlined Operations: Automates the manual task of reconciling
by-product quantities and adding them to sales orders.
- Improved Traceability: Maintains a clear link between the
manufacturing process and the resulting by-product sales.
- Enhanced Reporting: Allows for better reporting on by-product
yields and sales for analysis and compliance.
Configuration
No specific configuration is required for this module to function,
beyond the standard Odoo setup for Manufacturing Orders, Bills of
Materials (BOMs), and Products.
However, for optimal use:
- By-product Products: Ensure your by-product products are correctly
defined in Odoo, ideally belonging to a specific product category
(e.g., ‘By-products’).
- Crucially, the by-product product must have its “Can be Sold”
(``sale_ok``) field set to ``True`` in its product form under the
“Sales” tab. By-products with sale_ok = False will be ignored by
this module and will not be added to the Sales Order.
- BOMs with By-products: Your Bills of Materials (BOMs) for your
main manufactured products must have the relevant by-products
configured under the “By-products” tab with their planned quantities.
Usage
- Create a Sales Order (SO) for the main product that your client
will receive.
- The main product should have a Bill of Materials (BOM) defined that
includes the by-products under its “By-products” tab.
- The main product’s inventory route should be configured for
“Manufacture” (or “Make to Order” if applicable).
- Confirm the Sales Order. This will automatically generate a
Manufacturing Order (MO) for the main product.
- Process the Manufacturing Order:
- Navigate to the generated Manufacturing Order.
- Ensure all necessary raw materials are available.
- Move the MO through its production stages (e.g., confirm, plan,
start production, consume components).
- Crucially, ensure the actual quantities produced for the
by-products are recorded on the MO’s respective moves (e.g., on
the stock.move records associated with the by-products,
typically under the ‘Finished Products’ or ‘By-products’ tab of the
MO, the ‘Done’ quantity should reflect the actual yield).
- Mark the Manufacturing Order as Done. This is the trigger for the
module’s automation.
- Verify the Sales Order:
- Go back to the Sales Order that was linked to the completed MO.
- You will find new line(s) added (or existing lines updated) for the
by-product(s) with their actual produced quantities from the MO.
- These by-product lines will be flagged internally
(is_mrp_byproduct_line = True) to prevent them from triggering
new, unnecessary manufacturing orders or procurement requests.
- Invoice the Client: You can now proceed to create an invoice from
the Sales Order, which will include the by-products for billing to
your client.
This automated process ensures that clients are accurately billed for
all by-products generated during the contract manufacturing process.
Known issues / Roadmap
Bug Tracker
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
feedback.
Do not contact contributors directly about support or help with technical issues.
Credits
Maintainers
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
Current maintainer:

This module is part of the OCA/sale-workflow project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.