Commit Graph
7 Commits
Author SHA1 Message Date
yhu-odoo 6624cbf75b [FIX] mrp_subcontracting_purchase, purchase_stock: price difference
entry wrong when resupply subcontractor

In case product is using standard price and automated inventory valuation.
We post account entries in price difference account when the price on
purchase order is different from the cost of product. However, when we
do subcontracting and resupply our subcontractor, the cost is not just
the price on purchase order, but also the cost of the components we sent
to the subcontractor. Currently, we didn't take the components cost in
to account when post price difference entries. Fix it in this commit.

Task-3223451

closes odoo/odoo#132282

X-original-commit: e771535b487e76f4e5a23b767d220d7f640292a6
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Yuchen Huang (yhu) <yhu@odoo.com>
2023-08-19 11:01:00 +02:00
Maruan Aguerdouh (magm) c50ae28374 [FIX] stock: set location as replenishment posible without warehouse
Steps to reproduce:

- Install purchase, inventory and manufacturing.
- Now create a subcontractor, with it's corresponding location, it's set
by default.
- Go to this new location and set it as replenishment location.
- Now create a Request for Quotation using this subcontractor.
- We will receive a traceback whent trying to access replenishment.

Issue:

We got a traceback caused by the fact that we are trying to set
as replenishment location, a location that doesn't have a warehouse.

Solution:

We need to add the handling of this case, so we won't always need
a warehouse for the orderpoint.

opw-3164276

closes odoo/odoo#121065

X-original-commit: 874e42463c2077980b9b4ce3903030c980285d51
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-05-11 18:25:26 +02:00
William Henrotin ef4b80c408 [FIX] mrp_subcontracting: merge quantity changes in PO
Before this commit, updating a purchase quantity of subcontracting
product will try to not merge the new and old move to keep the two chain
separated as much is possible and avoid side effects (receipt move,
subcontracting moves, resupply moves). Some were merged, some cancelled,
...

This had two issues:
First, not merging the quantity was not guarantied
as you can specify you don't want to merge them with others but it's not
possible for a stock move to say to any other move do not merge with me.

Second, by not merging the receipt moves, we duplicate every other
object on the chain. This pollute the database uselessly.

opw-3147446

closes odoo/odoo#114739

X-original-commit: 0b1bcfacb13c7de480f30015b91db11ed03f2dfe
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-09 10:51:43 +01:00
Adrien Widart 0ba6a5714f [IMP] mrp_subcontracting_purchase: add some tests
Tests for
- e6a1e240f1
- fd22fe221026e353aac7414348b029ae7e290b2f

X-original-commit: 3cbe69c8e68d872fe239f499e37fb559f20984b9
Part-of: odoo/odoo#102224
2022-10-05 14:26:14 +02:00
Tiffany Chang (tic) 38b97971e9 [FIX] mrp_subcontracting{_purchase}: handle subcontract qty decrease
Steps to reproduce:
- create a subcontracted product (i.e. create subcontract BoM)
- create and confirm PO for subcontracted product (qty > 1)
- try to decrease PO qty for subcontracted product

Expected Result:
Since receipt is not yet validated, the qty in the receipt should
decrease (it will in the subcontract MO as well, but this doesn't matter
since no one should work directly with the MO)

Actual Result:
A validation error occurs saying the qty to produce must be non-negative

We allow neg demand qtys to be proprogated from SOs and POs since
https://github.com/odoo/odoo/pull/76752 . While we added in a check to
make sure MOs are not created when a neg qty change is proprogated, we
forgot to add a check for subcontracted created MOs, hence the
validation error (i.e. the neg qty change is trying to create a
subcontracted MO of a neg amount.)

Task: 2777571 (issue 2 of additional issues)
X-original-commit: 251f146b6ecb0e2d428089669199a6deb3a6c060
Part-of: odoo/odoo#97383
2022-08-03 15:09:57 +02:00
William Henrotin c146c7d16f [REF] *stock*: rename model stock.location.route into stock.route
Task: 2648449
Part-of: odoo/odoo#80434
2021-12-07 16:20:06 +00:00
Rémy Voet (ryv) 820fbd9973 [ADD] mrp_subcontracting_purchase: new module
Add a new module to add smart buttons between a subcontracting purchase
order and the ressuply component delivery.

task-2486811

Part-of: odoo/odoo#75041
2021-09-03 10:37:45 +00:00