mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
fix: Add check to skip PR in supplier master
This commit is contained in:
@@ -296,17 +296,21 @@ class PurchaseInvoice(BuyingController):
|
|||||||
if not d.purchase_order:
|
if not d.purchase_order:
|
||||||
throw(_("""Purchase Order Required for item {0}
|
throw(_("""Purchase Order Required for item {0}
|
||||||
To submit the invoice without purchase order please set
|
To submit the invoice without purchase order please set
|
||||||
{1} as {2} in {3}""").format(frappe.bold(d.item_code), frappe.bold('Purchase Order Required'),
|
{1} as {2} in {3}""").format(frappe.bold(d.item_code), frappe.bold(_('Purchase Order Required')),
|
||||||
frappe.bold('No'), get_link_to_form('Buying Settings', 'Buying Settings', 'Buying Settings')))
|
frappe.bold('No'), get_link_to_form('Buying Settings', 'Buying Settings', 'Buying Settings')))
|
||||||
|
|
||||||
def pr_required(self):
|
def pr_required(self):
|
||||||
stock_items = self.get_stock_items()
|
stock_items = self.get_stock_items()
|
||||||
if frappe.db.get_value("Buying Settings", None, "pr_required") == 'Yes':
|
if frappe.db.get_value("Buying Settings", None, "pr_required") == 'Yes':
|
||||||
|
|
||||||
|
if frappe.get_value('Supplier', self.supplier, 'allow_purchase_invoice_creation_without_purchase_receipt'):
|
||||||
|
return
|
||||||
|
|
||||||
for d in self.get('items'):
|
for d in self.get('items'):
|
||||||
if not d.purchase_receipt and d.item_code in stock_items:
|
if not d.purchase_receipt and d.item_code in stock_items:
|
||||||
throw(_("""Purchase Receipt Required for item {0}
|
throw(_("""Purchase Receipt Required for item {0}
|
||||||
To submit the invoice without purchase receipt please set
|
To submit the invoice without purchase receipt please set
|
||||||
{1} as {2} in {3}""").format(frappe.bold(d.item_code), frappe.bold('Purchase Receipt Required'),
|
{1} as {2} in {3}""").format(frappe.bold(d.item_code), frappe.bold(_('Purchase Receipt Required')),
|
||||||
frappe.bold('No'), get_link_to_form('Buying Settings', 'Buying Settings', 'Buying Settings')))
|
frappe.bold('No'), get_link_to_form('Buying Settings', 'Buying Settings', 'Buying Settings')))
|
||||||
|
|
||||||
def validate_write_off_account(self):
|
def validate_write_off_account(self):
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
"pan",
|
"pan",
|
||||||
"language",
|
"language",
|
||||||
"allow_purchase_invoice_creation_without_purchase_order",
|
"allow_purchase_invoice_creation_without_purchase_order",
|
||||||
|
"allow_purchase_invoice_creation_without_purchase_receipt",
|
||||||
"disabled",
|
"disabled",
|
||||||
"warn_rfqs",
|
"warn_rfqs",
|
||||||
"warn_pos",
|
"warn_pos",
|
||||||
@@ -370,14 +371,20 @@
|
|||||||
"default": "0",
|
"default": "0",
|
||||||
"fieldname": "allow_purchase_invoice_creation_without_purchase_order",
|
"fieldname": "allow_purchase_invoice_creation_without_purchase_order",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Allow Purchase Invoice creation without Purchase Order"
|
"label": "Allow Purchase Invoice Creation Without Purchase Order"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"fieldname": "allow_purchase_invoice_creation_without_purchase_receipt",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Allow Purchase Invoice Creation Without Purchase Receipt"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-user",
|
"icon": "fa fa-user",
|
||||||
"idx": 370,
|
"idx": 370,
|
||||||
"image_field": "image",
|
"image_field": "image",
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2020-03-06 18:19:25.235183",
|
"modified": "2020-03-17 09:48:30.578242",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Buying",
|
"module": "Buying",
|
||||||
"name": "Supplier",
|
"name": "Supplier",
|
||||||
|
|||||||
Reference in New Issue
Block a user