Skip to main content
Odoo Community Association

Sale Order add produced by-products

Beta License: AGPL-3 OCA/sale-workflow Translate me on Weblate Try me on Runboat

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.

Key Features

  • Automatically adds/updates Sale Order Lines for by-products when a Manufacturing Order is marked as ‘done’.

  • Prevents additional Manufacturing Orders or procurements from being triggered for these by-product lines, as they are a result of existing production.

  • Ensures accurate tracking of by-product quantities on the Sale Order for invoicing purposes.

Table of contents

Use Cases / Context

Business Use Case: By-product Invoicing for Contract Manufacturers

This module is designed for contract manufacturing scenarios where the client provides raw materials or a base product for processing. Unlike standard manufacturing where the output quantity of finished goods is precisely known, this use case involves a process where the exact yield of by-products is uncertain until after the manufacturing operation is complete.

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’):

  1. The module identifies all by-products that were actually produced during that specific MO.

  2. It filters these by-products, adding only those that are configured as “Can be Sold” (``sale_ok=True``).

  3. 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.

  4. 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

  1. 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).

  2. Confirm the Sales Order. This will automatically generate a Manufacturing Order (MO) for the main product.

  3. 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).

  4. Mark the Manufacturing Order as Done. This is the trigger for the module’s automation.

  5. 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.

  6. 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

Authors

  • OBS Solutions BV

Contributors

  • bosd

Maintainers

This module is maintained by the OCA.

Odoo Community Association

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:

bosd

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.

Metadata

Release files for odoo-addon-sale-order-add-byproduct 18.0.2.0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo-addon-sale-order-add-byproduct 18.0.2.0.0.2
File Interpreter ABI Platform
odoo_addon_sale_order_add_byproduct-18.0.2.0.0.2-py3-none-any.whl Python 3 none any Details

Release files / odoo_addon_sale_order_add_byproduct-18.0.2.0.0.2-py3-none-any.whl

Download URL odoo_addon_sale_order_add_byproduct-18.0.2.0.0.2-py3-none-any.whl
Size 48.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e15ec06025fe0294c8a355926bf8730644dfe91c4831c88cb45aebc9f5d4fc7
BLAKE2b-256 checksum
How to use checksums
07e5a337fd0ea09864486e6473d610338f76631b18e2f25a0eb7a58c8f069eae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for odoo-addon-sale-order-add-byproduct 18.0.2.0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

18.0.2.0.0.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page