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