fix: use checkbox instead of select field
This commit is contained in:
parent
dd80d3b9b9
commit
d366a91d9e
@ -30,9 +30,9 @@
|
||||
"column_break_11",
|
||||
"over_transfer_allowance",
|
||||
"section_break_xcug",
|
||||
"action_on_purchase_order_submission",
|
||||
"auto_create_subcontracting_order",
|
||||
"column_break_izrr",
|
||||
"action_on_subcontracting_receipt_submission"
|
||||
"auto_create_purchase_receipt"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
@ -181,21 +181,23 @@
|
||||
"fieldname": "section_break_xcug",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "action_on_purchase_order_submission",
|
||||
"fieldtype": "Select",
|
||||
"label": "Action on Purchase Order Submission",
|
||||
"options": "\nCreate Subcontracting Order\nCreate and Submit Subcontracting Order"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_izrr",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "action_on_subcontracting_receipt_submission",
|
||||
"fieldtype": "Select",
|
||||
"label": "Action on Subcontracting Receipt Submission",
|
||||
"options": "\nCreate Purchase Receipt\nCreate and Submit Purchase Receipt"
|
||||
"default": "0",
|
||||
"description": "Subcontracting Order (Draft) will be auto-created on submission of Purchase Order.",
|
||||
"fieldname": "auto_create_subcontracting_order",
|
||||
"fieldtype": "Check",
|
||||
"label": "Auto Create Subcontracting Order"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"description": "Purchase Receipt (Draft) will be auto-created on submission of Subcontracting Receipt.",
|
||||
"fieldname": "auto_create_purchase_receipt",
|
||||
"fieldtype": "Check",
|
||||
"label": "Auto Create Purchase Receipt"
|
||||
}
|
||||
],
|
||||
"icon": "fa fa-cog",
|
||||
@ -203,7 +205,7 @@
|
||||
"index_web_pages_for_search": 1,
|
||||
"issingle": 1,
|
||||
"links": [],
|
||||
"modified": "2023-11-22 17:46:26.474708",
|
||||
"modified": "2023-11-28 13:01:18.403492",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Buying",
|
||||
"name": "Buying Settings",
|
||||
|
@ -488,13 +488,8 @@ class PurchaseOrder(BuyingController):
|
||||
|
||||
def auto_create_subcontracting_order(self):
|
||||
if self.is_subcontracted and not self.is_old_subcontracting_flow:
|
||||
if action := frappe.db.get_single_value(
|
||||
"Buying Settings", "action_on_purchase_order_submission"
|
||||
):
|
||||
if action == "Create Subcontracting Order":
|
||||
make_subcontracting_order(self.name, save=True, notify=True)
|
||||
elif action == "Create and Submit Subcontracting Order":
|
||||
make_subcontracting_order(self.name, submit=True, notify=True)
|
||||
if frappe.db.get_single_value("Buying Settings", "auto_create_subcontracting_order"):
|
||||
make_subcontracting_order(self.name, save=True, notify=True)
|
||||
|
||||
|
||||
def item_last_purchase_rate(name, conversion_rate, item_code, conversion_factor=1.0):
|
||||
|
@ -531,13 +531,8 @@ class SubcontractingReceipt(SubcontractingController):
|
||||
)
|
||||
|
||||
def auto_create_purchase_receipt(self):
|
||||
if action := frappe.db.get_single_value(
|
||||
"Buying Settings", "action_on_subcontracting_receipt_submission"
|
||||
):
|
||||
if action == "Create Purchase Receipt":
|
||||
make_purchase_receipt(self, save=True, notify=True)
|
||||
elif action == "Create and Submit Purchase Receipt":
|
||||
make_purchase_receipt(self, submit=True, notify=True)
|
||||
if frappe.db.get_single_value("Buying Settings", "auto_create_purchase_receipt"):
|
||||
make_purchase_receipt(self, save=True, notify=True)
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
|
Loading…
x
Reference in New Issue
Block a user