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

fix: Allow PR/DN without PO/SO if set in Supplier/Customer Master #22514

Closed
wants to merge 1 commit into from
Closed

fix: Allow PR/DN without PO/SO if set in Supplier/Customer Master #22514

wants to merge 1 commit into from

Conversation

P-Froggy
Copy link
Contributor

Description

Allows creation of Purchase Receipt without Purchase Order if "Allow Purchase Invoice Creation Without Purchase Order" in the Supplier Master is ticked.
The same also applies for the corresponding option in Customer Master.

Details

PR #20864 added the option to overwrite the default behaviour of requiring a Purchase Order or a Sales Order for the creation of an Invoice based on the Supplier/Customer. However, this new logic has only been implemented in Purchase/Sales Invoice, but not in Purchase Receipt and Delivery Note.
Because the procurement process in ERPNext is Purchase Order -> Purchase Receipt -> Purchase Invoice this logic should also apply for Purchase Receipt and Delivery Note.

Allows creation of Purchase Receipt without Purchase Order if "Allow Purchase Invoice Creation Without Purchase Order" in the Supplier Master is ticked.
The same also applies for the corresponding option in Customer Master.
@marination marination self-assigned this Jul 1, 2020
@@ -118,6 +118,9 @@ def validate_with_previous_doc(self):

def po_required(self):
if frappe.db.get_value("Buying Settings", None, "po_required") == 'Yes':
if frappe.get_value('Supplier', self.supplier, 'allow_purchase_invoice_creation_without_purchase_order'):
Copy link
Collaborator

Choose a reason for hiding this comment

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

the checkbox clearly states that it affects Purchase Invoice, so, we only check this on Purchase Invoice or Sales Invoice validation. This just adds more unexplained behaviour which is unnecessary. Let's make the checkboxes function as per their labels.

@marination
Copy link
Collaborator

@P-Froggy as mentioned in the review, the checkbox Allow Purchase Invoice Creation Without Purchase Order should affect only Purchase Invoice as mentioned in it's label.
Maybe we can add additional settings for PR and DN without PO and SO respectively too. We will definitely get this done.
But using the currently available checkboxes to check PR or DN is not a good idea

@marination
Copy link
Collaborator

Closing this

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.

None yet

2 participants