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

[ADD][8.0] mrp_production_raw_material_procurement_group #161

Conversation

andhit-r
Copy link
Member

Create Procurement Group On Manufacturing Order

This module adds ability to group manufacturing order's raw material moves, and
other moves created by it's pull flow, by given procurement group.

Usage

To use this module, you need to:

  1. Go to menu Manufacturing -> Manufacturing -> Manufacturing Orders
  2. Create manufacturing order. Do not forget to fill Raw Material Procurement Group
  3. When MO is confirmed. Raw material moves with make to order procurement method, and it's
    other moves created by it's pull flow, will be grouped based on Raw Material Procurement Group
    given

@m-sani
Copy link

m-sani commented Oct 26, 2016

tested 👍

@andhit-r
Copy link
Member Author

andhit-r commented Nov 1, 2016

@mikevhe18 @azmimr67 please review

@mikevhe18
Copy link

👍 Tested On Runbot

@JordiBForgeFlow
Copy link
Member

Very useful @andhit-r . For my use case would be great to create a procurement group for each MO. I would build a separate module, right? (something such as mrp_production_raw_material_procurement_group_auto)

@andhit-r
Copy link
Member Author

@jbeficent i think i can do something for your use case. Wait for next my commit.

@andhit-r
Copy link
Member Author

@jbeficent i made some change to cover your use case. Would you kindly review it again. Many thanks.

* [IMP]
- When a manufacturing order is copied, do not copy the procurement group
- When a manufacturing order is confirm, the procurement group is assigned to the stock moves from raw material location to the routing location.

* [IMP]
-added some more tests to cover the previous changes.

* [FIX] errors in tests
@andhit-r
Copy link
Member Author

andhit-r commented Dec 3, 2016

@jbeficent @lreficent would you kindly review this PR again. Many thanks.

"procurement.group"]
if self.auto_create_procurement_group and \
not self.raw_material_procurement_group_id:
self.raw_material_procurement_group_id = obj_group.create({
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't be better to call self._prepare_procurement_group before creating? That way we have better extensibility.

self.assertEqual(
mo2.raw_material_procurement_group_id.id, False)

def test_copy_mo_2(self):
Copy link
Contributor

@LoisRForgeFlow LoisRForgeFlow Dec 7, 2016

Choose a reason for hiding this comment

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

Rename to test_group_name, I think it would be more descriptive.

@JordiBForgeFlow
Copy link
Member

@andhit-r, @lreficent will propose the improvements as a PR to your branch.

-  Allows extensibility when creating procurement groups.
- Rename a test.
@andhit-r
Copy link
Member Author

@jbeficent @lreficent i did cherry-pick on @lreficent last commit (785b22c). This due conflict on andhit-r#2

Many thanks for revision.

@JordiBForgeFlow JordiBForgeFlow merged commit 5979099 into OCA:8.0 Dec 15, 2016
@JordiBForgeFlow
Copy link
Member

cc @lreficent Can you start to port to v9?

@LoisRForgeFlow
Copy link
Contributor

Yes, I'll work in that.

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.

5 participants