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

feat: Create subcontracted PO from Material Request #44745

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

mihir-kandoi
Copy link

Added feature to create a Subcontracting Purchase Order from Material Request. Reference issue ID #41297

  1. New Purpose field option "Subcontracting" added to Material Request doctype
  2. When a Subcontracting Material Request is submitted, user will then have an option to create a Subcontracted Purchase Order from the Create button on that Material Request
  3. If a Subcontracting BOM is present for the item in the Material Request, its service item will be fetched and added automatically to that item in the newly created PO

@github-actions github-actions bot added buying needs-tests This PR needs automated unit-tests. labels Dec 17, 2024
Comment on lines +483 to +495
item
for item in [
["name", "material_request_item"],
["parent", "material_request"],
["qty", "fg_item_qty"] if is_subcontracted else [],
["item_code", "fg_item"] if is_subcontracted else [],
["uom", "stock_uom"] if not is_subcontracted else [],
["uom", "uom"] if not is_subcontracted else [],
["sales_order", "sales_order"],
["sales_order_item", "sales_order_item"],
["wip_composite_asset", "wip_composite_asset"],
]
if item
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of list comprehension, add it in the separate function and return the list of fields to mapped from that function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buying needs-tests This PR needs automated unit-tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants