Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] purchase_manual_delivery #2417

Open
wants to merge 49 commits into
base: 17.0
Choose a base branch
from

Conversation

StefanRijnhart
Copy link
Member

@StefanRijnhart StefanRijnhart commented Sep 26, 2024

  • Implement setUpClass in tests
  • Adapt to use stock.move quantity field in Odoo 17
  • Fix default value if company of the order is not the user's default company
  • Increase test coverage

Includes #2189, #2383

We're also proposing a small data model change. Previously, purchase order line's existing_qty included quantities from done stock moves. We're renaming the field to qty_in_receipt and changing the semantics to only include quanties from pending stock moves. The pending_to_receive will still be set under the same condition: if the ordered quantity is larger than the received quantity plus the quantities on pending stock moves. Data migration is included.

@StefanRijnhart StefanRijnhart added this to the 17.0 milestone Sep 26, 2024
@StefanRijnhart StefanRijnhart force-pushed the 17.0-mig-purchase_manual_delivery branch 2 times, most recently from 21020f0 to a35c706 Compare September 26, 2024 12:45
sysadminmatmoz and others added 24 commits September 26, 2024 14:51
Currently translated at 100.0% (56 of 56 strings)

Translation: purchase-workflow-14.0/purchase-workflow-14.0-purchase_manual_delivery
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-14-0/purchase-workflow-14-0-purchase_manual_delivery/sl/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_manual_delivery
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_manual_delivery/
oca-ci and others added 10 commits September 26, 2024 14:51
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_manual_delivery
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_manual_delivery/
Currently translated at 100.0% (65 of 65 strings)

Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_manual_delivery
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_manual_delivery/it/
Fixed issues when uom_id and uom_po_id of a product are different.
- Comparison for Purchase Order Line pending to receive now uses the product quantity that uses the uom of the Purchase Order Line.
- When creating the Stock Move the quantity is now computed into the uom of the Stock Move
Fixes the following 2 errors:
- When the product_uom_qty changes the recompute is not triggered
- In case that existing_qty > product_uom_qty the line should not be pending_to_receive
@StefanRijnhart StefanRijnhart marked this pull request as ready for review September 26, 2024 12:52
Purchase Order Lines that are pending to receive are not considered for stock forecast. Thus, the manual and automatic reordering of products can be done despite having already create a Purchase Order and surpassing the max quantity. Confirmed Purchase Orders with pending to receive Purchase Order Lines are now considered at the forecast and the forecast report.
To prevent interference from other modules. In this case, there is a purchase
order from Odoo's demo data in a confirmed state but without a picking for the
product. The missing picking causes  purchase_manual_delivery to include the
PO line's quantity in the forecasted quantity of the product. This prevents
the procurement to go through in TestPurchaseRequestProcurement.test_orderpoint.

```
 2024-09-26 14:16:17,327 269 ERROR odoo odoo.addons.purchase_request.tests.test_purchase_request_procurement: FAIL: TestPurchaseRequestProcurement.test_orderpoint
Traceback (most recent call last):
  File "/__w/purchase-workflow/purchase-workflow/purchase_request/tests/test_purchase_request_procurement.py", line 81, in test_orderpoint
    self.assertEqual(
AssertionError: 0.0 != 5
```
Copy link
Member

@astirpe astirpe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you also for including #2189

@StefanRijnhart
Copy link
Member Author

/ocabot migration purchase_manual_delivery

@OCA-git-bot OCA-git-bot mentioned this pull request Sep 27, 2024
47 tasks
…' stock moves

Rename existing_qty to qty_in_receipt. It now reflects the quantity for which there
are pending stock moves and no longer includes the quantities of 'done' stock moves.

Co-authored-by: Cas Vissers <cvi@360erp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.