Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions mrp_stock_move_demand_editable/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
==============================
MRP Stock Move Demand Editable
==============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d04cca2dea47ee7fe1ad3ddc805c7d0eca64daa3700a1a586353bc71adc2f1d0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github
:target: https://github.com/OCA/manufacture/tree/18.0/mrp_stock_move_demand_editable
:alt: OCA/manufacture
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/manufacture-18-0/manufacture-18-0-mrp_stock_move_demand_editable
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/manufacture&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

When manufacturing is configured with 2 or 3 steps (*Pick components
then manufacture*), Odoo generates a *Pick Components* transfer to move
the raw materials to the production area. The demand (initial requested
quantity) of this transfer is locked and cannot be changed.

This module makes the demand quantity of those *Pick Components*
transfers editable, so a different quantity than the one required by the
manufacturing order can be requested (for example, moving a larger
quantity to the shop floor and returning the surplus afterwards).

**Table of contents**

.. contents::
:local:

Usage
=====

Prerequisite: the warehouse must be configured with *Pick components
then manufacture* (2 steps) or *Pick components, manufacture, then store
products* (3 steps).

1. Confirm a manufacturing order. Odoo creates the related *Pick
Components* transfer.
2. Open the transfer. The **Demand** column of the operations is now
editable even though the transfer is locked.
3. Change the demand to the desired quantity (e.g. from 5 to 7).
4. Click **Check Availability** to reserve the new quantity.

The reserved quantity is what the Barcode app shows as the target, so
step 4 is required for the operator to see the updated quantity on the
shop floor.

The manufacturing order is not affected: it keeps consuming the quantity
defined by its bill of materials. Any surplus moved to the production
area can be returned to its original location using a return transfer.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/manufacture/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 <https://github.com/OCA/manufacture/issues/new?body=module:%20mrp_stock_move_demand_editable%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Quartile

Contributors
------------

- `Quartile <https://www.quartile.co>`__:

- Kanda

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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.

.. |maintainer-kanda999| image:: https://github.com/kanda999.png?size=40px
:target: https://github.com/kanda999
:alt: kanda999

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-kanda999|

This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/18.0/mrp_stock_move_demand_editable>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions mrp_stock_move_demand_editable/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions mrp_stock_move_demand_editable/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2026 Quartile (https://www.quartile.co)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "MRP Stock Move Demand Editable",
"version": "18.0.1.0.0",
"category": "Manufacturing",
"summary": "Allow editing the demand quantity on manufacturing "
"component-pick transfers",
"author": "Quartile, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/manufacture",
"license": "AGPL-3",
"development_status": "Beta",
"maintainers": ["kanda999"],
"depends": ["mrp"],
"installable": True,
}
1 change: 1 addition & 0 deletions mrp_stock_move_demand_editable/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import stock_move
33 changes: 33 additions & 0 deletions mrp_stock_move_demand_editable/models/stock_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2026 Quartile (https://www.quartile.co)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, models


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

@api.depends("state", "picking_id.is_locked", "picking_type_id")
def _compute_is_initial_demand_editable(self):
"""Make the initial demand editable on manufacturing "pick components"
transfers (2/3-step manufacturing).

Core keeps the demand read-only once the transfer is locked and out of
the ``draft`` state. For component-pick transfers we want to be able to
request a different quantity than the one strictly needed by the
manufacturing order (e.g. move a larger quantity to the shop floor and
return the surplus afterwards), so we allow editing as long as the move
is not done or cancelled.
"""
super()._compute_is_initial_demand_editable()
candidates = self.filtered(
lambda m: not m.is_initial_demand_editable
and m.state not in ("done", "cancel")
and m.picking_type_id
)
if not candidates:
return
pbm_type_ids = self.env["stock.warehouse"].sudo().search([]).pbm_type_id.ids
for move in candidates:
if move.picking_type_id.id in pbm_type_ids:
move.is_initial_demand_editable = True
3 changes: 3 additions & 0 deletions mrp_stock_move_demand_editable/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions mrp_stock_move_demand_editable/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [Quartile](https://www.quartile.co):
- Kanda
9 changes: 9 additions & 0 deletions mrp_stock_move_demand_editable/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
When manufacturing is configured with 2 or 3 steps (*Pick components then
manufacture*), Odoo generates a *Pick Components* transfer to move the raw
materials to the production area. The demand (initial requested quantity) of
this transfer is locked and cannot be changed.

This module makes the demand quantity of those *Pick Components* transfers
editable, so a different quantity than the one required by the manufacturing
order can be requested (for example, moving a larger quantity to the shop
floor and returning the surplus afterwards).
17 changes: 17 additions & 0 deletions mrp_stock_move_demand_editable/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Prerequisite: the warehouse must be configured with *Pick components then
manufacture* (2 steps) or *Pick components, manufacture, then store products*
(3 steps).

1. Confirm a manufacturing order. Odoo creates the related *Pick Components*
transfer.
2. Open the transfer. The **Demand** column of the operations is now editable
even though the transfer is locked.
3. Change the demand to the desired quantity (e.g. from 5 to 7).
4. Click **Check Availability** to reserve the new quantity.

The reserved quantity is what the Barcode app shows as the target, so step 4 is
required for the operator to see the updated quantity on the shop floor.

The manufacturing order is not affected: it keeps consuming the quantity
defined by its bill of materials. Any surplus moved to the production area can
be returned to its original location using a return transfer.
Loading
Loading