Merge branch 'develop' into email-campaign
This commit is contained in:
commit
002474367b
@ -223,7 +223,10 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
|
|||||||
|
|
||||||
if(in_list(["Sales Invoice", "Purchase Invoice"], jvd.reference_type)) {
|
if(in_list(["Sales Invoice", "Purchase Invoice"], jvd.reference_type)) {
|
||||||
out.filters.push([jvd.reference_type, "outstanding_amount", "!=", 0]);
|
out.filters.push([jvd.reference_type, "outstanding_amount", "!=", 0]);
|
||||||
|
// Filter by cost center
|
||||||
|
if(jvd.cost_center) {
|
||||||
|
out.filters.push([jvd.reference_type, "cost_center", "in", ["", jvd.cost_center]]);
|
||||||
|
}
|
||||||
// account filter
|
// account filter
|
||||||
frappe.model.validate_missing(jvd, "account");
|
frappe.model.validate_missing(jvd, "account");
|
||||||
var party_account_field = jvd.reference_type==="Sales Invoice" ? "debit_to": "credit_to";
|
var party_account_field = jvd.reference_type==="Sales Invoice" ? "debit_to": "credit_to";
|
||||||
|
@ -1,751 +1,166 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
|
||||||
"allow_events_in_timeline": 0,
|
|
||||||
"allow_guest_to_view": 0,
|
|
||||||
"allow_import": 0,
|
|
||||||
"allow_rename": 0,
|
|
||||||
"beta": 0,
|
|
||||||
"creation": "2019-03-24 14:48:59.649168",
|
"creation": "2019-03-24 14:48:59.649168",
|
||||||
"custom": 0,
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "",
|
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
|
"field_order": [
|
||||||
|
"disable",
|
||||||
|
"column_break_2",
|
||||||
|
"rule_description",
|
||||||
|
"section_break_1",
|
||||||
|
"min_qty",
|
||||||
|
"max_qty",
|
||||||
|
"column_break_3",
|
||||||
|
"min_amount",
|
||||||
|
"max_amount",
|
||||||
|
"section_break_6",
|
||||||
|
"same_item",
|
||||||
|
"free_item",
|
||||||
|
"free_qty",
|
||||||
|
"column_break_9",
|
||||||
|
"free_item_uom",
|
||||||
|
"free_item_rate",
|
||||||
|
"section_break_12",
|
||||||
|
"warehouse",
|
||||||
|
"threshold_percentage",
|
||||||
|
"column_break_15",
|
||||||
|
"priority",
|
||||||
|
"apply_multiple_pricing_rules"
|
||||||
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"default": "0",
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "disable",
|
"fieldname": "disable",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"label": "Disable"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Disable",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "column_break_2",
|
"fieldname": "column_break_2",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break"
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "rule_description",
|
"fieldname": "rule_description",
|
||||||
"fieldtype": "Small Text",
|
"fieldtype": "Small Text",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Rule Description",
|
"label": "Rule Description",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"permlevel": 0,
|
"reqd": 1
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 1,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "section_break_1",
|
"fieldname": "section_break_1",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break"
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"default": "0",
|
"default": "0",
|
||||||
"fieldname": "min_qty",
|
"fieldname": "min_qty",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"label": "Min Qty"
|
||||||
"label": "Min Qty",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"default": "0",
|
"default": "0",
|
||||||
"fieldname": "max_qty",
|
"fieldname": "max_qty",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"label": "Max Qty"
|
||||||
"label": "Max Qty",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "column_break_3",
|
"fieldname": "column_break_3",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break"
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"default": "0",
|
"default": "0",
|
||||||
"fieldname": "min_amount",
|
"fieldname": "min_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"label": "Min Amount"
|
||||||
"label": "Min Amount",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"default": "0",
|
"default": "0",
|
||||||
"fieldname": "max_amount",
|
"fieldname": "max_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"label": "Max Amount"
|
||||||
"label": "Max Amount",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "section_break_6",
|
"fieldname": "section_break_6",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"label": "Free Item"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Free Item",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"default": "0",
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"depends_on": "eval:!parent.mixed_conditions",
|
"depends_on": "eval:!parent.mixed_conditions",
|
||||||
"fieldname": "same_item",
|
"fieldname": "same_item",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"label": "Same Item"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Same Item",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"depends_on": "eval:!doc.same_item || parent.mixed_conditions",
|
"depends_on": "eval:!doc.same_item || parent.mixed_conditions",
|
||||||
"fieldname": "free_item",
|
"fieldname": "free_item",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Item Code",
|
"label": "Item Code",
|
||||||
"length": 0,
|
"options": "Item"
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Item",
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "free_qty",
|
"fieldname": "free_qty",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"label": "Qty"
|
||||||
"label": "Qty",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "column_break_9",
|
"fieldname": "column_break_9",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break"
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "free_item_uom",
|
"fieldname": "free_item_uom",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "UOM",
|
"label": "UOM",
|
||||||
"length": 0,
|
"options": "UOM"
|
||||||
"no_copy": 0,
|
|
||||||
"options": "UOM",
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "free_item_rate",
|
"fieldname": "free_item_rate",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"label": "Rate"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Rate",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "section_break_12",
|
"fieldname": "section_break_12",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break"
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "warehouse",
|
"fieldname": "warehouse",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Warehouse",
|
"label": "Warehouse",
|
||||||
"length": 0,
|
"options": "Warehouse"
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Warehouse",
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "threshold_percentage",
|
"fieldname": "threshold_percentage",
|
||||||
"fieldtype": "Percent",
|
"fieldtype": "Percent",
|
||||||
"hidden": 0,
|
"label": "Threshold for Suggestion"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Threshold for Suggestion",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "column_break_15",
|
"fieldname": "column_break_15",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break"
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "priority",
|
"fieldname": "priority",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Priority",
|
"label": "Priority",
|
||||||
"length": 0,
|
"options": "\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20"
|
||||||
"no_copy": 0,
|
|
||||||
"options": "\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20",
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"default": "0",
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "apply_multiple_pricing_rules",
|
"fieldname": "apply_multiple_pricing_rules",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"label": "Apply Multiple Pricing Rules"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Apply Multiple Pricing Rules",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"has_web_view": 0,
|
|
||||||
"hide_heading": 0,
|
|
||||||
"hide_toolbar": 0,
|
|
||||||
"idx": 0,
|
|
||||||
"image_view": 0,
|
|
||||||
"in_create": 0,
|
|
||||||
"is_submittable": 0,
|
|
||||||
"issingle": 0,
|
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"modified": "2019-07-21 00:00:56.674284",
|
||||||
"modified": "2019-03-24 14:48:59.649168",
|
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Promotional Scheme Product Discount",
|
"name": "Promotional Scheme Product Discount",
|
||||||
"name_case": "",
|
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [],
|
"permissions": [],
|
||||||
"quick_entry": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"read_only_onload": 0,
|
|
||||||
"show_name_in_global_search": 0,
|
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC"
|
||||||
"track_changes": 0,
|
|
||||||
"track_seen": 0,
|
|
||||||
"track_views": 0
|
|
||||||
}
|
}
|
@ -336,6 +336,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
|
|
||||||
if not self.is_return:
|
if not self.is_return:
|
||||||
self.update_against_document_in_jv()
|
self.update_against_document_in_jv()
|
||||||
|
self.update_billing_status_for_zero_amount_refdoc("Purchase Receipt")
|
||||||
self.update_billing_status_for_zero_amount_refdoc("Purchase Order")
|
self.update_billing_status_for_zero_amount_refdoc("Purchase Order")
|
||||||
|
|
||||||
self.update_billing_status_in_pr()
|
self.update_billing_status_in_pr()
|
||||||
@ -774,6 +775,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
self.update_prevdoc_status()
|
self.update_prevdoc_status()
|
||||||
|
|
||||||
if not self.is_return:
|
if not self.is_return:
|
||||||
|
self.update_billing_status_for_zero_amount_refdoc("Purchase Receipt")
|
||||||
self.update_billing_status_for_zero_amount_refdoc("Purchase Order")
|
self.update_billing_status_for_zero_amount_refdoc("Purchase Order")
|
||||||
|
|
||||||
self.update_billing_status_in_pr()
|
self.update_billing_status_in_pr()
|
||||||
|
@ -166,6 +166,7 @@ class SalesInvoice(SellingController):
|
|||||||
self.make_gl_entries()
|
self.make_gl_entries()
|
||||||
|
|
||||||
if not self.is_return:
|
if not self.is_return:
|
||||||
|
self.update_billing_status_for_zero_amount_refdoc("Delivery Note")
|
||||||
self.update_billing_status_for_zero_amount_refdoc("Sales Order")
|
self.update_billing_status_for_zero_amount_refdoc("Sales Order")
|
||||||
self.check_credit_limit()
|
self.check_credit_limit()
|
||||||
|
|
||||||
@ -220,6 +221,7 @@ class SalesInvoice(SellingController):
|
|||||||
self.update_billing_status_in_dn()
|
self.update_billing_status_in_dn()
|
||||||
|
|
||||||
if not self.is_return:
|
if not self.is_return:
|
||||||
|
self.update_billing_status_for_zero_amount_refdoc("Delivery Note")
|
||||||
self.update_billing_status_for_zero_amount_refdoc("Sales Order")
|
self.update_billing_status_for_zero_amount_refdoc("Sales Order")
|
||||||
self.update_serial_no(in_cancel=True)
|
self.update_serial_no(in_cancel=True)
|
||||||
|
|
||||||
@ -396,16 +398,15 @@ class SalesInvoice(SellingController):
|
|||||||
self.account_for_change_amount = pos.get('account_for_change_amount')
|
self.account_for_change_amount = pos.get('account_for_change_amount')
|
||||||
|
|
||||||
for fieldname in ('territory', 'naming_series', 'currency', 'letter_head', 'tc_name',
|
for fieldname in ('territory', 'naming_series', 'currency', 'letter_head', 'tc_name',
|
||||||
'company', 'select_print_heading', 'cash_bank_account', 'write_off_account',
|
'company', 'select_print_heading', 'cash_bank_account', 'write_off_account', 'taxes_and_charges',
|
||||||
'write_off_cost_center', 'apply_discount_on', 'cost_center'):
|
'write_off_cost_center', 'apply_discount_on', 'cost_center'):
|
||||||
if (not for_validate) or (for_validate and not self.get(fieldname)):
|
if (not for_validate) or (for_validate and not self.get(fieldname)):
|
||||||
self.set(fieldname, pos.get(fieldname))
|
self.set(fieldname, pos.get(fieldname))
|
||||||
|
|
||||||
customer_price_list = frappe.get_value("Customer", self.customer, 'default_price_list')
|
customer_price_list = frappe.get_value("Customer", self.customer, 'default_price_list')
|
||||||
|
|
||||||
for field in ['taxes_and_charges', 'company_address']:
|
if pos.get("company_address"):
|
||||||
if pos.get(field):
|
self.company_address = pos.get("company_address")
|
||||||
self.set(field, pos.get(fieldname))
|
|
||||||
|
|
||||||
if not customer_price_list:
|
if not customer_price_list:
|
||||||
self.set('selling_price_list', pos.get('selling_price_list'))
|
self.set('selling_price_list', pos.get('selling_price_list'))
|
||||||
@ -1259,9 +1260,8 @@ def validate_inter_company_party(doctype, party, company, inter_company_referenc
|
|||||||
frappe.throw(_("Invalid Company for Inter Company Transaction."))
|
frappe.throw(_("Invalid Company for Inter Company Transaction."))
|
||||||
|
|
||||||
elif frappe.db.get_value(partytype, {"name": party, internal: 1}, "name") == party:
|
elif frappe.db.get_value(partytype, {"name": party, internal: 1}, "name") == party:
|
||||||
companies = frappe.db.sql("""select company from `tabAllowed To Transact With`
|
companies = frappe.get_all("Allowed To Transact With", fields=["company"], filters={"parenttype": partytype, "parent": party})
|
||||||
where parenttype = '{0}' and parent = '{1}'""".format(partytype, party), as_list = 1)
|
companies = [d.company for d in companies]
|
||||||
companies = [d[0] for d in companies]
|
|
||||||
if not company in companies:
|
if not company in companies:
|
||||||
frappe.throw(_("{0} not allowed to transact with {1}. Please change the Company.").format(partytype, company))
|
frappe.throw(_("{0} not allowed to transact with {1}. Please change the Company.").format(partytype, company))
|
||||||
|
|
||||||
|
@ -55,9 +55,16 @@ def get_columns():
|
|||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"width": 90
|
"width": 90
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "payment_document",
|
||||||
|
"label": _("Payment Document Type"),
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"options": "DocType",
|
||||||
|
"width": 220
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "payment_entry",
|
"fieldname": "payment_entry",
|
||||||
"label": _("Payment Entry"),
|
"label": _("Payment Document"),
|
||||||
"fieldtype": "Dynamic Link",
|
"fieldtype": "Dynamic Link",
|
||||||
"options": "payment_document",
|
"options": "payment_document",
|
||||||
"width": 220
|
"width": 220
|
||||||
|
@ -125,8 +125,9 @@ def get_account_type_based_data(company, account_type, period_list, accumulated_
|
|||||||
data["total"] = total
|
data["total"] = total
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def get_account_type_based_gl_data(company, start_date, end_date, account_type, filters):
|
def get_account_type_based_gl_data(company, start_date, end_date, account_type, filters={}):
|
||||||
cond = ""
|
cond = ""
|
||||||
|
filters = frappe._dict(filters)
|
||||||
|
|
||||||
if filters.finance_book:
|
if filters.finance_book:
|
||||||
cond = " and finance_book = %s" %(frappe.db.escape(filters.finance_book))
|
cond = " and finance_book = %s" %(frappe.db.escape(filters.finance_book))
|
||||||
|
@ -130,7 +130,7 @@ def get_cash_flow_data(fiscal_year, companies, filters):
|
|||||||
section_data.append(net_profit_loss)
|
section_data.append(net_profit_loss)
|
||||||
|
|
||||||
for account in cash_flow_account['account_types']:
|
for account in cash_flow_account['account_types']:
|
||||||
account_data = get_account_type_based_data(account['account_type'], companies, fiscal_year)
|
account_data = get_account_type_based_data(account['account_type'], companies, fiscal_year, filters)
|
||||||
account_data.update({
|
account_data.update({
|
||||||
"account_name": account['label'],
|
"account_name": account['label'],
|
||||||
"account": account['label'],
|
"account": account['label'],
|
||||||
@ -148,12 +148,12 @@ def get_cash_flow_data(fiscal_year, companies, filters):
|
|||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def get_account_type_based_data(account_type, companies, fiscal_year):
|
def get_account_type_based_data(account_type, companies, fiscal_year, filters):
|
||||||
data = {}
|
data = {}
|
||||||
total = 0
|
total = 0
|
||||||
for company in companies:
|
for company in companies:
|
||||||
amount = get_account_type_based_gl_data(company,
|
amount = get_account_type_based_gl_data(company,
|
||||||
fiscal_year.year_start_date, fiscal_year.year_end_date, account_type)
|
fiscal_year.year_start_date, fiscal_year.year_end_date, account_type, filters)
|
||||||
|
|
||||||
if amount and account_type == "Depreciation":
|
if amount and account_type == "Depreciation":
|
||||||
amount *= -1
|
amount *= -1
|
||||||
|
@ -690,7 +690,7 @@ def get_outstanding_invoices(party_type, party, account, condition=None, filters
|
|||||||
payment_amount = pe_map.get((d.voucher_type, d.voucher_no), 0)
|
payment_amount = pe_map.get((d.voucher_type, d.voucher_no), 0)
|
||||||
outstanding_amount = flt(d.invoice_amount - payment_amount, precision)
|
outstanding_amount = flt(d.invoice_amount - payment_amount, precision)
|
||||||
if outstanding_amount > 0.5 / (10**precision):
|
if outstanding_amount > 0.5 / (10**precision):
|
||||||
if (filters.get("outstanding_amt_greater_than") and
|
if (filters and filters.get("outstanding_amt_greater_than") and
|
||||||
not (outstanding_amount >= filters.get("outstanding_amt_greater_than") and
|
not (outstanding_amount >= filters.get("outstanding_amt_greater_than") and
|
||||||
outstanding_amount <= filters.get("outstanding_amt_less_than"))):
|
outstanding_amount <= filters.get("outstanding_amt_less_than"))):
|
||||||
continue
|
continue
|
||||||
|
@ -388,7 +388,8 @@ class Asset(AccountsController):
|
|||||||
"remarks": self.get("remarks") or _("Accounting Entry for Asset"),
|
"remarks": self.get("remarks") or _("Accounting Entry for Asset"),
|
||||||
"posting_date": self.available_for_use_date,
|
"posting_date": self.available_for_use_date,
|
||||||
"credit": self.purchase_receipt_amount,
|
"credit": self.purchase_receipt_amount,
|
||||||
"credit_in_account_currency": self.purchase_receipt_amount
|
"credit_in_account_currency": self.purchase_receipt_amount,
|
||||||
|
"cost_center": self.cost_center
|
||||||
}))
|
}))
|
||||||
|
|
||||||
gl_entries.append(self.get_gl_dict({
|
gl_entries.append(self.get_gl_dict({
|
||||||
@ -397,7 +398,8 @@ class Asset(AccountsController):
|
|||||||
"remarks": self.get("remarks") or _("Accounting Entry for Asset"),
|
"remarks": self.get("remarks") or _("Accounting Entry for Asset"),
|
||||||
"posting_date": self.available_for_use_date,
|
"posting_date": self.available_for_use_date,
|
||||||
"debit": self.purchase_receipt_amount,
|
"debit": self.purchase_receipt_amount,
|
||||||
"debit_in_account_currency": self.purchase_receipt_amount
|
"debit_in_account_currency": self.purchase_receipt_amount,
|
||||||
|
"cost_center": self.cost_center
|
||||||
}))
|
}))
|
||||||
|
|
||||||
if gl_entries:
|
if gl_entries:
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
"doctype": "Report",
|
"doctype": "Report",
|
||||||
"idx": 0,
|
"idx": 0,
|
||||||
"is_standard": "Yes",
|
"is_standard": "Yes",
|
||||||
"modified": "2019-03-29 17:18:06.678728",
|
"modified": "2019-07-21 23:24:21.094269",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Buying",
|
"module": "Buying",
|
||||||
"name": "Procurement Tracker",
|
"name": "Procurement Tracker",
|
||||||
@ -16,5 +16,12 @@
|
|||||||
"ref_doctype": "Purchase Order",
|
"ref_doctype": "Purchase Order",
|
||||||
"report_name": "Procurement Tracker",
|
"report_name": "Procurement Tracker",
|
||||||
"report_type": "Script Report",
|
"report_type": "Script Report",
|
||||||
"roles": []
|
"roles": [
|
||||||
|
{
|
||||||
|
"role": "Purchase Manager"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "Purchase User"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
@ -157,6 +157,13 @@ def get_data():
|
|||||||
"reference_doctype": "Purchase Order",
|
"reference_doctype": "Purchase Order",
|
||||||
"onboard": 1,
|
"onboard": 1,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "report",
|
||||||
|
"is_query_report": True,
|
||||||
|
"name": "Procurement Tracker",
|
||||||
|
"reference_doctype": "Purchase Order",
|
||||||
|
"onboard": 1,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "report",
|
"type": "report",
|
||||||
"is_query_report": True,
|
"is_query_report": True,
|
||||||
|
@ -861,7 +861,7 @@ class AccountsController(TransactionBase):
|
|||||||
|
|
||||||
if self.doctype in ("Sales Invoice", "Purchase Invoice"):
|
if self.doctype in ("Sales Invoice", "Purchase Invoice"):
|
||||||
grand_total = grand_total - flt(self.write_off_amount)
|
grand_total = grand_total - flt(self.write_off_amount)
|
||||||
if total != grand_total:
|
if total != flt(grand_total, self.precision("grand_total")):
|
||||||
frappe.throw(_("Total Payment Amount in Payment Schedule must be equal to Grand / Rounded Total"))
|
frappe.throw(_("Total Payment Amount in Payment Schedule must be equal to Grand / Rounded Total"))
|
||||||
|
|
||||||
def is_rounded_total_disabled(self):
|
def is_rounded_total_disabled(self):
|
||||||
|
@ -636,7 +636,8 @@ class BuyingController(StockController):
|
|||||||
asset.set_missing_values()
|
asset.set_missing_values()
|
||||||
asset.insert()
|
asset.insert()
|
||||||
|
|
||||||
frappe.msgprint(_("Asset {0} created").format(asset.name))
|
asset_link = frappe.utils.get_link_to_form('Asset', asset.name)
|
||||||
|
frappe.msgprint(_("Asset {0} created").format(asset_link))
|
||||||
return asset.name
|
return asset.name
|
||||||
|
|
||||||
def make_asset_movement(self, row):
|
def make_asset_movement(self, row):
|
||||||
|
@ -90,7 +90,8 @@ status_map = {
|
|||||||
["Transferred", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Material Transfer'"],
|
["Transferred", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Material Transfer'"],
|
||||||
["Issued", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Material Issue'"],
|
["Issued", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Material Issue'"],
|
||||||
["Received", "eval:self.status != 'Stopped' and self.per_received == 100 and self.docstatus == 1 and self.material_request_type == 'Purchase'"],
|
["Received", "eval:self.status != 'Stopped' and self.per_received == 100 and self.docstatus == 1 and self.material_request_type == 'Purchase'"],
|
||||||
["Partially Received", "eval:self.status != 'Stopped' and self.per_received > 0 and self.per_received < 100 and self.docstatus == 1 and self.material_request_type == 'Purchase'"]
|
["Partially Received", "eval:self.status != 'Stopped' and self.per_received > 0 and self.per_received < 100 and self.docstatus == 1 and self.material_request_type == 'Purchase'"],
|
||||||
|
["Manufactured", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Manufacture'"]
|
||||||
],
|
],
|
||||||
"Bank Transaction": [
|
"Bank Transaction": [
|
||||||
["Unreconciled", "eval:self.docstatus == 1 and self.unallocated_amount>0"],
|
["Unreconciled", "eval:self.docstatus == 1 and self.unallocated_amount>0"],
|
||||||
|
@ -7,14 +7,8 @@ cur_frm.email_field = "email_id";
|
|||||||
erpnext.LeadController = frappe.ui.form.Controller.extend({
|
erpnext.LeadController = frappe.ui.form.Controller.extend({
|
||||||
setup: function () {
|
setup: function () {
|
||||||
this.frm.make_methods = {
|
this.frm.make_methods = {
|
||||||
'Quotation': () => erpnext.utils.create_new_doc('Quotation', {
|
'Quotation': this.make_quotation,
|
||||||
'quotation_to': this.frm.doc.doctype,
|
'Opportunity': this.create_opportunity
|
||||||
'party_name': this.frm.doc.name
|
|
||||||
}),
|
|
||||||
'Opportunity': () => erpnext.utils.create_new_doc('Opportunity', {
|
|
||||||
'opportunity_from': this.frm.doc.doctype,
|
|
||||||
'party_name': this.frm.doc.name
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.frm.fields_dict.customer.get_query = function (doc, cdt, cdn) {
|
this.frm.fields_dict.customer.get_query = function (doc, cdt, cdn) {
|
||||||
|
@ -296,7 +296,9 @@ class TallyMigration(Document):
|
|||||||
else:
|
else:
|
||||||
function = voucher_to_journal_entry
|
function = voucher_to_journal_entry
|
||||||
try:
|
try:
|
||||||
vouchers.append(function(voucher))
|
processed_voucher = function(voucher)
|
||||||
|
if processed_voucher:
|
||||||
|
vouchers.append(processed_voucher)
|
||||||
except:
|
except:
|
||||||
self.log(voucher)
|
self.log(voucher)
|
||||||
return vouchers
|
return vouchers
|
||||||
@ -342,6 +344,10 @@ class TallyMigration(Document):
|
|||||||
account_field = "credit_to"
|
account_field = "credit_to"
|
||||||
account_name = encode_company_abbr(self.tally_creditors_account, self.erpnext_company)
|
account_name = encode_company_abbr(self.tally_creditors_account, self.erpnext_company)
|
||||||
price_list_field = "buying_price_list"
|
price_list_field = "buying_price_list"
|
||||||
|
else:
|
||||||
|
# Do not handle vouchers other than "Purchase", "Debit Note", "Sales" and "Credit Note"
|
||||||
|
# Do not handle Custom Vouchers either
|
||||||
|
return
|
||||||
|
|
||||||
invoice = {
|
invoice = {
|
||||||
"doctype": doctype,
|
"doctype": doctype,
|
||||||
|
@ -4,4 +4,17 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
test_records = frappe.get_test_records('Designation')
|
# test_records = frappe.get_test_records('Designation')
|
||||||
|
|
||||||
|
def create_designation(**args):
|
||||||
|
args = frappe._dict(args)
|
||||||
|
if frappe.db.exists("Designation", args.designation_name or "_Test designation"):
|
||||||
|
return frappe.get_doc("Designation", args.designation_name or "_Test designation")
|
||||||
|
|
||||||
|
designation = frappe.get_doc({
|
||||||
|
"doctype": "Designation",
|
||||||
|
"designation_name": args.designation_name or "_Test designation",
|
||||||
|
"description": args.description or "_Test description"
|
||||||
|
})
|
||||||
|
designation.save()
|
||||||
|
return designation
|
@ -12,6 +12,7 @@ from frappe.permissions import add_user_permission, remove_user_permission, \
|
|||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from erpnext.utilities.transaction_base import delete_events
|
from erpnext.utilities.transaction_base import delete_events
|
||||||
from frappe.utils.nestedset import NestedSet
|
from frappe.utils.nestedset import NestedSet
|
||||||
|
from erpnext.hr.doctype.job_offer.job_offer import get_staffing_plan_detail
|
||||||
|
|
||||||
class EmployeeUserDisabledError(frappe.ValidationError): pass
|
class EmployeeUserDisabledError(frappe.ValidationError): pass
|
||||||
class EmployeeLeftValidationError(frappe.ValidationError): pass
|
class EmployeeLeftValidationError(frappe.ValidationError): pass
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "Other",
|
"document_type": "Other",
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
|
"engine": "InnoDB",
|
||||||
"field_order": [
|
"field_order": [
|
||||||
"employee_settings",
|
"employee_settings",
|
||||||
"retirement_age",
|
"retirement_age",
|
||||||
@ -22,7 +23,9 @@
|
|||||||
"leave_status_notification_template",
|
"leave_status_notification_template",
|
||||||
"column_break_18",
|
"column_break_18",
|
||||||
"leave_approver_mandatory_in_leave_application",
|
"leave_approver_mandatory_in_leave_application",
|
||||||
"show_leaves_of_all_department_members_in_calendar"
|
"show_leaves_of_all_department_members_in_calendar",
|
||||||
|
"hiring_settings",
|
||||||
|
"check_vacancies"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
@ -44,18 +47,6 @@
|
|||||||
"label": "Employee Records to be created by",
|
"label": "Employee Records to be created by",
|
||||||
"options": "Naming Series\nEmployee Number\nFull Name"
|
"options": "Naming Series\nEmployee Number\nFull Name"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"fieldname": "leave_approval_notification_template",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "Leave Approval Notification Template",
|
|
||||||
"options": "Email Template"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "leave_status_notification_template",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "Leave Status Notification Template",
|
|
||||||
"options": "Email Template"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"fieldname": "column_break_4",
|
"fieldname": "column_break_4",
|
||||||
"fieldtype": "Column Break"
|
"fieldtype": "Column Break"
|
||||||
@ -67,12 +58,6 @@
|
|||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Stop Birthday Reminders"
|
"label": "Stop Birthday Reminders"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"default": "1",
|
|
||||||
"fieldname": "leave_approver_mandatory_in_leave_application",
|
|
||||||
"fieldtype": "Check",
|
|
||||||
"label": "Leave Approver Mandatory In Leave Application"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"default": "1",
|
"default": "1",
|
||||||
"fieldname": "expense_approver_mandatory_in_expense_claim",
|
"fieldname": "expense_approver_mandatory_in_expense_claim",
|
||||||
@ -91,6 +76,15 @@
|
|||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Include holidays in Total no. of Working Days"
|
"label": "Include holidays in Total no. of Working Days"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "max_working_hours_against_timesheet",
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"label": "Max working hours against Timesheet"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_11",
|
||||||
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"default": "1",
|
"default": "1",
|
||||||
"description": "Emails salary slip to employee based on preferred email selected in Employee",
|
"description": "Emails salary slip to employee based on preferred email selected in Employee",
|
||||||
@ -115,15 +109,33 @@
|
|||||||
"label": "Password Policy"
|
"label": "Password Policy"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "max_working_hours_against_timesheet",
|
"collapsible": 1,
|
||||||
"fieldtype": "Float",
|
|
||||||
"label": "Max working hours against Timesheet"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "leave_settings",
|
"fieldname": "leave_settings",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"label": "Leave Settings"
|
"label": "Leave Settings"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "leave_approval_notification_template",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Leave Approval Notification Template",
|
||||||
|
"options": "Email Template"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "leave_status_notification_template",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Leave Status Notification Template",
|
||||||
|
"options": "Email Template"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_18",
|
||||||
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "1",
|
||||||
|
"fieldname": "leave_approver_mandatory_in_leave_application",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Leave Approver Mandatory In Leave Application"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"default": "0",
|
"default": "0",
|
||||||
"fieldname": "show_leaves_of_all_department_members_in_calendar",
|
"fieldname": "show_leaves_of_all_department_members_in_calendar",
|
||||||
@ -131,18 +143,22 @@
|
|||||||
"label": "Show Leaves Of All Department Members In Calendar"
|
"label": "Show Leaves Of All Department Members In Calendar"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "column_break_11",
|
"collapsible": 1,
|
||||||
"fieldtype": "Column Break"
|
"fieldname": "hiring_settings",
|
||||||
|
"fieldtype": "Section Break",
|
||||||
|
"label": "Hiring Settings"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "column_break_18",
|
"default": "0",
|
||||||
"fieldtype": "Column Break"
|
"fieldname": "check_vacancies",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Check Vacancies On Job Offer Creation"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-cog",
|
"icon": "fa fa-cog",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"modified": "2019-05-31 16:18:50.245872",
|
"modified": "2019-07-01 18:59:55.256878",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "HR Settings",
|
"name": "HR Settings",
|
||||||
@ -158,5 +174,6 @@
|
|||||||
"write": 1
|
"write": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"sort_field": "modified",
|
||||||
"sort_order": "ASC"
|
"sort_order": "ASC"
|
||||||
}
|
}
|
@ -39,7 +39,7 @@
|
|||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"remember_last_selected_value": 0,
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 1,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
@ -71,7 +71,7 @@
|
|||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"remember_last_selected_value": 0,
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 1,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
@ -96,7 +96,7 @@
|
|||||||
"label": "Status",
|
"label": "Status",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"options": "Open\nReplied\nRejected\nHold",
|
"options": "Open\nReplied\nRejected\nHold\nAccepted",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
@ -346,7 +346,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2018-08-21 16:15:43.552049",
|
"modified": "2019-06-21 16:15:43.552049",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Job Applicant",
|
"name": "Job Applicant",
|
||||||
|
@ -10,3 +10,14 @@ import unittest
|
|||||||
|
|
||||||
class TestJobApplicant(unittest.TestCase):
|
class TestJobApplicant(unittest.TestCase):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def create_job_applicant(**args):
|
||||||
|
args = frappe._dict(args)
|
||||||
|
job_applicant = frappe.get_doc({
|
||||||
|
"doctype": "Job Applicant",
|
||||||
|
"applicant_name": args.applicant_name or "_Test Applicant",
|
||||||
|
"email_id": args.email_id or "test_applicant@example.com",
|
||||||
|
"status": args.status or "Open"
|
||||||
|
})
|
||||||
|
job_applicant.save()
|
||||||
|
return job_applicant
|
@ -5,12 +5,56 @@ from __future__ import unicode_literals
|
|||||||
import frappe
|
import frappe
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from frappe.model.mapper import get_mapped_doc
|
from frappe.model.mapper import get_mapped_doc
|
||||||
|
from frappe import _
|
||||||
|
from frappe.utils.data import get_link_to_form
|
||||||
|
|
||||||
class JobOffer(Document):
|
class JobOffer(Document):
|
||||||
def onload(self):
|
def onload(self):
|
||||||
employee = frappe.db.get_value("Employee", {"job_applicant": self.job_applicant}, "name") or ""
|
employee = frappe.db.get_value("Employee", {"job_applicant": self.job_applicant}, "name") or ""
|
||||||
self.set_onload("employee", employee)
|
self.set_onload("employee", employee)
|
||||||
|
|
||||||
|
def validate(self):
|
||||||
|
self.validate_vacancies()
|
||||||
|
|
||||||
|
def validate_vacancies(self):
|
||||||
|
staffing_plan = get_staffing_plan_detail(self.designation, self.company, self.offer_date)
|
||||||
|
check_vacancies = frappe.get_single("HR Settings").check_vacancies
|
||||||
|
if staffing_plan and check_vacancies:
|
||||||
|
vacancies = frappe.db.get_value("Staffing Plan Detail", filters={"name": staffing_plan.name}, fieldname=['vacancies'])
|
||||||
|
job_offers = len(self.get_job_offer(staffing_plan.from_date, staffing_plan.to_date))
|
||||||
|
if vacancies - job_offers <= 0:
|
||||||
|
frappe.throw(_("There are no vacancies under staffing plan {0}").format(get_link_to_form("Staffing Plan", staffing_plan.parent)))
|
||||||
|
|
||||||
|
def on_change(self):
|
||||||
|
update_job_applicant(self.status, self.job_applicant)
|
||||||
|
|
||||||
|
def get_job_offer(self, from_date, to_date):
|
||||||
|
''' Returns job offer created during a time period '''
|
||||||
|
return frappe.get_all("Job Offer", filters={
|
||||||
|
"offer_date": ['between', (from_date, to_date)],
|
||||||
|
"designation": self.designation,
|
||||||
|
"company": self.company
|
||||||
|
}, fields=['name'])
|
||||||
|
|
||||||
|
def update_job_applicant(status, job_applicant):
|
||||||
|
if status in ("Accepted", "Rejected"):
|
||||||
|
frappe.set_value("Job Applicant", job_applicant, "status", status)
|
||||||
|
|
||||||
|
def get_staffing_plan_detail(designation, company, offer_date):
|
||||||
|
detail = frappe.db.sql("""
|
||||||
|
SELECT spd.name as name,
|
||||||
|
sp.from_date as from_date,
|
||||||
|
sp.to_date as to_date,
|
||||||
|
sp.name as parent
|
||||||
|
FROM `tabStaffing Plan Detail` spd, `tabStaffing Plan` sp
|
||||||
|
WHERE
|
||||||
|
sp.docstatus=1
|
||||||
|
AND spd.designation=%s
|
||||||
|
AND sp.company=%s
|
||||||
|
AND %s between sp.from_date and sp.to_date
|
||||||
|
""", (designation, company, offer_date), as_dict=1)
|
||||||
|
return detail[0] if detail else None
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def make_employee(source_name, target_doc=None):
|
def make_employee(source_name, target_doc=None):
|
||||||
def set_missing_values(source, target):
|
def set_missing_values(source, target):
|
||||||
@ -23,4 +67,3 @@ def make_employee(source_name, target_doc=None):
|
|||||||
}}
|
}}
|
||||||
}, target_doc, set_missing_values)
|
}, target_doc, set_missing_values)
|
||||||
return doc
|
return doc
|
||||||
|
|
||||||
|
@ -4,8 +4,78 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
import unittest
|
import unittest
|
||||||
|
from frappe.utils import nowdate, add_days
|
||||||
|
from erpnext.hr.doctype.job_applicant.test_job_applicant import create_job_applicant
|
||||||
|
from erpnext.hr.doctype.designation.test_designation import create_designation
|
||||||
|
from erpnext.hr.doctype.staffing_plan.test_staffing_plan import make_company
|
||||||
|
|
||||||
# test_records = frappe.get_test_records('Job Offer')
|
# test_records = frappe.get_test_records('Job Offer')
|
||||||
|
|
||||||
class TestJobOffer(unittest.TestCase):
|
class TestJobOffer(unittest.TestCase):
|
||||||
pass
|
def test_job_offer_creation_against_vacancies(self):
|
||||||
|
create_staffing_plan(staffing_details=[{
|
||||||
|
"designation": "Designer",
|
||||||
|
"vacancies": 0,
|
||||||
|
"estimated_cost_per_position": 5000
|
||||||
|
}])
|
||||||
|
frappe.db.set_value("HR Settings", None, "check_vacancies", 1)
|
||||||
|
job_applicant = create_job_applicant(email_id="test_job_offer@example.com")
|
||||||
|
job_offer = create_job_offer(job_applicant=job_applicant.name, designation="Researcher")
|
||||||
|
self.assertRaises(frappe.ValidationError, job_offer.submit)
|
||||||
|
|
||||||
|
# test creation of job offer when vacancies are not present
|
||||||
|
frappe.db.set_value("HR Settings", None, "check_vacancies", 0)
|
||||||
|
job_offer.submit()
|
||||||
|
self.assertTrue(frappe.db.exists("Job Offer", job_offer.name))
|
||||||
|
|
||||||
|
def test_job_applicant_update(self):
|
||||||
|
create_staffing_plan()
|
||||||
|
job_applicant = create_job_applicant(email_id="test_job_applicants@example.com")
|
||||||
|
job_offer = create_job_offer(job_applicant=job_applicant.name)
|
||||||
|
job_offer.submit()
|
||||||
|
job_applicant.reload()
|
||||||
|
self.assertEquals(job_applicant.status, "Accepted")
|
||||||
|
|
||||||
|
# status update after rejection
|
||||||
|
job_offer.status = "Rejected"
|
||||||
|
job_offer.submit()
|
||||||
|
job_applicant.reload()
|
||||||
|
self.assertEquals(job_applicant.status, "Rejected")
|
||||||
|
|
||||||
|
def create_job_offer(**args):
|
||||||
|
args = frappe._dict(args)
|
||||||
|
if not args.job_applicant:
|
||||||
|
job_applicant = create_job_applicant()
|
||||||
|
|
||||||
|
if not frappe.db.exists("Designation", args.designation):
|
||||||
|
designation = create_designation(designation_name=args.designation)
|
||||||
|
|
||||||
|
job_offer = frappe.get_doc({
|
||||||
|
"doctype": "Job Offer",
|
||||||
|
"job_applicant": args.job_applicant or job_applicant.name,
|
||||||
|
"offer_date": args.offer_date or nowdate(),
|
||||||
|
"designation": args.designation or "Researcher",
|
||||||
|
"status": args.status or "Accepted"
|
||||||
|
})
|
||||||
|
return job_offer
|
||||||
|
|
||||||
|
def create_staffing_plan(**args):
|
||||||
|
args = frappe._dict(args)
|
||||||
|
make_company()
|
||||||
|
frappe.db.set_value("Company", "_Test Company", "is_group", 1)
|
||||||
|
if frappe.db.exists("Staffing Plan", args.name or "Test"):
|
||||||
|
return
|
||||||
|
staffing_plan = frappe.get_doc({
|
||||||
|
"doctype": "Staffing Plan",
|
||||||
|
"name": args.name or "Test",
|
||||||
|
"from_date": args.from_date or nowdate(),
|
||||||
|
"to_date": args.to_date or add_days(nowdate(), 10),
|
||||||
|
"staffing_details": args.staffing_details or [{
|
||||||
|
"designation": "Researcher",
|
||||||
|
"vacancies": 1,
|
||||||
|
"estimated_cost_per_position": 50000
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
staffing_plan.insert()
|
||||||
|
staffing_plan.submit()
|
||||||
|
return staffing_plan
|
@ -30,7 +30,7 @@ class LoanApplication(Document):
|
|||||||
monthly_interest_rate = flt(self.rate_of_interest) / (12 *100)
|
monthly_interest_rate = flt(self.rate_of_interest) / (12 *100)
|
||||||
if monthly_interest_rate:
|
if monthly_interest_rate:
|
||||||
min_repayment_amount = self.loan_amount*monthly_interest_rate
|
min_repayment_amount = self.loan_amount*monthly_interest_rate
|
||||||
if self.repayment_amount - min_repayment_amount < 0:
|
if self.repayment_amount - min_repayment_amount <= 0:
|
||||||
frappe.throw(_("Repayment Amount must be greater than " \
|
frappe.throw(_("Repayment Amount must be greater than " \
|
||||||
+ str(flt(min_repayment_amount, 2))))
|
+ str(flt(min_repayment_amount, 2))))
|
||||||
self.repayment_periods = math.ceil((math.log(self.repayment_amount) -
|
self.repayment_periods = math.ceil((math.log(self.repayment_amount) -
|
||||||
|
@ -5,7 +5,7 @@ frappe.ui.form.on('Staffing Plan', {
|
|||||||
setup: function(frm) {
|
setup: function(frm) {
|
||||||
frm.set_query("designation", "staffing_details", function() {
|
frm.set_query("designation", "staffing_details", function() {
|
||||||
let designations = [];
|
let designations = [];
|
||||||
$.each(frm.doc.staffing_details, function(index, staff_detail) {
|
(frm.doc.staffing_details || []).forEach(function(staff_detail) {
|
||||||
if(staff_detail.designation){
|
if(staff_detail.designation){
|
||||||
designations.push(staff_detail.designation)
|
designations.push(staff_detail.designation)
|
||||||
}
|
}
|
||||||
@ -25,13 +25,37 @@ frappe.ui.form.on('Staffing Plan', {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
frappe.ui.form.on('Staffing Plan Detail', {
|
frappe.ui.form.on('Staffing Plan Detail', {
|
||||||
designation: function(frm, cdt, cdn) {
|
designation: function(frm, cdt, cdn) {
|
||||||
let child = locals[cdt][cdn]
|
let child = locals[cdt][cdn];
|
||||||
if(frm.doc.company && child.designation) {
|
if(frm.doc.company && child.designation) {
|
||||||
|
set_number_of_positions(frm, cdt, cdn);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
vacancies: function(frm, cdt, cdn) {
|
||||||
|
let child = locals[cdt][cdn];
|
||||||
|
if(child.vacancies < child.current_openings) {
|
||||||
|
frappe.throw(__("Vacancies cannot be lower than the current openings"));
|
||||||
|
}
|
||||||
|
set_number_of_positions(frm, cdt, cdn);
|
||||||
|
},
|
||||||
|
|
||||||
|
current_count: function(frm, cdt, cdn) {
|
||||||
|
set_number_of_positions(frm, cdt, cdn);
|
||||||
|
},
|
||||||
|
|
||||||
|
estimated_cost_per_position: function(frm, cdt, cdn) {
|
||||||
|
set_total_estimated_cost(frm, cdt, cdn);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var set_number_of_positions = function(frm, cdt, cdn) {
|
||||||
|
let child = locals[cdt][cdn];
|
||||||
|
if (!child.designation) frappe.throw(__("Please enter the designation"));
|
||||||
frappe.call({
|
frappe.call({
|
||||||
"method": "erpnext.hr.doctype.staffing_plan.staffing_plan.get_designation_counts",
|
"method": "erpnext.hr.doctype.staffing_plan.staffing_plan.get_designation_counts",
|
||||||
args: {
|
args: {
|
||||||
@ -42,8 +66,9 @@ frappe.ui.form.on('Staffing Plan Detail', {
|
|||||||
if(data.message){
|
if(data.message){
|
||||||
frappe.model.set_value(cdt, cdn, 'current_count', data.message.employee_count);
|
frappe.model.set_value(cdt, cdn, 'current_count', data.message.employee_count);
|
||||||
frappe.model.set_value(cdt, cdn, 'current_openings', data.message.job_openings);
|
frappe.model.set_value(cdt, cdn, 'current_openings', data.message.job_openings);
|
||||||
if (child.number_of_positions < (data.message.employee_count + data.message.job_openings)){
|
let total_positions = cint(data.message.employee_count) + cint(child.vacancies);
|
||||||
frappe.model.set_value(cdt, cdn, 'number_of_positions', data.message.employee_count + data.message.job_openings);
|
if (cint(child.number_of_positions) < total_positions){
|
||||||
|
frappe.model.set_value(cdt, cdn, 'number_of_positions', total_positions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{ // No employees for this designation
|
else{ // No employees for this designation
|
||||||
@ -52,42 +77,11 @@ frappe.ui.form.on('Staffing Plan Detail', {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
refresh_field("staffing_details");
|
||||||
},
|
|
||||||
|
|
||||||
number_of_positions: function(frm, cdt, cdn) {
|
|
||||||
set_vacancies(frm, cdt, cdn);
|
|
||||||
},
|
|
||||||
|
|
||||||
current_count: function(frm, cdt, cdn) {
|
|
||||||
set_vacancies(frm, cdt, cdn);
|
|
||||||
},
|
|
||||||
|
|
||||||
estimated_cost_per_position: function(frm, cdt, cdn) {
|
|
||||||
let child = locals[cdt][cdn];
|
|
||||||
set_total_estimated_cost(frm, cdt, cdn);
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
var set_vacancies = function(frm, cdt, cdn) {
|
|
||||||
let child = locals[cdt][cdn]
|
|
||||||
if (child.number_of_positions < (child.current_count + child.current_openings)){
|
|
||||||
frappe.throw(__("Number of positions cannot be less then current count of employees"))
|
|
||||||
}
|
|
||||||
|
|
||||||
if(child.number_of_positions > 0) {
|
|
||||||
frappe.model.set_value(cdt, cdn, 'vacancies', child.number_of_positions - (child.current_count + child.current_openings));
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
frappe.model.set_value(cdt, cdn, 'vacancies', 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
set_total_estimated_cost(frm, cdt, cdn);
|
set_total_estimated_cost(frm, cdt, cdn);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: Estimated Cost is calculated on number of Vacancies
|
// Note: Estimated Cost is calculated on number of Vacancies
|
||||||
// Validate for > 0 ?
|
|
||||||
var set_total_estimated_cost = function(frm, cdt, cdn) {
|
var set_total_estimated_cost = function(frm, cdt, cdn) {
|
||||||
let child = locals[cdt][cdn]
|
let child = locals[cdt][cdn]
|
||||||
if(child.vacancies > 0 && child.estimated_cost_per_position) {
|
if(child.vacancies > 0 && child.estimated_cost_per_position) {
|
||||||
@ -102,7 +96,7 @@ var set_total_estimated_cost = function(frm, cdt, cdn) {
|
|||||||
var set_total_estimated_budget = function(frm) {
|
var set_total_estimated_budget = function(frm) {
|
||||||
let estimated_budget = 0.0
|
let estimated_budget = 0.0
|
||||||
if(frm.doc.staffing_details) {
|
if(frm.doc.staffing_details) {
|
||||||
$.each(frm.doc.staffing_details, function(index, staff_detail) {
|
(frm.doc.staffing_details || []).forEach(function(staff_detail) {
|
||||||
if(staff_detail.total_estimated_cost){
|
if(staff_detail.total_estimated_cost){
|
||||||
estimated_budget += staff_detail.total_estimated_cost
|
estimated_budget += staff_detail.total_estimated_cost
|
||||||
}
|
}
|
||||||
|
@ -13,41 +13,39 @@ class ParentCompanyError(frappe.ValidationError): pass
|
|||||||
|
|
||||||
class StaffingPlan(Document):
|
class StaffingPlan(Document):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
|
self.validate_period()
|
||||||
|
self.validate_details()
|
||||||
|
self.set_total_estimated_budget()
|
||||||
|
|
||||||
|
def validate_period(self):
|
||||||
# Validate Dates
|
# Validate Dates
|
||||||
if self.from_date and self.to_date and self.from_date > self.to_date:
|
if self.from_date and self.to_date and self.from_date > self.to_date:
|
||||||
frappe.throw(_("From Date cannot be greater than To Date"))
|
frappe.throw(_("From Date cannot be greater than To Date"))
|
||||||
|
|
||||||
self.total_estimated_budget = 0
|
def validate_details(self):
|
||||||
|
|
||||||
for detail in self.get("staffing_details"):
|
for detail in self.get("staffing_details"):
|
||||||
self.set_vacancies(detail)
|
|
||||||
self.validate_overlap(detail)
|
self.validate_overlap(detail)
|
||||||
self.validate_with_subsidiary_plans(detail)
|
self.validate_with_subsidiary_plans(detail)
|
||||||
self.validate_with_parent_plan(detail)
|
self.validate_with_parent_plan(detail)
|
||||||
|
|
||||||
|
def set_total_estimated_budget(self):
|
||||||
|
self.total_estimated_budget = 0
|
||||||
|
|
||||||
|
for detail in self.get("staffing_details"):
|
||||||
#Set readonly fields
|
#Set readonly fields
|
||||||
|
self.set_number_of_positions(detail)
|
||||||
designation_counts = get_designation_counts(detail.designation, self.company)
|
designation_counts = get_designation_counts(detail.designation, self.company)
|
||||||
detail.current_count = designation_counts['employee_count']
|
detail.current_count = designation_counts['employee_count']
|
||||||
detail.current_openings = designation_counts['job_openings']
|
detail.current_openings = designation_counts['job_openings']
|
||||||
|
|
||||||
if detail.number_of_positions < (detail.current_count + detail.current_openings):
|
if detail.number_of_positions > 0:
|
||||||
frappe.throw(_("Number of positions cannot be less then current count of employees"))
|
|
||||||
elif detail.number_of_positions > 0:
|
|
||||||
detail.vacancies = detail.number_of_positions - (detail.current_count + detail.current_openings)
|
|
||||||
if detail.vacancies > 0 and detail.estimated_cost_per_position:
|
if detail.vacancies > 0 and detail.estimated_cost_per_position:
|
||||||
detail.total_estimated_cost = detail.vacancies * detail.estimated_cost_per_position
|
detail.total_estimated_cost = cint(detail.vacancies) * flt(detail.estimated_cost_per_position)
|
||||||
else: detail.total_estimated_cost = 0
|
|
||||||
else: detail.vacancies = detail.number_of_positions = detail.total_estimated_cost = 0
|
|
||||||
self.total_estimated_budget += detail.total_estimated_cost
|
self.total_estimated_budget += detail.total_estimated_cost
|
||||||
|
|
||||||
def set_vacancies(self, row):
|
def set_number_of_positions(self, detail):
|
||||||
if not row.vacancies:
|
detail.number_of_positions = cint(detail.vacancies) + cint(detail.current_count)
|
||||||
current_openings = 0
|
|
||||||
for field in ['current_count', 'current_openings']:
|
|
||||||
if row.get(field):
|
|
||||||
current_openings += row.get(field)
|
|
||||||
|
|
||||||
row.vacancies = row.number_of_positions - current_openings
|
|
||||||
|
|
||||||
def validate_overlap(self, staffing_plan_detail):
|
def validate_overlap(self, staffing_plan_detail):
|
||||||
# Validate if any submitted Staffing Plan exist for any Designations in this plan
|
# Validate if any submitted Staffing Plan exist for any Designations in this plan
|
||||||
@ -132,19 +130,24 @@ def get_designation_counts(designation, company):
|
|||||||
if not designation:
|
if not designation:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
employee_counts_dict = {}
|
employee_counts = {}
|
||||||
lft, rgt = frappe.get_cached_value('Company', company, ["lft", "rgt"])
|
company_set = get_company_set(company)
|
||||||
employee_counts_dict["employee_count"] = frappe.db.sql("""select count(*) from `tabEmployee`
|
|
||||||
where designation = %s and status='Active'
|
|
||||||
and company in (select name from tabCompany where lft>=%s and rgt<=%s)
|
|
||||||
""", (designation, lft, rgt))[0][0]
|
|
||||||
|
|
||||||
employee_counts_dict['job_openings'] = frappe.db.sql("""select count(*) from `tabJob Opening` \
|
employee_counts["employee_count"] = frappe.db.get_value("Employee",
|
||||||
where designation=%s and status='Open'
|
filters={
|
||||||
and company in (select name from tabCompany where lft>=%s and rgt<=%s)
|
'designation': designation,
|
||||||
""", (designation, lft, rgt))[0][0]
|
'status': 'Active',
|
||||||
|
'company': ('in', company_set)
|
||||||
|
}, fieldname=['count(name)'])
|
||||||
|
|
||||||
return employee_counts_dict
|
employee_counts['job_openings'] = frappe.db.get_value("Job Opening",
|
||||||
|
filters={
|
||||||
|
'designation': designation,
|
||||||
|
'status': 'Open',
|
||||||
|
'company': ('in', company_set)
|
||||||
|
}, fieldname=['count(name)'])
|
||||||
|
|
||||||
|
return employee_counts
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_active_staffing_plan_details(company, designation, from_date=getdate(nowdate()), to_date=getdate(nowdate())):
|
def get_active_staffing_plan_details(company, designation, from_date=getdate(nowdate()), to_date=getdate(nowdate())):
|
||||||
@ -165,3 +168,13 @@ def get_active_staffing_plan_details(company, designation, from_date=getdate(now
|
|||||||
|
|
||||||
# Only a single staffing plan can be active for a designation on given date
|
# Only a single staffing plan can be active for a designation on given date
|
||||||
return staffing_plan if staffing_plan else None
|
return staffing_plan if staffing_plan else None
|
||||||
|
|
||||||
|
def get_company_set(company):
|
||||||
|
return frappe.db.sql_list("""
|
||||||
|
SELECT
|
||||||
|
name
|
||||||
|
FROM `tabCompany`
|
||||||
|
WHERE
|
||||||
|
parent_company=%(company)s
|
||||||
|
OR name=%(company)s
|
||||||
|
""", (dict(company=company)))
|
@ -24,7 +24,7 @@ class TestStaffingPlan(unittest.TestCase):
|
|||||||
staffing_plan.to_date = add_days(nowdate(), 10)
|
staffing_plan.to_date = add_days(nowdate(), 10)
|
||||||
staffing_plan.append("staffing_details", {
|
staffing_plan.append("staffing_details", {
|
||||||
"designation": "Designer",
|
"designation": "Designer",
|
||||||
"number_of_positions": 6,
|
"vacancies": 6,
|
||||||
"estimated_cost_per_position": 50000
|
"estimated_cost_per_position": 50000
|
||||||
})
|
})
|
||||||
staffing_plan.insert()
|
staffing_plan.insert()
|
||||||
@ -42,7 +42,7 @@ class TestStaffingPlan(unittest.TestCase):
|
|||||||
staffing_plan.to_date = add_days(nowdate(), 10)
|
staffing_plan.to_date = add_days(nowdate(), 10)
|
||||||
staffing_plan.append("staffing_details", {
|
staffing_plan.append("staffing_details", {
|
||||||
"designation": "Designer",
|
"designation": "Designer",
|
||||||
"number_of_positions": 3,
|
"vacancies": 3,
|
||||||
"estimated_cost_per_position": 45000
|
"estimated_cost_per_position": 45000
|
||||||
})
|
})
|
||||||
self.assertRaises(SubsidiaryCompanyError, staffing_plan.insert)
|
self.assertRaises(SubsidiaryCompanyError, staffing_plan.insert)
|
||||||
@ -58,7 +58,7 @@ class TestStaffingPlan(unittest.TestCase):
|
|||||||
staffing_plan.to_date = add_days(nowdate(), 10)
|
staffing_plan.to_date = add_days(nowdate(), 10)
|
||||||
staffing_plan.append("staffing_details", {
|
staffing_plan.append("staffing_details", {
|
||||||
"designation": "Designer",
|
"designation": "Designer",
|
||||||
"number_of_positions": 7,
|
"vacancies": 7,
|
||||||
"estimated_cost_per_position": 50000
|
"estimated_cost_per_position": 50000
|
||||||
})
|
})
|
||||||
staffing_plan.insert()
|
staffing_plan.insert()
|
||||||
@ -73,7 +73,7 @@ class TestStaffingPlan(unittest.TestCase):
|
|||||||
staffing_plan.to_date = add_days(nowdate(), 10)
|
staffing_plan.to_date = add_days(nowdate(), 10)
|
||||||
staffing_plan.append("staffing_details", {
|
staffing_plan.append("staffing_details", {
|
||||||
"designation": "Designer",
|
"designation": "Designer",
|
||||||
"number_of_positions": 7,
|
"vacancies": 7,
|
||||||
"estimated_cost_per_position": 60000
|
"estimated_cost_per_position": 60000
|
||||||
})
|
})
|
||||||
staffing_plan.insert()
|
staffing_plan.insert()
|
||||||
|
@ -1,297 +1,79 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
|
||||||
"allow_guest_to_view": 0,
|
|
||||||
"allow_import": 0,
|
|
||||||
"allow_rename": 0,
|
|
||||||
"beta": 0,
|
|
||||||
"creation": "2018-04-13 18:04:20.978931",
|
"creation": "2018-04-13 18:04:20.978931",
|
||||||
"custom": 0,
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "",
|
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
|
"field_order": [
|
||||||
|
"designation",
|
||||||
|
"vacancies",
|
||||||
|
"estimated_cost_per_position",
|
||||||
|
"total_estimated_cost",
|
||||||
|
"column_break_5",
|
||||||
|
"current_count",
|
||||||
|
"current_openings",
|
||||||
|
"number_of_positions"
|
||||||
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "designation",
|
"fieldname": "designation",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Designation",
|
"label": "Designation",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Designation",
|
"options": "Designation",
|
||||||
"permlevel": 0,
|
"reqd": 1
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 1,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "number_of_positions",
|
"fieldname": "number_of_positions",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Number Of Positions",
|
"label": "Number Of Positions",
|
||||||
"length": 0,
|
"read_only": 1
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "estimated_cost_per_position",
|
"fieldname": "estimated_cost_per_position",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"label": "Estimated Cost Per Position"
|
||||||
"label": "Estimated Cost Per Position",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "column_break_5",
|
"fieldname": "column_break_5",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break"
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "current_count",
|
"fieldname": "current_count",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Current Count",
|
"label": "Current Count",
|
||||||
"length": 0,
|
"read_only": 1
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "current_openings",
|
"fieldname": "current_openings",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Current Openings",
|
"label": "Current Openings",
|
||||||
"length": 0,
|
"read_only": 1
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "vacancies",
|
"fieldname": "vacancies",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"label": "Vacancies"
|
||||||
"label": "Vacancies",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "total_estimated_cost",
|
"fieldname": "total_estimated_cost",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Total Estimated Cost",
|
"label": "Total Estimated Cost",
|
||||||
"length": 0,
|
"read_only": 1
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"has_web_view": 0,
|
|
||||||
"hide_heading": 0,
|
|
||||||
"hide_toolbar": 0,
|
|
||||||
"idx": 0,
|
|
||||||
"image_view": 0,
|
|
||||||
"in_create": 0,
|
|
||||||
"is_submittable": 0,
|
|
||||||
"issingle": 0,
|
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"modified": "2019-06-24 18:40:37.140178",
|
||||||
"modified": "2018-06-01 17:03:38.020993",
|
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Staffing Plan Detail",
|
"name": "Staffing Plan Detail",
|
||||||
"name_case": "",
|
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [],
|
"permissions": [],
|
||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
"read_only": 0,
|
|
||||||
"read_only_onload": 0,
|
|
||||||
"show_name_in_global_search": 0,
|
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"track_changes": 1,
|
"track_changes": 1
|
||||||
"track_seen": 0
|
|
||||||
}
|
}
|
@ -578,6 +578,8 @@ class BOM(WebsiteGenerator):
|
|||||||
for d in self.operations:
|
for d in self.operations:
|
||||||
if not d.description:
|
if not d.description:
|
||||||
d.description = frappe.db.get_value('Operation', d.operation, 'description')
|
d.description = frappe.db.get_value('Operation', d.operation, 'description')
|
||||||
|
if not d.batch_size > 0:
|
||||||
|
d.batch_size = 1
|
||||||
|
|
||||||
def get_list_context(context):
|
def get_list_context(context):
|
||||||
context.title = _("Bill of Materials")
|
context.title = _("Bill of Materials")
|
||||||
|
@ -1,361 +1,119 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
|
||||||
"allow_guest_to_view": 0,
|
|
||||||
"allow_import": 0,
|
|
||||||
"allow_rename": 0,
|
|
||||||
"beta": 0,
|
|
||||||
"creation": "2013-02-22 01:27:49",
|
"creation": "2013-02-22 01:27:49",
|
||||||
"custom": 0,
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "Setup",
|
"document_type": "Setup",
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
|
"field_order": [
|
||||||
|
"operation",
|
||||||
|
"workstation",
|
||||||
|
"description",
|
||||||
|
"col_break1",
|
||||||
|
"hour_rate",
|
||||||
|
"time_in_mins",
|
||||||
|
"batch_size",
|
||||||
|
"operating_cost",
|
||||||
|
"base_hour_rate",
|
||||||
|
"base_operating_cost",
|
||||||
|
"image"
|
||||||
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "operation",
|
"fieldname": "operation",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Operation",
|
"label": "Operation",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "operation_no",
|
"oldfieldname": "operation_no",
|
||||||
"oldfieldtype": "Data",
|
"oldfieldtype": "Data",
|
||||||
"options": "Operation",
|
"options": "Operation",
|
||||||
"permlevel": 0,
|
"reqd": 1
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 1,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "workstation",
|
"fieldname": "workstation",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Workstation",
|
"label": "Workstation",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "workstation",
|
"oldfieldname": "workstation",
|
||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
"options": "Workstation",
|
"options": "Workstation"
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "description",
|
"fieldname": "description",
|
||||||
"fieldtype": "Text Editor",
|
"fieldtype": "Text Editor",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Description",
|
"label": "Description",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "opn_description",
|
"oldfieldname": "opn_description",
|
||||||
"oldfieldtype": "Text",
|
"oldfieldtype": "Text"
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "col_break1",
|
"fieldname": "col_break1",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break"
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "hour_rate",
|
"fieldname": "hour_rate",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Hour Rate",
|
"label": "Hour Rate",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "hour_rate",
|
"oldfieldname": "hour_rate",
|
||||||
"oldfieldtype": "Currency",
|
"oldfieldtype": "Currency",
|
||||||
"options": "currency",
|
"options": "currency"
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"description": "In minutes",
|
"description": "In minutes",
|
||||||
"fieldname": "time_in_mins",
|
"fieldname": "time_in_mins",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Operation Time ",
|
"label": "Operation Time ",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "time_in_mins",
|
"oldfieldname": "time_in_mins",
|
||||||
"oldfieldtype": "Currency",
|
"oldfieldtype": "Currency",
|
||||||
"options": "",
|
"reqd": 1
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 1,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "operating_cost",
|
"fieldname": "operating_cost",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Operating Cost",
|
"label": "Operating Cost",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "operating_cost",
|
"oldfieldname": "operating_cost",
|
||||||
"oldfieldtype": "Currency",
|
"oldfieldtype": "Currency",
|
||||||
"options": "currency",
|
"options": "currency",
|
||||||
"permlevel": 0,
|
"read_only": 1
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "base_hour_rate",
|
"fieldname": "base_hour_rate",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Base Hour Rate(Company Currency)",
|
"label": "Base Hour Rate(Company Currency)",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"print_hide_if_no_value": 0,
|
"read_only": 1
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"default": "5",
|
"default": "5",
|
||||||
"fieldname": "base_operating_cost",
|
"fieldname": "base_operating_cost",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Operating Cost(Company Currency)",
|
"label": "Operating Cost(Company Currency)",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"print_hide_if_no_value": 0,
|
"read_only": 1
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "image",
|
"fieldname": "image",
|
||||||
"fieldtype": "Attach",
|
"fieldtype": "Attach",
|
||||||
"hidden": 0,
|
"label": "Image"
|
||||||
"ignore_user_permissions": 0,
|
},
|
||||||
"ignore_xss_filter": 0,
|
{
|
||||||
"in_filter": 0,
|
"default": "1",
|
||||||
"in_global_search": 0,
|
"fieldname": "batch_size",
|
||||||
"in_list_view": 0,
|
"fieldtype": "Int",
|
||||||
"in_standard_filter": 0,
|
"label": "Batch Size"
|
||||||
"label": "Image",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"has_web_view": 0,
|
|
||||||
"hide_heading": 0,
|
|
||||||
"hide_toolbar": 0,
|
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"image_view": 0,
|
|
||||||
"in_create": 0,
|
|
||||||
"is_submittable": 0,
|
|
||||||
"issingle": 0,
|
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"modified": "2019-07-16 22:35:55.374037",
|
||||||
"modified": "2018-03-26 09:55:28.107451",
|
"modified_by": "govindsmenokee@gmail.com",
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Manufacturing",
|
"module": "Manufacturing",
|
||||||
"name": "BOM Operation",
|
"name": "BOM Operation",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [],
|
"permissions": [],
|
||||||
"quick_entry": 0,
|
"sort_field": "modified",
|
||||||
"read_only": 0,
|
"sort_order": "DESC"
|
||||||
"read_only_onload": 0,
|
|
||||||
"show_name_in_global_search": 0,
|
|
||||||
"track_changes": 0,
|
|
||||||
"track_seen": 0
|
|
||||||
}
|
}
|
@ -4,6 +4,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
import json
|
import json
|
||||||
|
import math
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.utils import flt, get_datetime, getdate, date_diff, cint, nowdate
|
from frappe.utils import flt, get_datetime, getdate, date_diff, cint, nowdate
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
@ -323,7 +324,7 @@ class WorkOrder(Document):
|
|||||||
select
|
select
|
||||||
operation, description, workstation, idx,
|
operation, description, workstation, idx,
|
||||||
base_hour_rate as hour_rate, time_in_mins,
|
base_hour_rate as hour_rate, time_in_mins,
|
||||||
"Pending" as status, parent as bom
|
"Pending" as status, parent as bom, batch_size
|
||||||
from
|
from
|
||||||
`tabBOM Operation`
|
`tabBOM Operation`
|
||||||
where
|
where
|
||||||
@ -348,7 +349,7 @@ class WorkOrder(Document):
|
|||||||
bom_qty = frappe.db.get_value("BOM", self.bom_no, "quantity")
|
bom_qty = frappe.db.get_value("BOM", self.bom_no, "quantity")
|
||||||
|
|
||||||
for d in self.get("operations"):
|
for d in self.get("operations"):
|
||||||
d.time_in_mins = flt(d.time_in_mins) / flt(bom_qty) * flt(self.qty)
|
d.time_in_mins = flt(d.time_in_mins) / flt(bom_qty) * math.ceil(flt(self.qty) / flt(d.batch_size))
|
||||||
|
|
||||||
self.calculate_operating_cost()
|
self.calculate_operating_cost()
|
||||||
|
|
||||||
|
@ -1,690 +1,200 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
|
||||||
"allow_guest_to_view": 0,
|
|
||||||
"allow_import": 0,
|
|
||||||
"allow_rename": 0,
|
|
||||||
"beta": 0,
|
|
||||||
"creation": "2014-10-16 14:35:41.950175",
|
"creation": "2014-10-16 14:35:41.950175",
|
||||||
"custom": 0,
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "",
|
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
|
"field_order": [
|
||||||
|
"details",
|
||||||
|
"operation",
|
||||||
|
"bom",
|
||||||
|
"description",
|
||||||
|
"col_break1",
|
||||||
|
"completed_qty",
|
||||||
|
"status",
|
||||||
|
"workstation",
|
||||||
|
"estimated_time_and_cost",
|
||||||
|
"planned_start_time",
|
||||||
|
"planned_end_time",
|
||||||
|
"column_break_10",
|
||||||
|
"time_in_mins",
|
||||||
|
"hour_rate",
|
||||||
|
"batch_size",
|
||||||
|
"planned_operating_cost",
|
||||||
|
"section_break_9",
|
||||||
|
"actual_start_time",
|
||||||
|
"actual_end_time",
|
||||||
|
"column_break_11",
|
||||||
|
"actual_operation_time",
|
||||||
|
"actual_operating_cost"
|
||||||
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "details",
|
"fieldname": "details",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break"
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "operation",
|
"fieldname": "operation",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Operation",
|
"label": "Operation",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "operation_no",
|
"oldfieldname": "operation_no",
|
||||||
"oldfieldtype": "Data",
|
"oldfieldtype": "Data",
|
||||||
"options": "Operation",
|
"options": "Operation",
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"remember_last_selected_value": 0,
|
"reqd": 1
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 1,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "bom",
|
"fieldname": "bom",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "BOM",
|
"label": "BOM",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"options": "BOM",
|
"options": "BOM",
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"print_hide_if_no_value": 0,
|
"read_only": 1
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "description",
|
"fieldname": "description",
|
||||||
"fieldtype": "Text Editor",
|
"fieldtype": "Text Editor",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Operation Description",
|
"label": "Operation Description",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "opn_description",
|
"oldfieldname": "opn_description",
|
||||||
"oldfieldtype": "Text",
|
"oldfieldtype": "Text",
|
||||||
"permlevel": 0,
|
"read_only": 1
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "col_break1",
|
"fieldname": "col_break1",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break"
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"description": "Operation completed for how many finished goods?",
|
"description": "Operation completed for how many finished goods?",
|
||||||
"fieldname": "completed_qty",
|
"fieldname": "completed_qty",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Completed Qty",
|
"label": "Completed Qty",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"permlevel": 0,
|
"read_only": 1
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"default": "Pending",
|
"default": "Pending",
|
||||||
"fieldname": "status",
|
"fieldname": "status",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Status",
|
"label": "Status",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"options": "Pending\nWork in Progress\nCompleted",
|
"options": "Pending\nWork in Progress\nCompleted",
|
||||||
"permlevel": 0,
|
"read_only": 1
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "workstation",
|
"fieldname": "workstation",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Workstation",
|
"label": "Workstation",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "workstation",
|
"oldfieldname": "workstation",
|
||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
"options": "Workstation",
|
"options": "Workstation"
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "estimated_time_and_cost",
|
"fieldname": "estimated_time_and_cost",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"label": "Estimated Time and Cost"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Estimated Time and Cost",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "planned_start_time",
|
"fieldname": "planned_start_time",
|
||||||
"fieldtype": "Datetime",
|
"fieldtype": "Datetime",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Planned Start Time",
|
"label": "Planned Start Time",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"permlevel": 0,
|
"read_only": 1
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "planned_end_time",
|
"fieldname": "planned_end_time",
|
||||||
"fieldtype": "Datetime",
|
"fieldtype": "Datetime",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Planned End Time",
|
"label": "Planned End Time",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"permlevel": 0,
|
"read_only": 1
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "column_break_10",
|
"fieldname": "column_break_10",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break"
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"description": "in Minutes",
|
"description": "in Minutes",
|
||||||
"fieldname": "time_in_mins",
|
"fieldname": "time_in_mins",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Operation Time",
|
"label": "Operation Time",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "time_in_mins",
|
"oldfieldname": "time_in_mins",
|
||||||
"oldfieldtype": "Currency",
|
"oldfieldtype": "Currency",
|
||||||
"permlevel": 0,
|
"reqd": 1
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 1,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "hour_rate",
|
"fieldname": "hour_rate",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Hour Rate",
|
"label": "Hour Rate",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "hour_rate",
|
"oldfieldname": "hour_rate",
|
||||||
"oldfieldtype": "Currency",
|
"oldfieldtype": "Currency",
|
||||||
"permlevel": 0,
|
"read_only": 1
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "planned_operating_cost",
|
"fieldname": "planned_operating_cost",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Planned Operating Cost",
|
"label": "Planned Operating Cost",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"permlevel": 0,
|
"read_only": 1
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "section_break_9",
|
"fieldname": "section_break_9",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"label": "Actual Time and Cost"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Actual Time and Cost",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "actual_start_time",
|
"fieldname": "actual_start_time",
|
||||||
"fieldtype": "Datetime",
|
"fieldtype": "Datetime",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Actual Start Time",
|
"label": "Actual Start Time",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"permlevel": 0,
|
"read_only": 1
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"description": "Updated via 'Time Log'",
|
"description": "Updated via 'Time Log'",
|
||||||
"fieldname": "actual_end_time",
|
"fieldname": "actual_end_time",
|
||||||
"fieldtype": "Datetime",
|
"fieldtype": "Datetime",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Actual End Time",
|
"label": "Actual End Time",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"permlevel": 0,
|
"read_only": 1
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "column_break_11",
|
"fieldname": "column_break_11",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break"
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"description": "in Minutes\nUpdated via 'Time Log'",
|
"description": "in Minutes\nUpdated via 'Time Log'",
|
||||||
"fieldname": "actual_operation_time",
|
"fieldname": "actual_operation_time",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Actual Operation Time",
|
"label": "Actual Operation Time",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"permlevel": 0,
|
"read_only": 1
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"description": "(Hour Rate / 60) * Actual Operation Time",
|
"description": "(Hour Rate / 60) * Actual Operation Time",
|
||||||
"fieldname": "actual_operating_cost",
|
"fieldname": "actual_operating_cost",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Actual Operating Cost",
|
"label": "Actual Operating Cost",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"permlevel": 0,
|
"read_only": 1
|
||||||
"precision": "",
|
},
|
||||||
"print_hide": 0,
|
{
|
||||||
"print_hide_if_no_value": 0,
|
"fieldname": "batch_size",
|
||||||
"read_only": 1,
|
"fieldtype": "Int",
|
||||||
"remember_last_selected_value": 0,
|
"label": "Batch Size",
|
||||||
"report_hide": 0,
|
"read_only": 1
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"has_web_view": 0,
|
|
||||||
"hide_heading": 0,
|
|
||||||
"hide_toolbar": 0,
|
|
||||||
"idx": 0,
|
|
||||||
"image_view": 0,
|
|
||||||
"in_create": 0,
|
|
||||||
"is_submittable": 0,
|
|
||||||
"issingle": 0,
|
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"modified": "2019-07-16 23:01:07.720337",
|
||||||
"modified": "2018-02-13 02:58:11.328693",
|
"modified_by": "govindsmenokee@gmail.com",
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Manufacturing",
|
"module": "Manufacturing",
|
||||||
"name": "Work Order Operation",
|
"name": "Work Order Operation",
|
||||||
"name_case": "",
|
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [],
|
"permissions": [],
|
||||||
"quick_entry": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"read_only_onload": 0,
|
|
||||||
"show_name_in_global_search": 0,
|
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"track_changes": 1,
|
"track_changes": 1
|
||||||
"track_seen": 0
|
|
||||||
}
|
}
|
@ -618,8 +618,10 @@ erpnext.patches.v11_1.set_missing_opportunity_from
|
|||||||
erpnext.patches.v12_0.set_quotation_status
|
erpnext.patches.v12_0.set_quotation_status
|
||||||
erpnext.patches.v12_0.set_priority_for_support
|
erpnext.patches.v12_0.set_priority_for_support
|
||||||
erpnext.patches.v12_0.delete_priority_property_setter
|
erpnext.patches.v12_0.delete_priority_property_setter
|
||||||
|
erpnext.patches.v12_0.set_default_batch_size
|
||||||
execute:frappe.delete_doc("DocType", "Project Task")
|
execute:frappe.delete_doc("DocType", "Project Task")
|
||||||
erpnext.patches.v11_1.update_default_supplier_in_item_defaults
|
erpnext.patches.v11_1.update_default_supplier_in_item_defaults
|
||||||
erpnext.patches.v12_0.update_due_date_in_gle
|
erpnext.patches.v12_0.update_due_date_in_gle
|
||||||
erpnext.patches.v12_0.add_default_buying_selling_terms_in_company
|
erpnext.patches.v12_0.add_default_buying_selling_terms_in_company
|
||||||
erpnext.patches.v12_0.update_ewaybill_field_position
|
erpnext.patches.v12_0.update_ewaybill_field_position
|
||||||
|
erpnext.patches.v11_1.set_status_for_material_request_type_manufacture
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
frappe.db.sql("""
|
||||||
|
update `tabMaterial Request`
|
||||||
|
set status='Manufactured'
|
||||||
|
where docstatus=1 and material_request_type='Manufacture' and per_ordered=100 and status != 'Stopped'
|
||||||
|
""")
|
19
erpnext/patches/v12_0/set_default_batch_size.py
Normal file
19
erpnext/patches/v12_0/set_default_batch_size.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import frappe
|
||||||
|
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
frappe.reload_doc("manufacturing", "doctype", "bom_operation")
|
||||||
|
frappe.reload_doc("manufacturing", "doctype", "work_order_operation")
|
||||||
|
|
||||||
|
frappe.db.sql("""
|
||||||
|
UPDATE
|
||||||
|
`tabBOM Operation` bo
|
||||||
|
SET
|
||||||
|
bo.batch_size = 1
|
||||||
|
""")
|
||||||
|
frappe.db.sql("""
|
||||||
|
UPDATE
|
||||||
|
`tabWork Order Operation` wop
|
||||||
|
SET
|
||||||
|
wop.batch_size = 1
|
||||||
|
""")
|
@ -1,6 +1,23 @@
|
|||||||
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||||
// License: GNU General Public License v3. See license.txt
|
// License: GNU General Public License v3. See license.txt
|
||||||
frappe.ui.form.on("Project", {
|
frappe.ui.form.on("Project", {
|
||||||
|
setup(frm) {
|
||||||
|
frm.make_methods = {
|
||||||
|
'Timesheet': () => {
|
||||||
|
let doctype = 'Timesheet';
|
||||||
|
frappe.model.with_doctype(doctype, () => {
|
||||||
|
let new_doc = frappe.model.get_new_doc(doctype);
|
||||||
|
|
||||||
|
// add a new row and set the project
|
||||||
|
let time_log = frappe.model.get_new_doc('Timesheet Detail');
|
||||||
|
time_log.project = frm.doc.name;
|
||||||
|
new_doc.time_logs = [time_log];
|
||||||
|
|
||||||
|
frappe.ui.form.make_quick_entry(doctype, null, null, new_doc);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
onload: function (frm) {
|
onload: function (frm) {
|
||||||
var so = frappe.meta.get_docfield("Project", "sales_order");
|
var so = frappe.meta.get_docfield("Project", "sales_order");
|
||||||
so.get_route_options_for_new_doc = function (field) {
|
so.get_route_options_for_new_doc = function (field) {
|
||||||
|
@ -197,6 +197,9 @@ class Item(WebsiteGenerator):
|
|||||||
'route')) + '/' + self.scrub((self.item_name if self.item_name else self.item_code) + '-' + random_string(5))
|
'route')) + '/' + self.scrub((self.item_name if self.item_name else self.item_code) + '-' + random_string(5))
|
||||||
|
|
||||||
def validate_website_image(self):
|
def validate_website_image(self):
|
||||||
|
if frappe.flags.in_import:
|
||||||
|
return
|
||||||
|
|
||||||
"""Validate if the website image is a public file"""
|
"""Validate if the website image is a public file"""
|
||||||
auto_set_website_image = False
|
auto_set_website_image = False
|
||||||
if not self.website_image and self.image:
|
if not self.website_image and self.image:
|
||||||
@ -216,8 +219,7 @@ class Item(WebsiteGenerator):
|
|||||||
|
|
||||||
if not file_doc:
|
if not file_doc:
|
||||||
if not auto_set_website_image:
|
if not auto_set_website_image:
|
||||||
frappe.msgprint(_("Website Image {0} attached to Item {1} cannot be found")
|
frappe.msgprint(_("Website Image {0} attached to Item {1} cannot be found").format(self.website_image, self.name))
|
||||||
.format(self.website_image, self.name))
|
|
||||||
|
|
||||||
self.website_image = None
|
self.website_image = None
|
||||||
|
|
||||||
@ -228,6 +230,9 @@ class Item(WebsiteGenerator):
|
|||||||
self.website_image = None
|
self.website_image = None
|
||||||
|
|
||||||
def make_thumbnail(self):
|
def make_thumbnail(self):
|
||||||
|
if frappe.flags.in_import:
|
||||||
|
return
|
||||||
|
|
||||||
"""Make a thumbnail of `website_image`"""
|
"""Make a thumbnail of `website_image`"""
|
||||||
import requests.exceptions
|
import requests.exceptions
|
||||||
|
|
||||||
|
@ -20,6 +20,8 @@ frappe.listview_settings['Material Request'] = {
|
|||||||
return [__("Issued"), "green", "per_ordered,=,100"];
|
return [__("Issued"), "green", "per_ordered,=,100"];
|
||||||
} else if (doc.material_request_type == "Customer Provided") {
|
} else if (doc.material_request_type == "Customer Provided") {
|
||||||
return [__("Received"), "green", "per_ordered,=,100"];
|
return [__("Received"), "green", "per_ordered,=,100"];
|
||||||
|
} else if (doc.material_request_type == "Manufacture") {
|
||||||
|
return [__("Manufactured"), "green", "per_ordered,=,100"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -264,8 +264,12 @@ frappe.ui.form.on('Purchase Receipt Item', {
|
|||||||
var d = locals[cdt][cdn];
|
var d = locals[cdt][cdn];
|
||||||
frappe.db.get_value('Item', {name: d.item_code}, 'sample_quantity', (r) => {
|
frappe.db.get_value('Item', {name: d.item_code}, 'sample_quantity', (r) => {
|
||||||
frappe.model.set_value(cdt, cdn, "sample_quantity", r.sample_quantity);
|
frappe.model.set_value(cdt, cdn, "sample_quantity", r.sample_quantity);
|
||||||
|
validate_sample_quantity(frm, cdt, cdn);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
qty: function(frm, cdt, cdn) {
|
||||||
|
validate_sample_quantity(frm, cdt, cdn);
|
||||||
|
},
|
||||||
sample_quantity: function(frm, cdt, cdn) {
|
sample_quantity: function(frm, cdt, cdn) {
|
||||||
validate_sample_quantity(frm, cdt, cdn);
|
validate_sample_quantity(frm, cdt, cdn);
|
||||||
},
|
},
|
||||||
@ -283,7 +287,7 @@ cur_frm.cscript['Make Stock Entry'] = function() {
|
|||||||
|
|
||||||
var validate_sample_quantity = function(frm, cdt, cdn) {
|
var validate_sample_quantity = function(frm, cdt, cdn) {
|
||||||
var d = locals[cdt][cdn];
|
var d = locals[cdt][cdn];
|
||||||
if (d.sample_quantity) {
|
if (d.sample_quantity && d.qty) {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: 'erpnext.stock.doctype.stock_entry.stock_entry.validate_sample_quantity',
|
method: 'erpnext.stock.doctype.stock_entry.stock_entry.validate_sample_quantity',
|
||||||
args: {
|
args: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user