OdooWiki OCA HUB

Sale Order add produced by-products

sale_order_add_byproduct folder_open OCA/sale-workflow open_in_new
Sales Management License: AGPL-3

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.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

When a Manufacturing Order is finished, any saleable by-products produced are automatically added as invoiceable lines on the related Sales Order, with a configurable note and price from the customer's pricelist.

This module links manufacturing and sales so that by-products produced during a Manufacturing Order end up on the customer's Sales Order without manual entry.

  • When a Manufacturing Order is marked as done, the system looks for the related Sales Order (through the sale line, the procurement group, or the order reference) and adds a line for each saleable by-product actually produced.
  • If a by-product line already exists on that Sales Order, its quantity is increased instead of creating a duplicate.
  • The new line is priced using the Sales Order's pricelist and the customer, and its description uses a note template that can include the product name and the Manufacturing Order name.
  • These by-product lines are flagged so they do not trigger new manufacturing orders or procurements, avoiding double production.
  • Administrators can set the note template in the Manufacturing settings under a 'By-product Settings' block; the default is '{product_name} (By-product from MO: {mo_name})'.

The module touches mrp.production, sale.order.line, res.company and res.config.settings.

Depends on

sale_managementsale_mrp
Models and fields (4)
  • res.company · extends an existing modelbyproduct_note_template (By-product Note Template)
  • mrp.production · extends an existing model
  • sale.order.line · extends an existing modelis_mrp_byproduct_line (Added from MO By-product)
  • res.config.settings · extends an existing modelbyproduct_note_template

Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 1 confirmed, 8 with no information of 9 versions.

Sources · Odoo 18.0

Confirmed on 2026-11-03 in branch 18.0 of OCA/sale-workflow.

terminal Installation and usage

OCA documentation · Odoo 18.0

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

No verified information in OCA: Installation.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.