Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 38 additions & 6 deletions rmax_custom/fixtures/property_setter.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,50 @@
[
{
"default_value": null,
"doc_type": "Landed Cost Item",
"doc_type": "Material Request Item",
"docstatus": 0,
"doctype": "Property Setter",
"doctype_or_field": "DocField",
"field_name": "qty",
"field_name": "from_warehouse",
"is_system_generated": 0,
"modified": "2026-03-14 15:18:50.370102",
"modified": "2026-04-07 11:59:35.070437",
"module": null,
"name": "Landed Cost Item-qty-columns",
"property": "columns",
"property_type": "Int",
"name": "Material Request Item-from_warehouse-hidden",
"property": "hidden",
"property_type": "Check",
"row_name": null,
"value": "1"
},
{
"default_value": null,
"doc_type": "Material Request Item",
"docstatus": 0,
"doctype": "Property Setter",
"doctype_or_field": "DocField",
"field_name": "warehouse",
"is_system_generated": 0,
"modified": "2026-04-07 11:59:35.258029",
"module": null,
"name": "Material Request Item-warehouse-hidden",
"property": "hidden",
"property_type": "Check",
"row_name": null,
"value": "1"
},
{
"default_value": null,
"doc_type": "Material Request Item",
"docstatus": 0,
"doctype": "Property Setter",
"doctype_or_field": "DocField",
"field_name": "schedule_date",
"is_system_generated": 0,
"modified": "2026-04-08 14:12:12.985855",
"module": "",
"name": "Material Request Item-schedule_date-reqd",
"property": "reqd",
"property_type": "Check",
"row_name": null,
"value": "0"
}
]
122 changes: 122 additions & 0 deletions rmax_custom/fixtures/workflow.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
[
{
"docstatus": 0,
"doctype": "Workflow",
"document_type": "Stock Transfer",
"is_active": 1,
"modified": "2026-04-07 17:50:07.655273",
"name": "Stock Transfer Workflow",
"override_status": 0,
"send_email_alert": 0,
"states": [
{
"allow_edit": "Stock User",
"avoid_status_override": 0,
"doc_status": "0",
"is_optional_state": 0,
"message": null,
"next_action_email_template": null,
"parent": "Stock Transfer Workflow",
"parentfield": "states",
"parenttype": "Workflow",
"send_email": 1,
"state": "Draft",
"update_field": null,
"update_value": null,
"workflow_builder_id": null
},
{
"allow_edit": "Stock User",
"avoid_status_override": 0,
"doc_status": "0",
"is_optional_state": 0,
"message": null,
"next_action_email_template": null,
"parent": "Stock Transfer Workflow",
"parentfield": "states",
"parenttype": "Workflow",
"send_email": 1,
"state": "Pending",
"update_field": null,
"update_value": null,
"workflow_builder_id": null
},
{
"allow_edit": "Stock Manager",
"avoid_status_override": 0,
"doc_status": "1",
"is_optional_state": 0,
"message": null,
"next_action_email_template": null,
"parent": "Stock Transfer Workflow",
"parentfield": "states",
"parenttype": "Workflow",
"send_email": 1,
"state": "Approved",
"update_field": null,
"update_value": null,
"workflow_builder_id": null
},
{
"allow_edit": "Stock Manager",
"avoid_status_override": 0,
"doc_status": "0",
"is_optional_state": 0,
"message": null,
"next_action_email_template": null,
"parent": "Stock Transfer Workflow",
"parentfield": "states",
"parenttype": "Workflow",
"send_email": 1,
"state": "Rejected",
"update_field": null,
"update_value": null,
"workflow_builder_id": null
}
],
"transitions": [
{
"action": "Send For Approval",
"allow_self_approval": 1,
"allowed": "Stock User",
"condition": null,
"next_state": "Pending",
"parent": "Stock Transfer Workflow",
"parentfield": "transitions",
"parenttype": "Workflow",
"send_email_to_creator": 0,
"state": "Draft",
"workflow_builder_id": null
},
{
"action": "Approve",
"allow_self_approval": 1,
"allowed": "Stock Manager",
"condition": null,
"next_state": "Approved",
"parent": "Stock Transfer Workflow",
"parentfield": "transitions",
"parenttype": "Workflow",
"send_email_to_creator": 0,
"state": "Pending",
"workflow_builder_id": null
},
{
"action": "Reject",
"allow_self_approval": 1,
"allowed": "Stock Manager",
"condition": null,
"next_state": "Rejected",
"parent": "Stock Transfer Workflow",
"parentfield": "transitions",
"parenttype": "Workflow",
"send_email_to_creator": 0,
"state": "Pending",
"workflow_builder_id": null
}
],
"workflow_data": null,
"workflow_name": "Stock Transfer Workflow",
"workflow_state_field": "workflow_state"
}
]
30 changes: 30 additions & 0 deletions rmax_custom/fixtures/workflow_action_master.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[
{
"docstatus": 0,
"doctype": "Workflow Action Master",
"modified": "2026-02-26 12:37:52.228555",
"name": "Approve",
"workflow_action_name": "Approve"
},
{
"docstatus": 0,
"doctype": "Workflow Action Master",
"modified": "2026-02-26 12:37:52.229648",
"name": "Reject",
"workflow_action_name": "Reject"
},
{
"docstatus": 0,
"doctype": "Workflow Action Master",
"modified": "2026-02-26 12:37:52.230333",
"name": "Review",
"workflow_action_name": "Review"
},
{
"docstatus": 0,
"doctype": "Workflow Action Master",
"modified": "2026-04-07 17:49:09.493280",
"name": "Send For Approval",
"workflow_action_name": "Send For Approval"
}
]
47 changes: 47 additions & 0 deletions rmax_custom/fixtures/workflow_state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[
{
"docstatus": 0,
"doctype": "Workflow State",
"icon": "remove",
"modified": "2026-02-26 12:37:52.220221",
"name": "Rejected",
"style": "Danger",
"workflow_state_name": "Rejected"
},
{
"docstatus": 0,
"doctype": "Workflow State",
"icon": "",
"modified": "2026-04-07 17:31:52.178832",
"name": "Pending For Approval",
"style": "",
"workflow_state_name": "Pending For Approval"
},
{
"docstatus": 0,
"doctype": "Workflow State",
"icon": "ok-sign",
"modified": "2026-02-26 12:37:52.219295",
"name": "Approved",
"style": "Success",
"workflow_state_name": "Approved"
},
{
"docstatus": 0,
"doctype": "Workflow State",
"icon": "question-sign",
"modified": "2026-02-26 12:37:52.217960",
"name": "Pending",
"style": "",
"workflow_state_name": "Pending"
},
{
"docstatus": 0,
"doctype": "Workflow State",
"icon": "",
"modified": "2026-04-07 17:15:42.323547",
"name": "Draft",
"style": "",
"workflow_state_name": "Draft"
}
]
48 changes: 46 additions & 2 deletions rmax_custom/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"/assets/rmax_custom/js/sales_invoice_pos_total_popup.js",
"/assets/rmax_custom/js/sales_invoice_popup.js",
"/assets/rmax_custom/js/create_customer.js",
"/assets/rmax_custom/js/create_multiple_supplier.js"

"/assets/rmax_custom/js/create_multiple_supplier.js",
"/assets/rmax_custom/js/materiel_request.js"
]


Expand Down Expand Up @@ -257,6 +257,9 @@
# }

fixtures = [
"Workflow",
"Workflow State",
"Workflow Action Master",
{
"dt": "Custom Field",
"filters": [
Expand Down Expand Up @@ -297,5 +300,46 @@
]
]
]
},
{
"dt": "Custom Field",
"filters": [
[
"name",
"in",
[
# Sales Invoice
"Sales Invoice-custom_payment_mode",
"Sales Invoice-custom_inter_company_branch",

# Sales Invoice Item
"Sales Invoice Item-total_vat_linewise",


# Quotation
"Quotation-custom_payment_mode",

# Quotation Item
"Quotation Item-total_vat_linewise",


]
]
]
},
{
"dt": "Property Setter",
"filters": [
[
"name",
"in",
[
"Material Request Item-warehouse-hidden",
"Material Request Item-from_warehouse-hidden",
"Material Request Item-schedule_date-reqd"

]
]
]
}
]
41 changes: 41 additions & 0 deletions rmax_custom/public/js/materiel_request.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
frappe.ui.form.on('Material Request', {
refresh: function(frm) {
if (frm.is_new()) {
set_default_target(frm);
}
},

material_request_type: function(frm) {
set_default_target(frm);
}

});

function set_default_target(frm) {
if (!frm.doc.set_warehouse) {
frappe.call({
method: "frappe.client.get_list",
args: {
doctype: "User Permission",
filters: {
user: frappe.session.user,
allow: "Warehouse",
is_default: "1"
},
fields: ["for_value"]
},
callback: function(r) {
if (r.message && r.message.length > 0 && r.message[0].for_value) {

let default_wh = r.message[0].for_value;

frm.set_value('set_warehouse', default_wh).then(() => {
frm.refresh_field('set_warehouse');
});

}
}
});

}
}
Loading
Loading