Merge pull request #17920 from Anurag810/stock_balance_report
fix: fetch item on the base of item group
diff --git a/erpnext/accounts/doctype/bank/bank_dashboard.py b/erpnext/accounts/doctype/bank/bank_dashboard.py
new file mode 100644
index 0000000..4324041
--- /dev/null
+++ b/erpnext/accounts/doctype/bank/bank_dashboard.py
@@ -0,0 +1,18 @@
+from __future__ import unicode_literals
+
+from frappe import _
+
+
+def get_data():
+ return {
+ 'fieldname': 'bank',
+ 'transactions': [
+ {
+ 'label': _('Bank Deatils'),
+ 'items': ['Bank Account', 'Bank Guarantee']
+ },
+ {
+ 'items': ['Payment Order']
+ }
+ ]
+ }
diff --git a/erpnext/accounts/doctype/bank_account/bank_account_dashboard.py b/erpnext/accounts/doctype/bank_account/bank_account_dashboard.py
new file mode 100644
index 0000000..3d149eb
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_account/bank_account_dashboard.py
@@ -0,0 +1,30 @@
+from __future__ import unicode_literals
+
+from frappe import _
+
+
+def get_data():
+ return {
+ 'fieldname': 'bank_account',
+ 'non_standard_fieldnames': {
+ 'Customer': 'default_bank_account',
+ 'Supplier': 'default_bank_account',
+ 'Journal Entry': 'bank_account_no'
+ },
+ 'transactions': [
+ {
+ 'label': _('Payments'),
+ 'items': ['Payment Entry', 'Payment Request', 'Payment Order']
+ },
+ {
+ 'label': _('Party'),
+ 'items': ['Customer', 'Supplier']
+ },
+ {
+ 'items': ['Bank Guarantee']
+ },
+ {
+ 'items': ['Journal Entry']
+ }
+ ]
+ }
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/cost_center/cost_center_dashboard.py b/erpnext/accounts/doctype/cost_center/cost_center_dashboard.py
new file mode 100644
index 0000000..788ac8b
--- /dev/null
+++ b/erpnext/accounts/doctype/cost_center/cost_center_dashboard.py
@@ -0,0 +1,15 @@
+from __future__ import unicode_literals
+
+from frappe import _
+
+
+def get_data():
+ return {
+ 'fieldname': 'cost_center',
+ 'reports': [
+ {
+ 'label': _('Reports'),
+ 'items': ['Budget Variance Report', 'General Ledger']
+ }
+ ]
+ }
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/finance_book/finance_book_dashboard.py b/erpnext/accounts/doctype/finance_book/finance_book_dashboard.py
new file mode 100644
index 0000000..c2ebea6
--- /dev/null
+++ b/erpnext/accounts/doctype/finance_book/finance_book_dashboard.py
@@ -0,0 +1,25 @@
+from __future__ import unicode_literals
+
+from frappe import _
+
+
+def get_data():
+ return {
+ 'fieldname': 'finance_book',
+ 'non_standard_fieldnames': {
+ 'Asset': 'default_finance_book',
+ 'Company': 'default_finance_book'
+ },
+ 'transactions': [
+ {
+ 'label': _('Assets'),
+ 'items': ['Asset', 'Asset Value Adjustment']
+ },
+ {
+ 'items': ['Company']
+ },
+ {
+ 'items': ['Journal Entry']
+ }
+ ]
+ }
diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year_dashboard.py b/erpnext/accounts/doctype/fiscal_year/fiscal_year_dashboard.py
new file mode 100644
index 0000000..c7604ec
--- /dev/null
+++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year_dashboard.py
@@ -0,0 +1,23 @@
+from __future__ import unicode_literals
+
+from frappe import _
+
+
+def get_data():
+ return {
+ 'fieldname': 'fiscal_year',
+ 'transactions': [
+ {
+ 'label': _('Budgets'),
+ 'items': ['Budget']
+ },
+ {
+ 'label': _('References'),
+ 'items': ['Period Closing Voucher', 'Request for Quotation', 'Tax Withholding Category']
+ },
+ {
+ 'label': _('Target Details'),
+ 'items': ['Sales Person', 'Sales Partner', 'Territory', 'Monthly Distribution']
+ }
+ ]
+ }
diff --git a/erpnext/accounts/doctype/item_tax_template/item_tax_template_dashboard.py b/erpnext/accounts/doctype/item_tax_template/item_tax_template_dashboard.py
new file mode 100644
index 0000000..acc308e
--- /dev/null
+++ b/erpnext/accounts/doctype/item_tax_template/item_tax_template_dashboard.py
@@ -0,0 +1,26 @@
+from __future__ import unicode_literals
+
+from frappe import _
+
+
+def get_data():
+ return {
+ 'fieldname': 'item_tax_template',
+ 'transactions': [
+ {
+ 'label': _('Pre Sales'),
+ 'items': ['Quotation', 'Supplier Quotation']
+ },
+ {
+ 'label': _('Sales'),
+ 'items': ['Sales Invoice', 'Sales Order', 'Delivery Note']
+ },
+ {
+ 'label': _('Purchase'),
+ 'items': ['Purchase Invoice', 'Purchase Order', 'Purchase Receipt']
+ },
+ {
+ 'items': ['Item']
+ }
+ ]
+ }
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js
index 9be30aa..b7f383f 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.js
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js
@@ -25,13 +25,13 @@
"group_by_voucher": 0
};
frappe.set_route("query-report", "General Ledger");
- }, "fa fa-table");
+ }, __('View'));
}
if(frm.doc.docstatus==1) {
frm.add_custom_button(__('Reverse Journal Entry'), function() {
return erpnext.journal_entry.reverse_journal_entry(frm);
- });
+ }, __('Make'));
}
if (frm.doc.__islocal) {
@@ -47,8 +47,7 @@
frm.add_custom_button(__("Create Inter Company Journal Entry"),
function() {
frm.trigger("make_inter_company_journal_entry");
- }
- );
+ }, __('Make'));
}
},
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index 26fbc23..d082b60 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -458,8 +458,9 @@
pay_to_recd_from = frappe.db.get_value(d.party_type, d.party,
"customer_name" if d.party_type=="Customer" else "supplier_name")
- party_amount += (d.debit_in_account_currency or d.credit_in_account_currency)
- party_account_currency = d.account_currency
+ if pay_to_recd_from and pay_to_recd_from == d.party:
+ party_amount += (d.debit_in_account_currency or d.credit_in_account_currency)
+ party_account_currency = d.account_currency
elif frappe.db.get_value("Account", d.account, "account_type") in ["Bank", "Cash"]:
bank_amount += (d.debit_in_account_currency or d.credit_in_account_currency)
diff --git a/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py b/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py
new file mode 100644
index 0000000..189004f
--- /dev/null
+++ b/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py
@@ -0,0 +1,14 @@
+from __future__ import unicode_literals
+
+from frappe import _
+
+
+def get_data():
+ return {
+ 'fieldname': 'loyalty_program',
+ 'transactions': [
+ {
+ 'items': ['Sales Invoice', 'Customer']
+ }
+ ]
+ }
diff --git a/erpnext/accounts/doctype/monthly_distribution/monthly_distribution_dashboard.py b/erpnext/accounts/doctype/monthly_distribution/monthly_distribution_dashboard.py
new file mode 100644
index 0000000..a679499
--- /dev/null
+++ b/erpnext/accounts/doctype/monthly_distribution/monthly_distribution_dashboard.py
@@ -0,0 +1,23 @@
+from __future__ import unicode_literals
+
+from frappe import _
+
+
+def get_data():
+ return {
+ 'fieldname': 'monthly_distribution',
+ 'non_standard_fieldnames': {
+ 'Sales Person': 'distribution_id',
+ 'Territory': 'distribution_id',
+ 'Sales Partner': 'distribution_id',
+ },
+ 'transactions': [
+ {
+ 'label': _('Target Details'),
+ 'items': ['Sales Person', 'Territory', 'Sales Partner']
+ },
+ {
+ 'items': ['Budget']
+ }
+ ]
+ }
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py b/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py
new file mode 100644
index 0000000..0898229
--- /dev/null
+++ b/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py
@@ -0,0 +1,20 @@
+from __future__ import unicode_literals
+
+from frappe import _
+
+
+def get_data():
+ return {
+ 'fieldname': 'payment_gateway_account',
+ 'non_standard_fieldnames': {
+ 'Subscription Plan': 'payment_gateway'
+ },
+ 'transactions': [
+ {
+ 'items': ['Payment Request']
+ },
+ {
+ 'items': ['Subscription Plan']
+ }
+ ]
+ }
diff --git a/erpnext/accounts/doctype/payment_term/payment_term_dashboard.py b/erpnext/accounts/doctype/payment_term/payment_term_dashboard.py
new file mode 100644
index 0000000..d146fcd
--- /dev/null
+++ b/erpnext/accounts/doctype/payment_term/payment_term_dashboard.py
@@ -0,0 +1,22 @@
+from __future__ import unicode_literals
+
+from frappe import _
+
+
+def get_data():
+ return {
+ 'fieldname': 'payment_term',
+ 'transactions': [
+ {
+ 'label': _('Sales'),
+ 'items': ['Sales Invoice', 'Sales Order', 'Quotation']
+ },
+ {
+ 'label': _('Purchase'),
+ 'items': ['Purchase Invoice', 'Purchase Order']
+ },
+ {
+ 'items': ['Payment Terms Template']
+ }
+ ]
+ }
diff --git a/erpnext/accounts/doctype/payment_terms_template/payment_terms_template_dashboard.py b/erpnext/accounts/doctype/payment_terms_template/payment_terms_template_dashboard.py
new file mode 100644
index 0000000..c705097
--- /dev/null
+++ b/erpnext/accounts/doctype/payment_terms_template/payment_terms_template_dashboard.py
@@ -0,0 +1,33 @@
+from __future__ import unicode_literals
+
+from frappe import _
+
+
+def get_data():
+ return {
+ 'fieldname': 'payment_terms_template',
+ 'non_standard_fieldnames': {
+ 'Customer Group': 'payment_terms',
+ 'Supplier Group': 'payment_terms',
+ 'Supplier': 'payment_terms',
+ 'Customer': 'payment_terms'
+ },
+ 'transactions': [
+ {
+ 'label': _('Sales'),
+ 'items': ['Sales Invoice', 'Sales Order', 'Quotation']
+ },
+ {
+ 'label': _('Purchase'),
+ 'items': ['Purchase Invoice', 'Purchase Order']
+ },
+ {
+ 'label': _('Party'),
+ 'items': ['Customer', 'Supplier']
+ },
+ {
+ 'label': _('Group'),
+ 'items': ['Customer Group', 'Supplier Group']
+ }
+ ]
+ }
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile_dashboard.py b/erpnext/accounts/doctype/pos_profile/pos_profile_dashboard.py
new file mode 100644
index 0000000..e28bf73
--- /dev/null
+++ b/erpnext/accounts/doctype/pos_profile/pos_profile_dashboard.py
@@ -0,0 +1,14 @@
+from __future__ import unicode_literals
+
+from frappe import _
+
+
+def get_data():
+ return {
+ 'fieldname': 'pos_profile',
+ 'transactions': [
+ {
+ 'items': ['Sales Invoice', 'POS Closing Voucher']
+ }
+ ]
+ }
diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
index 1d75bb5..0923a5b 100644
--- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
+++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
@@ -4,6 +4,7 @@
"doctype": "DocType",
"document_type": "Document",
"editable_grid": 1,
+ "engine": "InnoDB",
"field_order": [
"item_code",
"col_break1",
@@ -15,6 +16,10 @@
"image_section",
"image",
"image_view",
+ "manufacture_details",
+ "manufacturer",
+ "column_break_13",
+ "manufacturer_part_no",
"quantity_and_rate",
"received_qty",
"qty",
@@ -728,11 +733,32 @@
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "manufacture_details",
+ "fieldtype": "Section Break",
+ "label": "Manufacture"
+ },
+ {
+ "fieldname": "manufacturer",
+ "fieldtype": "Link",
+ "label": "Manufacturer",
+ "options": "Manufacturer"
+ },
+ {
+ "fieldname": "column_break_13",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "manufacturer_part_no",
+ "fieldtype": "Data",
+ "label": "Manufacturer Part Number",
+ "read_only": 1
}
],
"idx": 1,
"istable": 1,
- "modified": "2019-05-25 22:04:48.435730",
+ "modified": "2019-06-02 06:36:17.078419",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",
diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template_dashboard.py b/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template_dashboard.py
new file mode 100644
index 0000000..11c220b
--- /dev/null
+++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template_dashboard.py
@@ -0,0 +1,22 @@
+from __future__ import unicode_literals
+
+from frappe import _
+
+
+def get_data():
+ return {
+ 'fieldname': 'taxes_and_charges',
+ 'non_standard_fieldnames': {
+ 'Tax Rule': 'purchase_tax_template',
+ },
+ 'transactions': [
+ {
+ 'label': _('Transactions'),
+ 'items': ['Purchase Invoice', 'Purchase Order', 'Purchase Receipt']
+ },
+ {
+ 'label': _('References'),
+ 'items': ['Supplier Quotation', 'Tax Rule']
+ }
+ ]
+ }
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template_dashboard.py b/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template_dashboard.py
new file mode 100644
index 0000000..0e9c808
--- /dev/null
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template_dashboard.py
@@ -0,0 +1,24 @@
+from __future__ import unicode_literals
+
+from frappe import _
+
+
+def get_data():
+ return {
+ 'fieldname': 'taxes_and_charges',
+ 'non_standard_fieldnames': {
+ 'Tax Rule': 'sales_tax_template',
+ 'Subscription': 'tax_template',
+ 'Restaurant': 'default_tax_template'
+ },
+ 'transactions': [
+ {
+ 'label': _('Transactions'),
+ 'items': ['Sales Invoice', 'Sales Order', 'Delivery Note']
+ },
+ {
+ 'label': _('References'),
+ 'items': ['POS Profile', 'Subscription', 'Restaurant', 'Tax Rule']
+ }
+ ]
+ }
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/share_type/share_type_dashboard.py b/erpnext/accounts/doctype/share_type/share_type_dashboard.py
new file mode 100644
index 0000000..455b022
--- /dev/null
+++ b/erpnext/accounts/doctype/share_type/share_type_dashboard.py
@@ -0,0 +1,15 @@
+from __future__ import unicode_literals
+
+from frappe import _
+
+
+def get_data():
+ return {
+ 'fieldname': 'share_type',
+ 'transactions': [
+ {
+ 'label': _('References'),
+ 'items': ['Share Transfer', 'Shareholder']
+ }
+ ]
+ }
diff --git a/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py b/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py
new file mode 100644
index 0000000..3b77fd5
--- /dev/null
+++ b/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py
@@ -0,0 +1,17 @@
+from __future__ import unicode_literals
+
+from frappe import _
+
+
+def get_data():
+ return {
+ 'fieldname': 'shareholder',
+ 'non_standard_fieldnames': {
+ 'Share Transfer': 'to_shareholder'
+ },
+ 'transactions': [
+ {
+ 'items': ['Share Transfer']
+ }
+ ]
+ }
diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule_dashboard.py b/erpnext/accounts/doctype/shipping_rule/shipping_rule_dashboard.py
new file mode 100644
index 0000000..636ee57
--- /dev/null
+++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule_dashboard.py
@@ -0,0 +1,26 @@
+from __future__ import unicode_literals
+
+from frappe import _
+
+
+def get_data():
+ return {
+ 'fieldname': 'shipping_rule',
+ 'non_standard_fieldnames': {
+ 'Payment Entry': 'party_name'
+ },
+ 'transactions': [
+ {
+ 'label': _('Pre Sales'),
+ 'items': ['Quotation', 'Supplier Quotation']
+ },
+ {
+ 'label': _('Sales'),
+ 'items': ['Sales Order', 'Delivery Note', 'Sales Invoice']
+ },
+ {
+ 'label': _('Purchase'),
+ 'items': ['Purchase Invoice', 'Purchase Order', 'Purchase Receipt']
+ }
+ ]
+ }
diff --git a/erpnext/accounts/doctype/subscription_plan/subscription_plan_dashboard.py b/erpnext/accounts/doctype/subscription_plan/subscription_plan_dashboard.py
new file mode 100644
index 0000000..df30233
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_plan/subscription_plan_dashboard.py
@@ -0,0 +1,19 @@
+from __future__ import unicode_literals
+
+from frappe import _
+
+
+def get_data():
+ return {
+ 'fieldname': 'subscription_plan',
+ 'non_standard_fieldnames': {
+ 'Payment Request': 'plan',
+ 'Subscription': 'plan'
+ },
+ 'transactions': [
+ {
+ 'label': _('References'),
+ 'items': ['Payment Request', 'Subscription']
+ }
+ ]
+ }
diff --git a/erpnext/accounts/doctype/tax_category/tax_category_dashboard.py b/erpnext/accounts/doctype/tax_category/tax_category_dashboard.py
new file mode 100644
index 0000000..d643efb
--- /dev/null
+++ b/erpnext/accounts/doctype/tax_category/tax_category_dashboard.py
@@ -0,0 +1,31 @@
+from __future__ import unicode_literals
+
+from frappe import _
+
+
+def get_data():
+ return {
+ 'fieldname': 'tax_category',
+ 'transactions': [
+ {
+ 'label': _('Pre Sales'),
+ 'items': ['Quotation', 'Supplier Quotation']
+ },
+ {
+ 'label': _('Sales'),
+ 'items': ['Sales Invoice', 'Delivery Note', 'Sales Order']
+ },
+ {
+ 'label': _('Purchase'),
+ 'items': ['Purchase Invoice', 'Purchase Receipt']
+ },
+ {
+ 'label': _('Party'),
+ 'items': ['Customer', 'Supplier']
+ },
+ {
+ 'label': _('Taxes'),
+ 'items': ['Item', 'Tax Rule']
+ }
+ ]
+ }
diff --git a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py
new file mode 100644
index 0000000..d51ba65
--- /dev/null
+++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py
@@ -0,0 +1,14 @@
+from __future__ import unicode_literals
+
+from frappe import _
+
+
+def get_data():
+ return {
+ 'fieldname': 'tax_withholding_category',
+ 'transactions': [
+ {
+ 'items': ['Supplier']
+ }
+ ]
+ }
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
index d7aa0c0..192b6d7 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
@@ -46,6 +46,8 @@
var range2 = report.columns[12].label;
var range3 = report.columns[13].label;
var range4 = report.columns[14].label;
+ var range5 = report.columns[15].label;
+ var range6 = report.columns[16].label;
%}
{% if(balance_row) { %}
<table class="table table-bordered table-condensed">
@@ -56,8 +58,10 @@
<col style="width: 18mm;">
<col style="width: 18mm;">
<col style="width: 18mm;">
- <col style="width: 18mm;">
- <col style="width: 18mm;">
+ <col style="width: 18mm;">
+ <col style="width: 18mm;">
+ <col style="width: 18mm;">
+ <col style="width: 18mm;">
</colgroup>
<thead>
@@ -67,16 +71,20 @@
<th>{%= __(range2) %}</th>
<th>{%= __(range3) %}</th>
<th>{%= __(range4) %}</th>
+ <th>{%= __(range5) %}</th>
+ <th>{%= __(range6) %}</th>
<th>{%= __("Total") %}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{%= __("Total Outstanding") %}</td>
- <td class="text-right">{%= format_currency(balance_row[range1]) %}</td>
+ <td class="text-right">{%= format_number(balance_row[range1], null, 2) %}</td>
<td class="text-right">{%= format_currency(balance_row[range2]) %}</td>
<td class="text-right">{%= format_currency(balance_row[range3]) %}</td>
<td class="text-right">{%= format_currency(balance_row[range4]) %}</td>
+ <td class="text-right">{%= format_currency(balance_row[range5]) %}</td>
+ <td class="text-right">{%= format_currency(balance_row[range6]) %}</td>
<td class="text-right">
{%= format_currency(flt(balance_row[("outstanding_amount")]), data[data.length-1]["currency"]) %}
</td>
@@ -86,6 +94,8 @@
<td></td>
<td></td>
<td></td>
+ <td></td>
+ <td></td>
<td class="text-right">
{%= format_currency(flt(balance_row[("pdc/lc_amount")]), data[data.length-1]["currency"]) %}
</td>
@@ -95,6 +105,8 @@
<th></th>
<th></th>
<th></th>
+ <th></th>
+ <th></th>
<th class="text-right">
{%= format_currency(flt(balance_row[("outstanding_amount")]-balance_row[("pdc/lc_amount")]), data[data.length-1]["currency"]) %}</th>
</tr>
diff --git a/erpnext/accounts/report/financial_statements.html b/erpnext/accounts/report/financial_statements.html
index cb853fd..4081723 100644
--- a/erpnext/accounts/report/financial_statements.html
+++ b/erpnext/accounts/report/financial_statements.html
@@ -23,6 +23,9 @@
{% } %}
<h2 class="text-center">{%= __(report.report_name) %}</h2>
<h3 class="text-center">{%= filters.company %}</h3>
+{% if 'cost_center' in filters %}
+ <h3 class="text-center">{%= filters.cost_center %}</h3>
+{% endif %}
<h3 class="text-center">{%= filters.fiscal_year %}</h3>
<h5 class="text-center">{%= __("Currency") %} : {%= filters.presentation_currency || erpnext.get_currency(filters.company) %} </h4>
{% if (filters.from_date) { %}
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py
index 492df4b..307b72d 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.py
+++ b/erpnext/accounts/report/general_ledger/general_ledger.py
@@ -128,7 +128,7 @@
order_by_statement = "order by posting_date, voucher_type, voucher_no"
if filters.get("group_by") == _("Group by Voucher (Consolidated)"):
- group_by_statement = "group by voucher_type, voucher_no, account, cost_center"
+ group_by_statement = "group by voucher_type, voucher_no, account, cost_center, against_voucher"
select_fields = """, sum(debit) as debit, sum(credit) as credit,
sum(debit_in_account_currency) as debit_in_account_currency,
sum(credit_in_account_currency) as credit_in_account_currency"""
diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json
index c0338fd..1b63f8f 100644
--- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json
+++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json
@@ -17,6 +17,10 @@
"col_break1",
"image",
"image_view",
+ "manufacture_details",
+ "manufacturer",
+ "column_break_14",
+ "manufacturer_part_no",
"quantity_and_rate",
"qty",
"stock_uom",
@@ -672,11 +676,32 @@
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "manufacture_details",
+ "fieldtype": "Section Break",
+ "label": "Manufacture"
+ },
+ {
+ "fieldname": "manufacturer",
+ "fieldtype": "Link",
+ "label": "Manufacturer",
+ "options": "Manufacturer"
+ },
+ {
+ "fieldname": "column_break_14",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "manufacturer_part_no",
+ "fieldtype": "Data",
+ "label": "Manufacturer Part Number",
+ "read_only": 1
}
],
"idx": 1,
"istable": 1,
- "modified": "2019-05-25 22:10:32.518941",
+ "modified": "2019-06-02 06:34:47.495730",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order Item",
diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json
index b37e0ba..7d7d6f4 100644
--- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json
+++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json
@@ -18,6 +18,10 @@
"col_break1",
"image",
"image_view",
+ "manufacture_details",
+ "manufacturer",
+ "column_break_15",
+ "manufacturer_part_no",
"quantity_and_rate",
"qty",
"stock_uom",
@@ -285,6 +289,7 @@
"read_only": 1
},
{
+ "default": "0",
"fieldname": "is_free_item",
"fieldtype": "Check",
"label": "Is Free Item",
@@ -493,6 +498,7 @@
},
{
"allow_on_submit": 1,
+ "default": "0",
"fieldname": "page_break",
"fieldtype": "Check",
"label": "Page Break",
@@ -500,11 +506,33 @@
"oldfieldname": "page_break",
"oldfieldtype": "Check",
"print_hide": 1
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "manufacture_details",
+ "fieldtype": "Section Break",
+ "label": "Manufacture"
+ },
+ {
+ "fieldname": "manufacturer",
+ "fieldtype": "Link",
+ "label": "Manufacturer",
+ "options": "Manufacturer"
+ },
+ {
+ "fieldname": "manufacturer_part_no",
+ "fieldtype": "Data",
+ "label": "Manufacturer Part Number",
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break_15",
+ "fieldtype": "Column Break"
}
],
"idx": 1,
"istable": 1,
- "modified": "2019-05-01 17:35:05.078030",
+ "modified": "2019-06-02 05:32:46.019237",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Quotation Item",
diff --git a/erpnext/config/quality_management.py b/erpnext/config/quality_management.py
index 1256b2d..35acdfa 100644
--- a/erpnext/config/quality_management.py
+++ b/erpnext/config/quality_management.py
@@ -59,14 +59,14 @@
"items": [
{
"type": "doctype",
- "name": "Customer Feedback",
- "description":_("Customer Feedback"),
+ "name": "Quality Feedback",
+ "description":_("Quality Feedback"),
"onboard": 1,
},
{
"type": "doctype",
- "name": "Customer Feedback Template",
- "description":_("Customer Feedback Template"),
+ "name": "Quality Feedback Template",
+ "description":_("Quality Feedback Template"),
}
]
},
diff --git a/erpnext/config/stock.py b/erpnext/config/stock.py
index 4fc824f..84aa847 100644
--- a/erpnext/config/stock.py
+++ b/erpnext/config/stock.py
@@ -163,6 +163,10 @@
},
{
"type": "doctype",
+ "name": "Item Manufacturer",
+ },
+ {
+ "type": "doctype",
"name": "Item Variant Settings",
},
]
diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py
index 0ff329b..0dcf077 100644
--- a/erpnext/controllers/queries.py
+++ b/erpnext/controllers/queries.py
@@ -440,3 +440,20 @@
query += " and item = {item}".format(item = frappe.db.escape(filters.get('item')))
return frappe.db.sql(query, filters)
+
+@frappe.whitelist()
+def item_manufacturer_query(doctype, txt, searchfield, start, page_len, filters):
+ search_txt = "{0}%".format(txt)
+
+ item_filters = {
+ 'manufacturer': ('like', search_txt),
+ 'item_code': filters.get("item_code")
+ }
+
+ return frappe.get_all("Item Manufacturer",
+ fields = "manufacturer",
+ filters = item_filters,
+ limit_start=start,
+ limit_page_length=page_len,
+ as_list=1
+ )
diff --git a/erpnext/demo/data/drug_list.json b/erpnext/demo/data/drug_list.json
index 9b101cb..e91c30d 100644
--- a/erpnext/demo/data/drug_list.json
+++ b/erpnext/demo/data/drug_list.json
@@ -39,8 +39,8 @@
"item_name": "Atocopherol",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
+
+
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:16.577151",
@@ -123,8 +123,8 @@
"item_name": "Abacavir",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
+
+
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:16.678257",
@@ -207,8 +207,6 @@
"item_name": "Abciximab",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:16.695413",
@@ -291,8 +289,6 @@
"item_name": "Acacia",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:16.797774",
@@ -375,8 +371,6 @@
"item_name": "Acamprosate",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:16.826952",
@@ -459,8 +453,6 @@
"item_name": "Acarbose",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:16.843890",
@@ -543,8 +535,6 @@
"item_name": "Acebrofylline",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:16.969984",
@@ -627,8 +617,6 @@
"item_name": "Acebrofylline (SR)",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:16.987354",
@@ -711,8 +699,6 @@
"item_name": "Aceclofenac",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.004369",
@@ -795,8 +781,6 @@
"item_name": "Ash",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.021192",
@@ -879,8 +863,6 @@
"item_name": "Asparaginase",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.038058",
@@ -963,8 +945,6 @@
"item_name": "Aspartame",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.054463",
@@ -1047,8 +1027,6 @@
"item_name": "Aspartic Acid",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.071001",
@@ -1131,8 +1109,6 @@
"item_name": "Bleomycin",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.087170",
@@ -1215,8 +1191,6 @@
"item_name": "Bleomycin Sulphate",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.103691",
@@ -1299,8 +1273,6 @@
"item_name": "Blue cap contains",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.120040",
@@ -1383,8 +1355,6 @@
"item_name": "Boran",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.135964",
@@ -1467,8 +1437,6 @@
"item_name": "Borax",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.152575",
@@ -1551,8 +1519,6 @@
"item_name": "Chlorbutanol",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.168998",
@@ -1635,8 +1601,6 @@
"item_name": "Chlorbutol",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.185316",
@@ -1719,8 +1683,6 @@
"item_name": "Chlordiazepoxide",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.208361",
@@ -1803,8 +1765,6 @@
"item_name": "Chlordiazepoxide and Clidinium Bromide",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.224341",
@@ -1887,8 +1847,6 @@
"item_name": "Chlorhexidine",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.240634",
@@ -1971,8 +1929,6 @@
"item_name": "Chlorhexidine 40%",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.256922",
@@ -2055,8 +2011,6 @@
"item_name": "Chlorhexidine Acetate",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.274789",
@@ -2139,8 +2093,6 @@
"item_name": "Chlorhexidine Gluconate",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.295371",
@@ -2223,8 +2175,6 @@
"item_name": "Chlorhexidine HCL",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.312916",
@@ -2307,8 +2257,6 @@
"item_name": "Chlorhexidine Hydrochloride",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.329570",
@@ -2391,8 +2339,6 @@
"item_name": "Chloride",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.346088",
@@ -2475,8 +2421,6 @@
"item_name": "Fosfomycin Tromethamine",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.362777",
@@ -2559,8 +2503,6 @@
"item_name": "Fosinopril",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.379465",
@@ -2643,8 +2585,6 @@
"item_name": "Iodochlorhydroxyquinoline",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.396068",
@@ -2727,8 +2667,6 @@
"item_name": "Iodochlorohydroxyquinoline",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.412734",
@@ -2811,8 +2749,6 @@
"item_name": "Ipratropium",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.429333",
@@ -2895,8 +2831,6 @@
"item_name": "Mebeverine hydrochloride",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.445814",
@@ -2979,8 +2913,6 @@
"item_name": "Mecetronium ethylsulphate",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.461696",
@@ -3063,8 +2995,6 @@
"item_name": "Meclizine",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.478020",
@@ -3147,8 +3077,8 @@
"item_name": "Oxaprozin",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
+
+
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.496221",
@@ -3231,8 +3161,6 @@
"item_name": "Oxazepam",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.511933",
@@ -3315,8 +3243,6 @@
"item_name": "Oxcarbazepine",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.528472",
@@ -3399,8 +3325,6 @@
"item_name": "Oxetacaine",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.544177",
@@ -3483,8 +3407,6 @@
"item_name": "Oxethazaine",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.560193",
@@ -3567,8 +3489,6 @@
"item_name": "Suxamethonium Chloride",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.576447",
@@ -3651,8 +3571,6 @@
"item_name": "Tacrolimus",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.593481",
@@ -3735,8 +3653,6 @@
"item_name": "Ubiquinol",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.609930",
@@ -3819,8 +3735,6 @@
"item_name": "Vitamin B12",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.626225",
@@ -3903,8 +3817,6 @@
"item_name": "Vitamin B1Hydrochloride",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.642423",
@@ -3987,8 +3899,6 @@
"item_name": "Vitamin B1Monohydrate",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.658946",
@@ -4071,8 +3981,6 @@
"item_name": "Vitamin B2",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.675234",
@@ -4155,8 +4063,6 @@
"item_name": "Vitamin B3",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.691598",
@@ -4239,8 +4145,6 @@
"item_name": "Vitamin D4",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.707840",
@@ -4323,8 +4227,6 @@
"item_name": "Vitamin E",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.723859",
@@ -4407,8 +4309,6 @@
"item_name": "Wheat Germ Oil",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.739829",
@@ -4491,8 +4391,6 @@
"item_name": "Wheatgrass extr",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.757695",
@@ -4575,8 +4473,6 @@
"item_name": "Whey Protein",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.774098",
@@ -4659,8 +4555,6 @@
"item_name": "Xylometazoline",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.790224",
@@ -4743,8 +4637,6 @@
"item_name": "Xylometazoline Hydrochloride",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.806359",
@@ -4827,8 +4719,6 @@
"item_name": "Yeast",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.823305",
@@ -4911,8 +4801,6 @@
"item_name": "Yellow Fever Vaccine",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.840250",
@@ -4995,8 +4883,6 @@
"item_name": "Zafirlukast",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.856856",
@@ -5079,8 +4965,6 @@
"item_name": "Zaleplon",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.873287",
@@ -5163,8 +5047,6 @@
"item_name": "Zaltoprofen",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.889263",
@@ -5247,8 +5129,6 @@
"item_name": "Zanamivir",
"last_purchase_rate": 0.0,
"lead_time_days": 0,
- "manufacturer": null,
- "manufacturer_part_no": null,
"max_discount": 0.0,
"min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.905022",
diff --git a/erpnext/education/doctype/article/article.json b/erpnext/education/doctype/article/article.json
index c30cd18..2fad5af 100644
--- a/erpnext/education/doctype/article/article.json
+++ b/erpnext/education/doctype/article/article.json
@@ -1,230 +1,81 @@
{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
"allow_import": 1,
- "allow_rename": 0,
+ "allow_rename": 1,
"autoname": "field:title",
- "beta": 0,
"creation": "2018-10-17 05:45:38.471670",
- "custom": 0,
- "docstatus": 0,
"doctype": "DocType",
- "document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
+ "field_order": [
+ "title",
+ "author",
+ "content",
+ "publish_date"
+ ],
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
"fieldname": "title",
"fieldtype": "Data",
- "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": "Title",
- "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": 1
},
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
"fieldname": "author",
"fieldtype": "Data",
- "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": "Author",
- "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
+ "label": "Author"
},
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
"fieldname": "content",
"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": "Content",
- "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
+ "label": "Content"
},
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
"fieldname": "publish_date",
"fieldtype": "Date",
- "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": "Publish Date",
- "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
+ "label": "Publish Date"
}
],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2018-11-25 19:06:56.016865",
+ "modified": "2019-06-12 12:36:58.740340",
"modified_by": "Administrator",
"module": "Education",
"name": "Article",
- "name_case": "",
"owner": "Administrator",
"permissions": [
{
- "amend": 0,
- "cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Academics User",
- "set_user_permissions": 0,
"share": 1,
- "submit": 0,
"write": 1
},
{
- "amend": 0,
- "cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Instructor",
- "set_user_permissions": 0,
"share": 1,
- "submit": 0,
"write": 1
},
{
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
"email": 1,
"export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "LMS User",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
- "write": 0
+ "share": 1
}
],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
+ "track_changes": 1
}
\ No newline at end of file
diff --git a/erpnext/education/doctype/course/course.json b/erpnext/education/doctype/course/course.json
index 7d8b073..68426c3 100644
--- a/erpnext/education/doctype/course/course.json
+++ b/erpnext/education/doctype/course/course.json
@@ -1,17 +1,13 @@
{
"allow_import": 1,
"allow_rename": 1,
- "autoname": "field:course_code",
+ "autoname": "field:course_name",
"creation": "2015-09-07 12:39:55.181893",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"course_name",
"department",
- "parent_course",
- "column_break_3",
- "course_code",
- "course_abbreviation",
"section_break_6",
"topics",
"description",
@@ -26,7 +22,8 @@
"fieldtype": "Data",
"in_list_view": 1,
"label": "Course Name",
- "reqd": 1
+ "reqd": 1,
+ "unique": 1
},
{
"fieldname": "department",
@@ -37,30 +34,9 @@
"options": "Department"
},
{
- "fieldname": "parent_course",
- "fieldtype": "Data",
- "label": "Parent Course (Leave blank, if this isn't part of Parent Course)"
- },
- {
- "fieldname": "column_break_3",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "course_code",
- "fieldtype": "Data",
- "label": "Course Code",
- "reqd": 1,
- "unique": 1
- },
- {
- "fieldname": "course_abbreviation",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Course Abbreviation"
- },
- {
"fieldname": "section_break_6",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "label": "Portal Settings"
},
{
"fieldname": "topics",
@@ -71,6 +47,7 @@
{
"fieldname": "hero_image",
"fieldtype": "Attach Image",
+ "hidden": 1,
"label": "Hero Image"
},
{
@@ -96,7 +73,8 @@
"label": "Description"
}
],
- "modified": "2019-06-05 18:39:11.870605",
+ "image_field": "hero_image",
+ "modified": "2019-06-12 12:34:23.748157",
"modified_by": "Administrator",
"module": "Education",
"name": "Course",
diff --git a/erpnext/education/doctype/course/test_records.json b/erpnext/education/doctype/course/test_records.json
index ec57dc7..1e7467a 100644
--- a/erpnext/education/doctype/course/test_records.json
+++ b/erpnext/education/doctype/course/test_records.json
@@ -1,17 +1,14 @@
[
{
- "course_name": "_Test Course",
- "course_code": "TC100",
+ "course_name": "TC100",
"course_abbreviation": "TC"
},
{
- "course_name": "_Test Course 1",
- "course_code": "TC101",
+ "course_name": "TC101",
"course_abbreviation": "TC1"
},
{
- "course_name": "_Test Course 2",
- "course_code": "TC102",
+ "course_name": "TC102",
"course_abbreviation": "TC2"
}
]
\ No newline at end of file
diff --git a/erpnext/education/doctype/program/program.json b/erpnext/education/doctype/program/program.json
index a0a2aa2..2dfe50b 100644
--- a/erpnext/education/doctype/program/program.json
+++ b/erpnext/education/doctype/program/program.json
@@ -1,7 +1,7 @@
{
"allow_import": 1,
"allow_rename": 1,
- "autoname": "field:program_code",
+ "autoname": "field:program_name",
"creation": "2015-09-07 12:54:03.609282",
"doctype": "DocType",
"engine": "InnoDB",
@@ -9,18 +9,17 @@
"program_name",
"department",
"column_break_3",
- "program_code",
"program_abbreviation",
- "section_break_5",
+ "section_break_courses",
"courses",
- "section_break_9",
- "description",
+ "section_break_5",
+ "is_published",
+ "allow_self_enroll",
+ "is_featured",
+ "column_break_11",
"intro_video",
"hero_image",
- "column_break_11",
- "is_published",
- "is_featured",
- "allow_self_enroll"
+ "description"
],
"fields": [
{
@@ -28,7 +27,8 @@
"fieldtype": "Data",
"in_list_view": 1,
"label": "Program Name",
- "reqd": 1
+ "reqd": 1,
+ "unique": 1
},
{
"fieldname": "department",
@@ -43,13 +43,6 @@
"fieldtype": "Column Break"
},
{
- "fieldname": "program_code",
- "fieldtype": "Data",
- "label": "Program Code",
- "reqd": 1,
- "unique": 1
- },
- {
"fieldname": "program_abbreviation",
"fieldtype": "Data",
"in_list_view": 1,
@@ -67,16 +60,13 @@
"options": "Program Course"
},
{
- "fieldname": "section_break_9",
- "fieldtype": "Section Break",
- "label": "LMS Settings"
- },
- {
+ "depends_on": "is_published",
"fieldname": "description",
"fieldtype": "Small Text",
"label": "Description"
},
{
+ "depends_on": "is_published",
"fieldname": "intro_video",
"fieldtype": "Data",
"label": "Intro Video"
@@ -84,13 +74,10 @@
{
"fieldname": "hero_image",
"fieldtype": "Attach Image",
+ "hidden": 1,
"label": "Hero Image"
},
{
- "fieldname": "column_break_11",
- "fieldtype": "Column Break"
- },
- {
"default": "0",
"fieldname": "is_published",
"fieldtype": "Check",
@@ -106,13 +93,22 @@
{
"default": "0",
"depends_on": "eval: doc.is_published == 1",
- "description": "Allow students to enroll themselves from the portal",
"fieldname": "allow_self_enroll",
"fieldtype": "Check",
"label": "Allow Self Enroll"
+ },
+ {
+ "fieldname": "section_break_courses",
+ "fieldtype": "Section Break",
+ "label": "Courses"
+ },
+ {
+ "fieldname": "column_break_11",
+ "fieldtype": "Column Break"
}
],
- "modified": "2019-06-05 17:47:26.877296",
+ "image_field": "hero_image",
+ "modified": "2019-06-12 12:31:14.999346",
"modified_by": "Administrator",
"module": "Education",
"name": "Program",
diff --git a/erpnext/education/doctype/program/test_records.json b/erpnext/education/doctype/program/test_records.json
index 7901db3..4013695 100644
--- a/erpnext/education/doctype/program/test_records.json
+++ b/erpnext/education/doctype/program/test_records.json
@@ -1,13 +1,11 @@
[
{
- "program_name": "_Test Program 1",
- "program_code": "_TP1",
+ "program_name": "_TP1",
"description": "Test Description",
"program_abbreviation": "TP1"
},
{
- "program_name": "_Test Program 2",
- "program_code": "_TP2",
+ "program_name": "_TP2",
"description": "Test Description",
"program_abbreviation": "TP2"
}
diff --git a/erpnext/education/doctype/program_course/program_course.json b/erpnext/education/doctype/program_course/program_course.json
index 79ef717..3465040 100644
--- a/erpnext/education/doctype/program_course/program_course.json
+++ b/erpnext/education/doctype/program_course/program_course.json
@@ -1,169 +1,39 @@
{
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 0,
- "creation": "2015-09-07 14:37:01.886859",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
+ "creation": "2015-09-07 14:37:01.886859",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "course",
+ "required"
+ ],
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "course",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 1,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Course",
- "length": 0,
- "no_copy": 0,
- "options": "Course",
- "permlevel": 0,
- "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
- },
+ "fieldname": "course",
+ "fieldtype": "Link",
+ "in_global_search": 1,
+ "in_list_view": 1,
+ "label": "Course",
+ "options": "Course",
+ "reqd": 1
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_3",
- "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_from": "course.course_name",
- "fieldname": "course_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Course Name",
- "length": 0,
- "no_copy": 0,
- "options": "",
- "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "required",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Mandatory",
- "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
+ "default": "0",
+ "fieldname": "required",
+ "fieldtype": "Check",
+ "in_list_view": 1,
+ "label": "Mandatory"
}
- ],
- "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,
- "max_attachments": 0,
- "menu_index": 0,
- "modified": "2018-05-16 22:42:58.326734",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Program Course",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "restrict_to_domain": "Education",
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0
+ ],
+ "istable": 1,
+ "modified": "2019-06-12 12:42:12.845972",
+ "modified_by": "Administrator",
+ "module": "Education",
+ "name": "Program Course",
+ "owner": "Administrator",
+ "permissions": [],
+ "restrict_to_domain": "Education",
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
}
\ No newline at end of file
diff --git a/erpnext/education/doctype/program_enrollment/program_enrollment.py b/erpnext/education/doctype/program_enrollment/program_enrollment.py
index d232e47..d5348ff 100644
--- a/erpnext/education/doctype/program_enrollment/program_enrollment.py
+++ b/erpnext/education/doctype/program_enrollment/program_enrollment.py
@@ -66,7 +66,7 @@
msgprint(_("Fee Records Created - {0}").format(comma_and(fee_list)))
def get_courses(self):
- return frappe.db.sql('''select course, course_name from `tabProgram Course` where parent = %s and required = 1''', (self.program), as_dict=1)
+ return frappe.db.sql('''select course from `tabProgram Course` where parent = %s and required = 1''', (self.program), as_dict=1)
def create_course_enrollments(self):
student = frappe.get_doc("Student", self.student)
diff --git a/erpnext/education/doctype/quiz/quiz.json b/erpnext/education/doctype/quiz/quiz.json
index b4903fc..569c281 100644
--- a/erpnext/education/doctype/quiz/quiz.json
+++ b/erpnext/education/doctype/quiz/quiz.json
@@ -1,4 +1,6 @@
{
+ "allow_import": 1,
+ "allow_rename": 1,
"autoname": "field:title",
"creation": "2018-10-17 05:52:50.149904",
"doctype": "DocType",
@@ -58,7 +60,7 @@
"options": "Latest Highest Score\nLatest Attempt"
}
],
- "modified": "2019-05-30 18:50:54.218571",
+ "modified": "2019-06-12 12:23:57.020508",
"modified_by": "Administrator",
"module": "Education",
"name": "Quiz",
diff --git a/erpnext/education/doctype/quiz_question/quiz_question.json b/erpnext/education/doctype/quiz_question/quiz_question.json
index 3857c5c..0564482 100644
--- a/erpnext/education/doctype/quiz_question/quiz_question.json
+++ b/erpnext/education/doctype/quiz_question/quiz_question.json
@@ -1,110 +1,40 @@
{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 0,
- "creation": "2018-10-17 06:13:00.098883",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
+ "allow_rename": 1,
+ "creation": "2018-10-17 06:13:00.098883",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "question_link",
+ "question"
+ ],
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "question_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_standard_filter": 0,
- "label": "Question Link",
- "length": 0,
- "no_copy": 0,
- "options": "Question",
- "permlevel": 0,
- "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
- },
+ "fieldname": "question_link",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Question Link",
+ "options": "Question",
+ "reqd": 1
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_from": "question_link.question",
- "fieldname": "question",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Question",
- "length": 0,
- "no_copy": 0,
- "options": "",
- "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
+ "fetch_from": "question_link.question",
+ "fieldname": "question",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Question",
+ "read_only": 1
}
- ],
- "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,
- "max_attachments": 0,
- "modified": "2018-10-18 15:35:12.195250",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Quiz Question",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
+ ],
+ "istable": 1,
+ "modified": "2019-06-12 12:24:02.312577",
+ "modified_by": "Administrator",
+ "module": "Education",
+ "name": "Quiz Question",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
}
\ No newline at end of file
diff --git a/erpnext/education/doctype/topic/topic.json b/erpnext/education/doctype/topic/topic.json
index 6e748fd..305458b 100644
--- a/erpnext/education/doctype/topic/topic.json
+++ b/erpnext/education/doctype/topic/topic.json
@@ -1,14 +1,13 @@
{
- "autoname": "field:topic_code",
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:topic_name",
"creation": "2018-12-12 11:37:39.917760",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"topic_name",
- "column_break_2",
- "topic_code",
- "section_break_4",
"topic_content",
"description",
"hero_image"
@@ -19,25 +18,10 @@
"fieldtype": "Data",
"in_list_view": 1,
"label": "Name",
- "reqd": 1
- },
- {
- "fieldname": "column_break_2",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "topic_code",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Code",
"reqd": 1,
"unique": 1
},
{
- "fieldname": "section_break_4",
- "fieldtype": "Section Break"
- },
- {
"fieldname": "topic_content",
"fieldtype": "Table",
"label": "Topic Content",
@@ -46,6 +30,7 @@
{
"fieldname": "hero_image",
"fieldtype": "Attach Image",
+ "hidden": 1,
"label": "Hero Image"
},
{
@@ -54,7 +39,8 @@
"label": "Description"
}
],
- "modified": "2019-06-05 18:38:44.029711",
+ "image_field": "hero_image",
+ "modified": "2019-06-12 12:34:49.911300",
"modified_by": "Administrator",
"module": "Education",
"name": "Topic",
diff --git a/erpnext/education/doctype/video/video.json b/erpnext/education/doctype/video/video.json
index 3d11bd2..e912eb3 100644
--- a/erpnext/education/doctype/video/video.json
+++ b/erpnext/education/doctype/video/video.json
@@ -1,5 +1,6 @@
{
"allow_import": 1,
+ "allow_rename": 1,
"autoname": "field:title",
"creation": "2018-10-17 05:47:13.087395",
"doctype": "DocType",
@@ -7,11 +8,13 @@
"engine": "InnoDB",
"field_order": [
"title",
- "description",
- "duration",
"provider",
"url",
- "publish_date"
+ "column_break_4",
+ "publish_date",
+ "duration",
+ "section_break_7",
+ "description"
],
"fields": [
{
@@ -53,9 +56,17 @@
"label": "Provider",
"options": "YouTube\nVimeo",
"reqd": 1
+ },
+ {
+ "fieldname": "column_break_4",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "section_break_7",
+ "fieldtype": "Section Break"
}
],
- "modified": "2019-05-20 15:11:53.075093",
+ "modified": "2019-06-12 12:36:48.753092",
"modified_by": "Administrator",
"module": "Education",
"name": "Video",
@@ -95,7 +106,6 @@
"share": 1
}
],
- "quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py
index bdb2080..70ac6fe 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.py
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.py
@@ -446,7 +446,7 @@
else:
component_row.additional_amount = amount
- if not overwrite:
+ if not overwrite and component_row.default_amount:
amount += component_row.default_amount
component_row.amount = amount
diff --git a/erpnext/hr/doctype/travel_request/travel_request.json b/erpnext/hr/doctype/travel_request/travel_request.json
index 31dfe96..c1c6524 100644
--- a/erpnext/hr/doctype/travel_request/travel_request.json
+++ b/erpnext/hr/doctype/travel_request/travel_request.json
@@ -193,6 +193,15 @@
"label": "Other Details"
},
{
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "label": "Amended From",
+ "no_copy": 1,
+ "options": "Travel Request",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
"collapsible": 1,
"fieldname": "accounting_dimensions_section",
"fieldtype": "Section Break",
@@ -203,6 +212,7 @@
"fieldtype": "Column Break"
}
],
+ "is_submittable": 1,
"modified": "2019-05-25 23:15:00.609186",
"modified_by": "Administrator",
"module": "HR",
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index a8fb5d6..15fd82e 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -603,4 +603,5 @@
execute:frappe.delete_doc("Report", "Inactive Items")
erpnext.patches.v11_1.delete_scheduling_tool
erpnext.patches.v12_0.make_custom_fields_for_bank_remittance
-execute:frappe.delete_doc_if_exists("Page", "support-analytics")
\ No newline at end of file
+execute:frappe.delete_doc_if_exists("Page", "support-analytics")
+erpnext.patches.v12_0.make_item_manufacturer
\ No newline at end of file
diff --git a/erpnext/patches/v11_0/update_total_qty_field.py b/erpnext/patches/v11_0/update_total_qty_field.py
index 992454a..9407256 100644
--- a/erpnext/patches/v11_0/update_total_qty_field.py
+++ b/erpnext/patches/v11_0/update_total_qty_field.py
@@ -40,7 +40,7 @@
# This is probably never used anywhere else as of now, but should be
values = []
for d in batch_transactions:
- values.append("('{}', {})".format(d.parent, d.qty))
+ values.append("({0}, {1})".format(frappe.db.escape(d.parent), d.qty))
conditions = ",".join(values)
frappe.db.sql("""
INSERT INTO `tab{}` (name, total_qty) VALUES {}
diff --git a/erpnext/patches/v12_0/make_item_manufacturer.py b/erpnext/patches/v12_0/make_item_manufacturer.py
new file mode 100644
index 0000000..ebc2832
--- /dev/null
+++ b/erpnext/patches/v12_0/make_item_manufacturer.py
@@ -0,0 +1,27 @@
+# Copyright (c) 2017, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+ frappe.reload_doc("stock", "doctype", "item_manufacturer")
+
+ item_manufacturer = []
+ for d in frappe.db.sql(""" SELECT name, manufacturer, manufacturer_part_no, creation, owner
+ FROM `tabItem` WHERE manufacturer is not null and manufacturer != ''""", as_dict=1):
+ item_manufacturer.append((
+ frappe.generate_hash("", 10),
+ d.name,
+ d.manufacturer,
+ d.manufacturer_part_no,
+ d.creation,
+ d.owner
+ ))
+
+ if item_manufacturer:
+ frappe.db.sql('''
+ INSERT INTO `tabItem Manufacturer`
+ (`name`, `item_code`, `manufacturer`, `manufacturer_part_no`, `creation`, `owner`)
+ VALUES {}'''.format(', '.join(['%s'] * len(item_manufacturer))), tuple(item_manufacturer)
+ )
diff --git a/erpnext/public/js/controllers/buying.js b/erpnext/public/js/controllers/buying.js
index f2fe3fe..7e61f03 100644
--- a/erpnext/public/js/controllers/buying.js
+++ b/erpnext/public/js/controllers/buying.js
@@ -14,8 +14,8 @@
this._super();
},
- onload: function() {
- this.setup_queries();
+ onload: function(doc, cdt, cdn) {
+ this.setup_queries(doc, cdt, cdn);
this._super();
this.frm.set_query('shipping_rule', function() {
@@ -50,7 +50,7 @@
/* eslint-enable */
},
- setup_queries: function() {
+ setup_queries: function(doc, cdt, cdn) {
var me = this;
if(this.frm.fields_dict.buying_price_list) {
@@ -90,6 +90,15 @@
}
}
});
+
+
+ this.frm.set_query("manufacturer", "items", function(doc, cdt, cdn) {
+ const row = locals[cdt][cdn];
+ return {
+ query: "erpnext.controllers.queries.item_manufacturer_query",
+ filters:{ 'item_code': row.item_code }
+ }
+ });
},
refresh: function(doc) {
@@ -338,6 +347,25 @@
}
})
}
+ },
+
+ manufacturer: function(doc, cdt, cdn) {
+ const row = locals[cdt][cdn];
+
+ if(row.manufacturer) {
+ frappe.call({
+ method: "erpnext.stock.doctype.item_manufacturer.item_manufacturer.get_item_manufacturer_part_no",
+ args: {
+ 'item_code': row.item_code,
+ 'manufacturer': row.manufacturer
+ },
+ callback: function(r) {
+ if (r.message) {
+ frappe.model.set_value(cdt, cdn, 'manufacturer_part_no', r.message);
+ }
+ }
+ });
+ }
}
});
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index 329695e..bbd1f1c 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -460,6 +460,7 @@
weight_per_unit: item.weight_per_unit,
weight_uom: item.weight_uom,
uom : item.uom,
+ manufacturer: item.manufacturer,
stock_uom: item.stock_uom,
pos_profile: me.frm.doc.doctype == 'Sales Invoice' ? me.frm.doc.pos_profile : '',
cost_center: item.cost_center,
diff --git a/erpnext/quality_management/doctype/customer_feedback/customer_feedback.js b/erpnext/quality_management/doctype/customer_feedback/customer_feedback.js
deleted file mode 100644
index 16ae9a1..0000000
--- a/erpnext/quality_management/doctype/customer_feedback/customer_feedback.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2018, Frappe and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('Customer Feedback', {
- onload: function(frm){
- frm.set_value("date", frappe.datetime.get_today());
- $(".grid-add-row").hide();
- frm.refresh();
- },
- template: function(frm){ // Used to fetch the parameters of the selected feedback template
- frm.fields_dict.feedback.grid.remove_all();
- if(frm.doc.template){
- frappe.call({
- "method": "frappe.client.get",
- args: {
- doctype: "Customer Feedback Template",
- name: frm.doc.template
- },
- callback: function (data) {
- for (var i = 0; i < data.message.feedback_parameter.length; i++ ){
- frm.add_child("feedback");
- frm.fields_dict.feedback.get_value()[i].parameter = data.message.feedback_parameter[i].parameter;
- }
- frm.refresh();
- }
- });
- }
- }
-});
diff --git a/erpnext/quality_management/doctype/customer_feedback/customer_feedback.json b/erpnext/quality_management/doctype/customer_feedback/customer_feedback.json
deleted file mode 100644
index ffa7e4d..0000000
--- a/erpnext/quality_management/doctype/customer_feedback/customer_feedback.json
+++ /dev/null
@@ -1,259 +0,0 @@
-{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "QMS-FDBK-.#####",
- "beta": 0,
- "creation": "2018-10-02 12:23:38.437696",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "customer",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Customer",
- "length": 0,
- "no_copy": 0,
- "options": "Customer",
- "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": "date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Date",
- "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": "column_break_2",
- "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": "template",
- "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": "Template",
- "length": 0,
- "no_copy": 0,
- "options": "Customer Feedback Template",
- "permlevel": 0,
- "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": "feedback_section",
- "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": "Feedback",
- "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,
- "fetch_from": "template.feedback_values",
- "fieldname": "feedback",
- "fieldtype": "Table",
- "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": "feedback",
- "length": 0,
- "no_copy": 0,
- "options": "Customer Feedback Table",
- "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": 0,
- "max_attachments": 0,
- "modified": "2018-11-12 14:39:18.044191",
- "modified_by": "Administrator",
- "module": "Quality Management",
- "name": "Customer Feedback",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "System Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
- "write": 1
- }
- ],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/customer_feedback/customer_feedback.py b/erpnext/quality_management/doctype/customer_feedback/customer_feedback.py
deleted file mode 100644
index 6211c42..0000000
--- a/erpnext/quality_management/doctype/customer_feedback/customer_feedback.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-from frappe.model.document import Document
-
-class CustomerFeedback(Document):
- pass
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/customer_feedback/customer_feedback_dashboard.py b/erpnext/quality_management/doctype/customer_feedback/customer_feedback_dashboard.py
deleted file mode 100644
index 44ae123..0000000
--- a/erpnext/quality_management/doctype/customer_feedback/customer_feedback_dashboard.py
+++ /dev/null
@@ -1,12 +0,0 @@
-from frappe import _
-
-def get_data():
- return {
- 'fieldname': 'feedback',
- 'transactions': [
- {
- 'label': _('Action'),
- 'items': ['Quality Action']
- }
- ],
- }
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/customer_feedback/customer_feedback_list.js b/erpnext/quality_management/doctype/customer_feedback/customer_feedback_list.js
deleted file mode 100644
index 7c5f767..0000000
--- a/erpnext/quality_management/doctype/customer_feedback/customer_feedback_list.js
+++ /dev/null
@@ -1,11 +0,0 @@
-frappe.listview_settings['Customer Feedback'] = {
- add_fields: ["action"],
- get_indicator: function(doc) {
- if(doc.action == "No Action") {
- return [__("No Action"), "green", "action,=,No Action"];
- }
- else if(doc.action == "Action Initialised") {
- return [__("Action Initialised"), "red", "action,=,Action Initialised"];
- }
- }
-};
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/customer_feedback/test_customer_feedback.js b/erpnext/quality_management/doctype/customer_feedback/test_customer_feedback.js
deleted file mode 100644
index 1003ee5..0000000
--- a/erpnext/quality_management/doctype/customer_feedback/test_customer_feedback.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* eslint-disable */
-// rename this file from _test_[name] to test_[name] to activate
-// and remove above this line
-
-QUnit.test("test: Customer Feedback", function (assert) {
- let done = assert.async();
-
- // number of asserts
- assert.expect(1);
-
- frappe.run_serially([
- // insert a new Customer Survey
- () => frappe.tests.make('Customer Feedback', [
- // values to be set
- {key: 'value'}
- ]),
- () => {
- assert.equal(cur_frm.doc.key, 'value');
- },
- () => done()
- ]);
-
-});
diff --git a/erpnext/quality_management/doctype/customer_feedback/test_customer_feedback.py b/erpnext/quality_management/doctype/customer_feedback/test_customer_feedback.py
deleted file mode 100644
index b5d6141..0000000
--- a/erpnext/quality_management/doctype/customer_feedback/test_customer_feedback.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe and Contributors
-# See license.txt
-from __future__ import unicode_literals
-
-import frappe
-import unittest
-from erpnext.quality_management.doctype.customer_feedback_template.test_customer_feedback_template import create_template
-class TestCustomerFeedback(unittest.TestCase):
- def test_customer_feedback(self):
- create_template()
- test_create_feedback = create_feedback()
- test_get_feedback = get_feedback()
- self.assertEquals(test_create_feedback.name, test_get_feedback.name)
-
-def create_feedback():
- feedback = frappe.get_doc({
- "doctype": "Customer Feedback",
- "template": "FDBK-TMPL-_Test Customer Feedback Template",
- "date": ""+ frappe.utils.nowdate() +""
- })
- feedback_exist = frappe.get_list("Customer Feedback", filters={"date": ""+ feedback.date +""}, limit=1)
- if len(feedback_exist) == 0:
- feedback.insert()
- return feedback
- else:
- return feedback_exist[0]
-
-def get_feedback():
- feedback = frappe.get_list("Customer Feedback", limit=1)
- return feedback[0]
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/customer_feedback_table/__init__.py b/erpnext/quality_management/doctype/customer_feedback_table/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/quality_management/doctype/customer_feedback_table/__init__.py
+++ /dev/null
diff --git a/erpnext/quality_management/doctype/customer_feedback_table/customer_feedback_table.json b/erpnext/quality_management/doctype/customer_feedback_table/customer_feedback_table.json
deleted file mode 100644
index b9516b2..0000000
--- a/erpnext/quality_management/doctype/customer_feedback_table/customer_feedback_table.json
+++ /dev/null
@@ -1,142 +0,0 @@
-{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 0,
- "creation": "2018-10-15 15:36:27.193355",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "parameter",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Parameter",
- "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,
- "default": "1",
- "fieldname": "rating",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Rating",
- "length": 0,
- "no_copy": 0,
- "options": "1\n2\n3\n4\n5",
- "permlevel": 0,
- "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,
- "default": "",
- "fieldname": "qualitative_feedback",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Qualitative Feedback",
- "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": 1,
- "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,
- "max_attachments": 0,
- "modified": "2018-11-01 14:29:03.273927",
- "modified_by": "Administrator",
- "module": "Quality Management",
- "name": "Customer Feedback Table",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/customer_feedback_table/customer_feedback_table.py b/erpnext/quality_management/doctype/customer_feedback_table/customer_feedback_table.py
deleted file mode 100644
index ef1b183..0000000
--- a/erpnext/quality_management/doctype/customer_feedback_table/customer_feedback_table.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-from frappe.model.document import Document
-
-class CustomerFeedbackTable(Document):
- pass
diff --git a/erpnext/quality_management/doctype/customer_feedback_template/customer_feedback_template.js b/erpnext/quality_management/doctype/customer_feedback_template/customer_feedback_template.js
deleted file mode 100644
index e318bf7..0000000
--- a/erpnext/quality_management/doctype/customer_feedback_template/customer_feedback_template.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright (c) 2018, Frappe and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('Customer Feedback Template', {
-});
diff --git a/erpnext/quality_management/doctype/customer_feedback_template/customer_feedback_template.json b/erpnext/quality_management/doctype/customer_feedback_template/customer_feedback_template.json
deleted file mode 100644
index 1d1e344..0000000
--- a/erpnext/quality_management/doctype/customer_feedback_template/customer_feedback_template.json
+++ /dev/null
@@ -1,259 +0,0 @@
-{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "format:FDBK-TMPL-{template}",
- "beta": 0,
- "creation": "2018-10-18 15:11:26.215480",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "template",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Template",
- "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": 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": "column_break_3",
- "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": "scope",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Scope",
- "length": 0,
- "no_copy": 0,
- "options": "Company\nDepartment",
- "permlevel": 0,
- "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,
- "depends_on": "eval:doc.scope == 'Department'",
- "fieldname": "department",
- "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": "Department",
- "length": 0,
- "no_copy": 0,
- "options": "Department",
- "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": "feedback_section",
- "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": "Feedback",
- "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": "feedback_parameter",
- "fieldtype": "Table",
- "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": "Feedback",
- "length": 0,
- "no_copy": 0,
- "options": "Customer Feedback Template Table",
- "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": 0,
- "max_attachments": 0,
- "modified": "2018-11-01 14:27:07.935761",
- "modified_by": "Administrator",
- "module": "Quality Management",
- "name": "Customer Feedback Template",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "System Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
- "write": 1
- }
- ],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/customer_feedback_template/customer_feedback_template.py b/erpnext/quality_management/doctype/customer_feedback_template/customer_feedback_template.py
deleted file mode 100644
index 7f2eb3d..0000000
--- a/erpnext/quality_management/doctype/customer_feedback_template/customer_feedback_template.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-from frappe.model.document import Document
-
-class CustomerFeedbackTemplate(Document):
- pass
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/customer_feedback_template/test_customer_feedback_template.js b/erpnext/quality_management/doctype/customer_feedback_template/test_customer_feedback_template.js
deleted file mode 100644
index 77168e0..0000000
--- a/erpnext/quality_management/doctype/customer_feedback_template/test_customer_feedback_template.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* eslint-disable */
-// rename this file from _test_[name] to test_[name] to activate
-// and remove above this line
-
-QUnit.test("test: Customer Feedback Template", function (assert) {
- let done = assert.async();
-
- // number of asserts
- assert.expect(1);
-
- frappe.run_serially([
- // insert a new Customer Feedback Template
- () => frappe.tests.make('Customer Feedback Template', [
- // values to be set
- {key: 'value'}
- ]),
- () => {
- assert.equal(cur_frm.doc.key, 'value');
- },
- () => done()
- ]);
-
-});
diff --git a/erpnext/quality_management/doctype/customer_feedback_template/test_customer_feedback_template.py b/erpnext/quality_management/doctype/customer_feedback_template/test_customer_feedback_template.py
deleted file mode 100644
index 2bc4334..0000000
--- a/erpnext/quality_management/doctype/customer_feedback_template/test_customer_feedback_template.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe and Contributors
-# See license.txt
-from __future__ import unicode_literals
-
-import frappe
-import unittest
-
-class TestCustomerFeedbackTemplate(unittest.TestCase):
- def test_customer_feedback_template(self):
- test_create_template = create_template()
- test_get_template = get_template()
- self.assertEquals(test_get_template.name, test_create_template.name)
-
-def create_template():
- template = frappe.get_doc({
- "doctype": "Customer Feedback Template",
- "template": "_Test Customer Feedback Template",
- "scope": "Company",
- "feedback_parameter": [
- {
- "parameter": "_Test Customer Feedback Template Parameter",
- }
- ]
- })
- template_exist = frappe.get_list("Customer Feedback Template", filters={"template": ""+ template.template +""}, fields=["name"], limit=1)
- if len(template_exist) == 0:
- template.insert()
- return template
- else:
- return template_exist[0]
-
-def get_template():
- template = frappe.get_list("Customer Feedback Template", filters={"template": "_Test Customer Feedback Template"}, limit=1)
- return template[0]
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/customer_feedback_template_table/__init__.py b/erpnext/quality_management/doctype/customer_feedback_template_table/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/quality_management/doctype/customer_feedback_template_table/__init__.py
+++ /dev/null
diff --git a/erpnext/quality_management/doctype/customer_feedback_template_table/customer_feedback_template_table.json b/erpnext/quality_management/doctype/customer_feedback_template_table/customer_feedback_template_table.json
deleted file mode 100644
index d28bb5d..0000000
--- a/erpnext/quality_management/doctype/customer_feedback_template_table/customer_feedback_template_table.json
+++ /dev/null
@@ -1,75 +0,0 @@
-{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 0,
- "creation": "2018-10-18 15:23:03.854925",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "parameter",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Parameter",
- "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": 1,
- "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,
- "max_attachments": 0,
- "modified": "2018-11-01 14:28:50.626709",
- "modified_by": "Administrator",
- "module": "Quality Management",
- "name": "Customer Feedback Template Table",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/customer_feedback_template_table/customer_feedback_template_table.py b/erpnext/quality_management/doctype/customer_feedback_template_table/customer_feedback_template_table.py
deleted file mode 100644
index 082046d..0000000
--- a/erpnext/quality_management/doctype/customer_feedback_template_table/customer_feedback_template_table.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-from frappe.model.document import Document
-
-class CustomerFeedbackTemplateTable(Document):
- pass
diff --git a/erpnext/quality_management/doctype/quality_action/quality_action.js b/erpnext/quality_management/doctype/quality_action/quality_action.js
index 8cf8aa9..7078247 100644
--- a/erpnext/quality_management/doctype/quality_action/quality_action.js
+++ b/erpnext/quality_management/doctype/quality_action/quality_action.js
@@ -5,83 +5,29 @@
onload: function(frm) {
frm.set_value("date", frappe.datetime.get_today());
frm.refresh();
- $(".grid-add-row").hide();
- if (frm.doc.review){
- frm.set_value("type", "Quality Review");
- }
- else{
- frm.set_value("type", "Customer Feedback");
- }
},
- review: function(frm){
- frm.fields_dict.description.grid.remove_all();
- if(frm.doc.review){
- var problems = "";
- frappe.call({
- "method": "frappe.client.get",
- args: {
- doctype: "Quality Review",
- name: frm.doc.review
- },
- callback: function (data) {
- for (var i = 0; i < data.message.values.length; i++){
- if (data.message.values[i].achieved < data.message.values[i].target){
- problems += data.message.values[i].objective +"-"+ data.message.values[i].achieved + " " + data.message.values[i].unit + "\n";
- }
- }
- problems= problems.replace(/\n$/, "").split("\n");
- for (i = 0; i < problems.length; i++){
- frm.add_child("description");
- frm.fields_dict.description.get_value()[i].problem = problems[i];
- }
- frm.refresh();
+ document_name: function(frm){
+ frappe.call({
+ "method": "frappe.client.get",
+ args: {
+ doctype: frm.doc.document_type,
+ name: frm.doc.document_name
+ },
+ callback: function(data){
+ frm.fields_dict.resolutions.grid.remove_all();
+ let objectives = [];
+
+ if(frm.doc.document_type === "Quality Review"){
+ for(let i in data.message.reviews) objectives.push(data.message.reviews[i].review);
+ } else {
+ for(let j in data.message.parameters) objectives.push(data.message.parameters[j].feedback);
}
- });
- frappe.call({
- "method": "frappe.client.get",
- args: {
- doctype: "Quality Goal",
- name: frm.doc.goal
- },
- callback: function (data) {
- frm.doc.procedure = data.message.procedure;
- frm.refresh();
+ for (var objective in objectives){
+ frm.add_child("resolutions");
+ frm.fields_dict.resolutions.get_value()[objective].problem = objectives[objective];
}
- });
- }
- else{
- frm.doc.goal = '';
- frm.doc.procedure = '';
- frm.refresh();
- }
+ frm.refresh();
+ }
+ });
},
- feedback: function(frm) {
- frm.fields_dict.description.grid.remove_all();
- if(frm.doc.feedback){
- frappe.call({
- "method": "frappe.client.get",
- args: {
- doctype: "Customer Feedback",
- name: frm.doc.feedback
- },
- callback: function(data){
- for (var i = 0; i < data.message.feedback.length; i++ ){
- frm.add_child("description");
- frm.fields_dict.description.get_value()[i].problem = data.message.feedback[i].parameter +"-"+ data.message.feedback[i].qualitative_feedback;
- }
- frm.refresh();
- }
- });
- }
- },
- type: function(frm){
- if(frm.doc.description){
- frm.fields_dict.description.grid.remove_all();
- frm.doc.review = '';
- frm.doc.feedback = '';
- frm.doc.goal = '';
- frm.doc.procedure = '';
- frm.refresh();
- }
- }
});
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_action/quality_action.json b/erpnext/quality_management/doctype/quality_action/quality_action.json
index e564a56..8835b47 100644
--- a/erpnext/quality_management/doctype/quality_action/quality_action.json
+++ b/erpnext/quality_management/doctype/quality_action/quality_action.json
@@ -1,493 +1,125 @@
{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "format:QMS-ACTN-{#####}",
- "beta": 0,
- "creation": "2018-10-02 11:40:43.666100",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
+ "autoname": "format:ACTN-{#####}",
+ "creation": "2018-10-02 11:40:43.666100",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "corrective_preventive",
+ "document_type",
+ "goal",
+ "cb_00",
+ "date",
+ "document_name",
+ "procedure",
+ "status",
+ "sb_00",
+ "resolutions"
+ ],
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "action",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Corrective/Preventive",
- "length": 0,
- "no_copy": 0,
- "options": "Corrective\nPreventive",
- "permlevel": 0,
- "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
- },
+ "depends_on": "eval:doc.type == 'Quality Review'",
+ "fetch_from": "review.goal",
+ "fieldname": "goal",
+ "fieldtype": "Link",
+ "label": "Goal",
+ "options": "Quality Goal",
+ "read_only": 1
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.type == 'Quality Review'",
- "fieldname": "review",
- "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": "Review",
- "length": 0,
- "no_copy": 0,
- "options": "Quality Review",
- "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
- },
+ "fieldname": "date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "Date",
+ "read_only": 1
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.type == 'Customer Feedback'",
- "fieldname": "feedback",
- "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": "Feedback",
- "length": 0,
- "no_copy": 0,
- "options": "Customer Feedback",
- "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
- },
+ "depends_on": "eval:doc.type == 'Quality Review'",
+ "fieldname": "procedure",
+ "fieldtype": "Link",
+ "label": "Procedure",
+ "options": "Quality Procedure",
+ "read_only": 1
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.type == 'Quality Review'",
- "fetch_from": "review.goal",
- "fieldname": "goal",
- "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": "Quality Goal",
- "length": 0,
- "no_copy": 0,
- "options": "Quality Goal",
- "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
- },
+ "default": "Open",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Status",
+ "options": "Open\nClosed"
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_3",
- "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
- },
+ "fieldname": "document_name",
+ "fieldtype": "Dynamic Link",
+ "label": "Document Name",
+ "options": "document_type"
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "type",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Type",
- "length": 0,
- "no_copy": 0,
- "options": "Quality Review\nCustomer Feedback",
- "permlevel": 0,
- "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
- },
+ "fieldname": "document_type",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Document Type",
+ "options": "Quality Review\nQuality Feedback",
+ "reqd": 1
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Date",
- "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
- },
+ "default": "Corrective",
+ "fieldname": "corrective_preventive",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Corrective/Preventive",
+ "options": "Corrective\nPreventive",
+ "reqd": 1
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.type == 'Quality Review'",
- "fetch_from": "",
- "fieldname": "procedure",
- "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": "Procedure",
- "length": 0,
- "no_copy": 0,
- "options": "Quality Procedure",
- "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
- },
+ "fieldname": "cb_00",
+ "fieldtype": "Column Break"
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "status_section",
- "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": "Status",
- "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
- },
+ "fieldname": "sb_00",
+ "fieldtype": "Section Break",
+ "label": "Resolution"
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "Under Review",
- "fieldname": "status",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Status",
- "length": 0,
- "no_copy": 0,
- "options": "Under Review\nClose",
- "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": "column_break_10",
- "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": "problem_resolution",
- "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": "Description",
- "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": "description",
- "fieldtype": "Table",
- "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": "Action Description",
- "length": 0,
- "no_copy": 0,
- "options": "Quality Action Table",
- "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
+ "fieldname": "resolutions",
+ "fieldtype": "Table",
+ "label": "Resolutions",
+ "options": "Quality Action Resolution"
}
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2018-11-12 14:27:07.724362",
- "modified_by": "Administrator",
- "module": "Quality Management",
- "name": "Quality Action",
- "name_case": "",
- "owner": "Administrator",
+ ],
+ "modified": "2019-05-28 13:10:44.092497",
+ "modified_by": "Administrator",
+ "module": "Quality Management",
+ "name": "Quality Action",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "System Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "share": 1,
+ "write": 1
+ },
+ {
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "All",
+ "share": 1,
"write": 1
}
- ],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
+ ],
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_action/quality_action.py b/erpnext/quality_management/doctype/quality_action/quality_action.py
index 620252e..88d4bd8 100644
--- a/erpnext/quality_management/doctype/quality_action/quality_action.py
+++ b/erpnext/quality_management/doctype/quality_action/quality_action.py
@@ -3,18 +3,8 @@
# For license information, please see license.txt
from __future__ import unicode_literals
+import frappe
from frappe.model.document import Document
class QualityAction(Document):
- def validate(self):
- status_flag = ''
- for value in self.description:
- if value.resolution == None:
- value.status = 'Open'
- status_flag = 'Under Review'
- else:
- value.status = 'Close'
- if status_flag == 'Under Review':
- self.status = 'Under Review'
- else:
- self.status = 'Close'
\ No newline at end of file
+ pass
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_action/quality_action_list.js b/erpnext/quality_management/doctype/quality_action/quality_action_list.js
deleted file mode 100644
index da6b65d..0000000
--- a/erpnext/quality_management/doctype/quality_action/quality_action_list.js
+++ /dev/null
@@ -1,11 +0,0 @@
-frappe.listview_settings['Quality Action'] = {
- add_fields: ["status"],
- get_indicator: function(doc) {
- if(doc.status == "Planned") {
- return [__("Planned"), "green", "status,=,Planned"];
- }
- else{
- return [__("Under Review"), "red", "status,=,Under Review"];
- }
- }
-};
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_action/test_quality_action.py b/erpnext/quality_management/doctype/quality_action/test_quality_action.py
index c47955c..51178d6 100644
--- a/erpnext/quality_management/doctype/quality_action/test_quality_action.py
+++ b/erpnext/quality_management/doctype/quality_action/test_quality_action.py
@@ -19,28 +19,28 @@
create_review()
test_create_action = create_action()
test_get_action = get_action()
- self.assertEquals(test_create_action.name, test_get_action.name)
- self.assertEquals(test_create_action.goal, test_get_action.goal)
+
+ self.assertEquals(test_create_action, test_get_action)
def create_action():
- review = frappe.get_list("Quality Review", limit=1)
+ review = frappe.db.exists("Quality Review", {"goal": "GOAL-_Test Quality Goal"})
action = frappe.get_doc({
- 'doctype': 'Quality Action',
- 'action': 'Corrective',
- 'type': 'Quality Review',
- 'review': ''+ review[0].name +'',
- 'date': ''+ frappe.utils.nowdate() +'',
- 'goal': '_Test Quality Goal',
- 'procedure': '_Test Quality Procedure'
+ "doctype": "Quality Action",
+ "action": "Corrective",
+ "document_type": "Quality Review",
+ "document_name": review,
+ "date": frappe.utils.nowdate(),
+ "goal": "GOAL-_Test Quality Goal",
+ "procedure": "PRC-_Test Quality Procedure"
})
- action_exist = frappe.get_list("Quality Action", filters={"review": ""+ review[0].name +""}, fields=["name", "goal"], limit=1)
- if len(action_exist) == 0:
+ action_exist = frappe.db.exists("Quality Action", {"review": review})
+
+ if not action_exist:
action.insert()
- return action
+ return action.name
else:
- return action_exist[0]
+ return action_exist
def get_action():
- review = frappe.get_list("Quality Review", limit=1)
- action = frappe.get_list("Quality Action", filters={"review": ""+ review[0].name +""}, fields=["name", "goal"], limit=1)
- return action[0]
\ No newline at end of file
+ review = frappe.db.exists("Quality Review", {"goal": "GOAL-_Test Quality Goal"})
+ return frappe.db.exists("Quality Action", {"document_name": review})
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_action_table/__init__.py b/erpnext/quality_management/doctype/quality_action_resolution/__init__.py
similarity index 100%
rename from erpnext/quality_management/doctype/quality_action_table/__init__.py
rename to erpnext/quality_management/doctype/quality_action_resolution/__init__.py
diff --git a/erpnext/quality_management/doctype/quality_action_resolution/quality_action_resolution.json b/erpnext/quality_management/doctype/quality_action_resolution/quality_action_resolution.json
new file mode 100644
index 0000000..74370cc
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_action_resolution/quality_action_resolution.json
@@ -0,0 +1,40 @@
+{
+ "creation": "2019-05-26 20:36:44.337186",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "problem",
+ "sb_00",
+ "resolution"
+ ],
+ "fields": [
+ {
+ "fieldname": "problem",
+ "fieldtype": "Long Text",
+ "in_list_view": 1,
+ "label": "Problem"
+ },
+ {
+ "fieldname": "sb_00",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "resolution",
+ "fieldtype": "Text Editor",
+ "in_list_view": 1,
+ "label": "Resolution"
+ }
+ ],
+ "istable": 1,
+ "modified": "2019-05-28 13:09:50.435323",
+ "modified_by": "Administrator",
+ "module": "Quality Management",
+ "name": "Quality Action Resolution",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
+}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_action_resolution/quality_action_resolution.py b/erpnext/quality_management/doctype/quality_action_resolution/quality_action_resolution.py
new file mode 100644
index 0000000..de8873f
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_action_resolution/quality_action_resolution.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+# import frappe
+from frappe.model.document import Document
+
+class QualityActionResolution(Document):
+ pass
diff --git a/erpnext/quality_management/doctype/quality_action_table/quality_action_table.json b/erpnext/quality_management/doctype/quality_action_table/quality_action_table.json
deleted file mode 100644
index a5f7fb6..0000000
--- a/erpnext/quality_management/doctype/quality_action_table/quality_action_table.json
+++ /dev/null
@@ -1,205 +0,0 @@
-{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 0,
- "creation": "2018-10-15 15:36:53.624990",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "problem",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Problem",
- "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": "resolution",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Resolution",
- "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": "status",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Status",
- "length": 0,
- "no_copy": 0,
- "options": "Open\nClose",
- "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": "responsible",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Responsible",
- "length": 0,
- "no_copy": 0,
- "options": "Role",
- "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": "completion_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Completion Date",
- "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,
- "max_attachments": 0,
- "modified": "2018-11-12 14:33:46.260600",
- "modified_by": "Administrator",
- "module": "Quality Management",
- "name": "Quality Action Table",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_action_table/quality_action_table.py b/erpnext/quality_management/doctype/quality_action_table/quality_action_table.py
deleted file mode 100644
index 9beb148..0000000
--- a/erpnext/quality_management/doctype/quality_action_table/quality_action_table.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-from frappe.model.document import Document
-
-class QualityActionTable(Document):
- pass
diff --git a/erpnext/quality_management/doctype/customer_feedback/__init__.py b/erpnext/quality_management/doctype/quality_feedback/__init__.py
similarity index 100%
rename from erpnext/quality_management/doctype/customer_feedback/__init__.py
rename to erpnext/quality_management/doctype/quality_feedback/__init__.py
diff --git a/erpnext/quality_management/doctype/quality_feedback/quality_feedback.js b/erpnext/quality_management/doctype/quality_feedback/quality_feedback.js
new file mode 100644
index 0000000..63747af
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_feedback/quality_feedback.js
@@ -0,0 +1,25 @@
+// Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Quality Feedback', {
+ refresh: function(frm) {
+ frm.set_value("date", frappe.datetime.get_today());
+ },
+ template: function(frm){
+ frappe.call({
+ "method": "frappe.client.get",
+ args: {
+ doctype: "Quality Feedback Template",
+ name: frm.doc.template
+ },
+ callback: function(data){
+ frm.fields_dict.parameters.grid.remove_all();
+ for (var i in data.message.parameters){
+ frm.add_child("parameters");
+ frm.fields_dict.parameters.get_value()[i].parameter = data.message.parameters[i].parameter;
+ }
+ frm.refresh();
+ }
+ });
+ }
+});
diff --git a/erpnext/quality_management/doctype/quality_feedback/quality_feedback.json b/erpnext/quality_management/doctype/quality_feedback/quality_feedback.json
new file mode 100644
index 0000000..460438a
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_feedback/quality_feedback.json
@@ -0,0 +1,95 @@
+{
+ "autoname": "format:FDBK-{#####}",
+ "creation": "2019-05-26 21:23:05.308379",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "document_type",
+ "template",
+ "cb_00",
+ "document_name",
+ "date",
+ "sb_00",
+ "parameters"
+ ],
+ "fields": [
+ {
+ "fieldname": "template",
+ "fieldtype": "Link",
+ "label": "Template",
+ "options": "Quality Feedback Template",
+ "reqd": 1
+ },
+ {
+ "fieldname": "cb_00",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "Date",
+ "read_only": 1
+ },
+ {
+ "fieldname": "sb_00",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fetch_from": "template.feedback_values",
+ "fieldname": "parameters",
+ "fieldtype": "Table",
+ "label": "Parameters",
+ "options": "Quality Feedback Parameter"
+ },
+ {
+ "fieldname": "document_type",
+ "fieldtype": "Select",
+ "label": "Type",
+ "options": "User\nCustomer",
+ "reqd": 1
+ },
+ {
+ "fieldname": "document_name",
+ "fieldtype": "Dynamic Link",
+ "label": "Name",
+ "options": "document_type",
+ "reqd": 1
+ }
+ ],
+ "modified": "2019-05-28 15:16:01.161662",
+ "modified_by": "Administrator",
+ "module": "Quality Management",
+ "name": "Quality Feedback",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "share": 1,
+ "write": 1
+ },
+ {
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "All",
+ "share": 1,
+ "write": 1
+ }
+ ],
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
+}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_feedback/quality_feedback.py b/erpnext/quality_management/doctype/quality_feedback/quality_feedback.py
new file mode 100644
index 0000000..9894181
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_feedback/quality_feedback.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class QualityFeedback(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_feedback/test_quality_feedback.py b/erpnext/quality_management/doctype/quality_feedback/test_quality_feedback.py
new file mode 100644
index 0000000..3be1eb2
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_feedback/test_quality_feedback.py
@@ -0,0 +1,53 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+from erpnext.quality_management.doctype.quality_feedback_template.test_quality_feedback_template import create_template
+
+class TestQualityFeedback(unittest.TestCase):
+
+ def test_quality_feedback(self):
+ create_template()
+ test_create_feedback = create_feedback()
+ test_get_feedback = get_feedback()
+
+ self.assertEqual(test_create_feedback, test_get_feedback)
+
+def create_feedback():
+ create_customer()
+
+ feedabck = frappe.get_doc({
+ "doctype": "Quality Feedback",
+ "template": "TMPL-_Test Feedback Template",
+ "document_type": "Customer",
+ "document_name": "Quality Feedback Customer",
+ "date": frappe.utils.nowdate(),
+ "parameters": [
+ {
+ "parameter": "Test Parameter",
+ "rating": 3,
+ "feedback": "Test Feedback"
+ }
+ ]
+ })
+
+ feedback_exists = frappe.db.exists("Quality Feedback", {"template": "TMPL-_Test Feedback Template"})
+
+ if not feedback_exists:
+ feedabck.insert()
+ return feedabck.name
+ else:
+ return feedback_exists
+
+def get_feedback():
+ return frappe.db.exists("Quality Feedback", {"template": "TMPL-_Test Feedback Template"})
+
+def create_customer():
+ if not frappe.db.exists("Customer", {"customer_name": "Quality Feedback Customer"}):
+ customer = frappe.get_doc({
+ "doctype": "Customer",
+ "customer_name": "Quality Feedback Customer"
+ }).insert(ignore_permissions=True)
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_action_table/__init__.py b/erpnext/quality_management/doctype/quality_feedback_parameter/__init__.py
similarity index 100%
copy from erpnext/quality_management/doctype/quality_action_table/__init__.py
copy to erpnext/quality_management/doctype/quality_feedback_parameter/__init__.py
diff --git a/erpnext/quality_management/doctype/quality_feedback_parameter/quality_feedback_parameter.json b/erpnext/quality_management/doctype/quality_feedback_parameter/quality_feedback_parameter.json
new file mode 100644
index 0000000..d0b368f
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_feedback_parameter/quality_feedback_parameter.json
@@ -0,0 +1,57 @@
+{
+ "creation": "2019-05-26 21:25:01.715807",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "parameter",
+ "cb_00",
+ "rating",
+ "sb_00",
+ "feedback"
+ ],
+ "fields": [
+ {
+ "fieldname": "parameter",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Parameter",
+ "read_only": 1
+ },
+ {
+ "fieldname": "cb_00",
+ "fieldtype": "Column Break"
+ },
+ {
+ "default": "1",
+ "fieldname": "rating",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Rating",
+ "options": "1\n2\n3\n4\n5",
+ "reqd": 1
+ },
+ {
+ "fieldname": "sb_00",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "feedback",
+ "fieldtype": "Text Editor",
+ "in_list_view": 1,
+ "label": "Feedback",
+ "reqd": 1
+ }
+ ],
+ "istable": 1,
+ "modified": "2019-05-26 21:50:48.951264",
+ "modified_by": "Administrator",
+ "module": "Quality Management",
+ "name": "Quality Feedback Parameter",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
+}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_feedback_parameter/quality_feedback_parameter.py b/erpnext/quality_management/doctype/quality_feedback_parameter/quality_feedback_parameter.py
new file mode 100644
index 0000000..d652e8a
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_feedback_parameter/quality_feedback_parameter.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+# import frappe
+from frappe.model.document import Document
+
+class QualityFeedbackParameter(Document):
+ pass
diff --git a/erpnext/quality_management/doctype/customer_feedback_template/__init__.py b/erpnext/quality_management/doctype/quality_feedback_template/__init__.py
similarity index 100%
rename from erpnext/quality_management/doctype/customer_feedback_template/__init__.py
rename to erpnext/quality_management/doctype/quality_feedback_template/__init__.py
diff --git a/erpnext/quality_management/doctype/quality_feedback_template/quality_feedback_template.js b/erpnext/quality_management/doctype/quality_feedback_template/quality_feedback_template.js
new file mode 100644
index 0000000..490eed9
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_feedback_template/quality_feedback_template.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Quality Feedback Template', {
+ // refresh: function(frm) {
+
+ // }
+});
diff --git a/erpnext/quality_management/doctype/quality_feedback_template/quality_feedback_template.json b/erpnext/quality_management/doctype/quality_feedback_template/quality_feedback_template.json
new file mode 100644
index 0000000..31efd04
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_feedback_template/quality_feedback_template.json
@@ -0,0 +1,59 @@
+{
+ "autoname": "format:TMPL-{template}",
+ "creation": "2019-05-26 21:17:24.283061",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "template",
+ "cb_00",
+ "sb_00",
+ "parameters"
+ ],
+ "fields": [
+ {
+ "fieldname": "template",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Template",
+ "reqd": 1
+ },
+ {
+ "fieldname": "cb_00",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "sb_00",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "parameters",
+ "fieldtype": "Table",
+ "label": "Parameters",
+ "options": "Quality Feedback Template Parameter"
+ }
+ ],
+ "modified": "2019-05-26 21:48:47.770610",
+ "modified_by": "Administrator",
+ "module": "Quality Management",
+ "name": "Quality Feedback Template",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "share": 1,
+ "write": 1
+ }
+ ],
+ "quick_entry": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
+}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_feedback_template/quality_feedback_template.py b/erpnext/quality_management/doctype/quality_feedback_template/quality_feedback_template.py
new file mode 100644
index 0000000..0c6dfc0
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_feedback_template/quality_feedback_template.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+# import frappe
+from frappe.model.document import Document
+
+class QualityFeedbackTemplate(Document):
+ pass
diff --git a/erpnext/quality_management/doctype/quality_feedback_template/test_quality_feedback_template.py b/erpnext/quality_management/doctype/quality_feedback_template/test_quality_feedback_template.py
new file mode 100644
index 0000000..36dbe13
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_feedback_template/test_quality_feedback_template.py
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+
+class TestQualityFeedbackTemplate(unittest.TestCase):
+
+ def test_quality_feedback_template(self):
+ test_create_template = create_template()
+ test_get_template = get_template()
+
+ self.assertEqual(test_create_template, test_get_template)
+
+def create_template():
+ template = frappe.get_doc({
+ "doctype": "Quality Feedback Template",
+ "template": "_Test Feedback Template",
+ "parameters": [
+ {
+ "parameter": "Test Parameter"
+ }
+ ]
+ })
+
+ template_exists = frappe.db.exists("Quality Feedback Template", {"template": "_Test Feedback Template"})
+
+ if not template_exists:
+ template.insert()
+ return template.name
+ else:
+ return template_exists
+
+def get_template():
+ return frappe.db.exists("Quality Feedback Template", {"template": "_Test Feedback Template"})
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_action_table/__init__.py b/erpnext/quality_management/doctype/quality_feedback_template_parameter/__init__.py
similarity index 100%
copy from erpnext/quality_management/doctype/quality_action_table/__init__.py
copy to erpnext/quality_management/doctype/quality_feedback_template_parameter/__init__.py
diff --git a/erpnext/quality_management/doctype/quality_feedback_template_parameter/quality_feedback_template_parameter.json b/erpnext/quality_management/doctype/quality_feedback_template_parameter/quality_feedback_template_parameter.json
new file mode 100644
index 0000000..02a9b03
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_feedback_template_parameter/quality_feedback_template_parameter.json
@@ -0,0 +1,28 @@
+{
+ "creation": "2019-05-26 21:20:40.520197",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "parameter"
+ ],
+ "fields": [
+ {
+ "fieldname": "parameter",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Parameter"
+ }
+ ],
+ "istable": 1,
+ "modified": "2019-05-26 21:23:53.574743",
+ "modified_by": "Administrator",
+ "module": "Quality Management",
+ "name": "Quality Feedback Template Parameter",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
+}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_feedback_template_parameter/quality_feedback_template_parameter.py b/erpnext/quality_management/doctype/quality_feedback_template_parameter/quality_feedback_template_parameter.py
new file mode 100644
index 0000000..3f3348f
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_feedback_template_parameter/quality_feedback_template_parameter.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+# import frappe
+from frappe.model.document import Document
+
+class QualityFeedbackTemplateParameter(Document):
+ pass
diff --git a/erpnext/quality_management/doctype/quality_goal/quality_goal.js b/erpnext/quality_management/doctype/quality_goal/quality_goal.js
index 3bb6e12..ff58c5a 100644
--- a/erpnext/quality_management/doctype/quality_goal/quality_goal.js
+++ b/erpnext/quality_management/doctype/quality_goal/quality_goal.js
@@ -2,40 +2,7 @@
// For license information, please see license.txt
frappe.ui.form.on('Quality Goal', {
- onload: function(frm){
- if(frm.doc.measurable == "No"){
- hide_target_unit(frm);
- }
- else{
- show_target_unit(frm);
- }
- },
- revision: function(frm) {
- if(!frm.doc.revised_on){
- frm.set_value("revised_on", frappe.datetime.get_today());
- }
- },
- measurable: function(frm) {
- frm.fields_dict.objective.grid.remove_all();
- if(frm.doc.measurable == "No"){
- hide_target_unit(frm);
- }
- else{
- show_target_unit(frm);
- }
+ refresh: function(frm) {
+ frm.doc.created_by = frappe.session.user;
}
});
-
-function hide_target_unit(frm){
- // hides target and unit columns as the goal cannot be measured in numeric values
- frm.fields_dict.objective.grid.docfields[1].hidden = 1;
- frm.fields_dict.objective.grid.docfields[2].hidden = 1;
- frm.refresh();
-}
-
-function show_target_unit(frm){
- // shows target and unit columns as the goal can be measured in numeric values
- frm.fields_dict.objective.grid.docfields[1].hidden = 0;
- frm.fields_dict.objective.grid.docfields[2].hidden = 0;
- frm.refresh();
-}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_goal/quality_goal.json b/erpnext/quality_management/doctype/quality_goal/quality_goal.json
index 93f1bd1..c326109 100644
--- a/erpnext/quality_management/doctype/quality_goal/quality_goal.json
+++ b/erpnext/quality_management/doctype/quality_goal/quality_goal.json
@@ -1,824 +1,149 @@
{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "format:{goal}",
- "beta": 0,
- "creation": "2018-10-02 12:17:41.727541",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
+ "autoname": "format:GOAL-{goal}",
+ "creation": "2018-10-02 12:17:41.727541",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "goal",
+ "frequency",
+ "created_by",
+ "cb_00",
+ "procedure",
+ "weekday",
+ "quarter",
+ "date",
+ "sb_00",
+ "revision",
+ "cb_01",
+ "revised_on",
+ "sb_01",
+ "objectives"
+ ],
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "goal",
- "fieldtype": "Data",
- "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": "Name",
- "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": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "fieldname": "created_by",
+ "fieldtype": "Link",
+ "label": "Created By",
+ "options": "User",
+ "read_only": 1
+ },
+ {
+ "default": "None",
+ "fieldname": "frequency",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Monitoring Frequency",
+ "options": "None\nDaily\nWeekly\nMonthly\nQuarterly"
+ },
+ {
+ "fieldname": "procedure",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Procedure",
+ "options": "Quality Procedure"
+ },
+ {
+ "depends_on": "eval:doc.frequency == 'Monthly' || doc.frequency == 'Quarterly';",
+ "fieldname": "date",
+ "fieldtype": "Select",
+ "label": "Date",
+ "options": "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30"
+ },
+ {
+ "default": "0",
+ "fieldname": "revision",
+ "fieldtype": "Int",
+ "label": "Revision",
+ "read_only": 1
+ },
+ {
+ "fieldname": "revised_on",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "Revised On",
+ "read_only": 1
+ },
+ {
+ "depends_on": "eval:doc.frequency == 'Weekly';",
+ "fieldname": "weekday",
+ "fieldtype": "Select",
+ "label": "Weekday",
+ "options": "Monday\nTuesday\nWednesday\nThursday\nFriday\nSaturday"
+ },
+ {
+ "fieldname": "cb_00",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "sb_00",
+ "fieldtype": "Section Break",
+ "label": "Revision and Revised On"
+ },
+ {
+ "fieldname": "cb_01",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "sb_01",
+ "fieldtype": "Section Break",
+ "label": "Objectives"
+ },
+ {
+ "fieldname": "objectives",
+ "fieldtype": "Table",
+ "label": "Objectives",
+ "options": "Quality Goal Objective"
+ },
+ {
+ "fieldname": "goal",
+ "fieldtype": "Data",
+ "label": "Goal",
+ "reqd": 1,
"unique": 1
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "created_by",
- "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": "Created By",
- "length": 0,
- "no_copy": 0,
- "options": "User",
- "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": "None",
- "fieldname": "frequency",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Monitoring Frequency",
- "length": 0,
- "no_copy": 0,
- "options": "None\nDaily\nWeekly\nMonthly\nQuarterly\nHalf Yearly\nYearly",
- "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": "January-April-July-October",
- "depends_on": "eval:doc.frequency == 'Quarterly'",
- "fieldname": "quarterly",
- "fieldtype": "Data",
- "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": "Day",
- "length": 0,
- "no_copy": 0,
- "options": "",
- "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": "January-July",
- "depends_on": "eval:doc.frequency == 'Half Yearly'",
- "fieldname": "half",
- "fieldtype": "Data",
- "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": "Day",
- "length": 0,
- "no_copy": 0,
- "options": "",
- "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": "January",
- "depends_on": "eval:doc.frequency == 'Yearly'",
- "fieldname": "yearly",
- "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": "Day",
- "length": 0,
- "no_copy": 0,
- "options": "January\nFebruary\nMarch\nApril\nMay\nJune\nJuly\nAugust\nSeptember\nOctober\nNovember\nDecember",
- "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",
- "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": "procedure",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Procedure",
- "length": 0,
- "no_copy": 0,
- "options": "Quality Procedure",
- "permlevel": 0,
- "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": "scope",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Scope",
- "length": 0,
- "no_copy": 0,
- "options": "Company\nDepartment",
- "permlevel": 0,
- "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,
- "depends_on": "eval:doc.frequency == 'Daily'",
- "fieldname": "daily",
- "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": "Day",
- "length": 0,
- "no_copy": 0,
- "options": "Everyday",
- "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.frequency == 'Weekly'",
- "fieldname": "weekly",
- "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": "Day",
- "length": 0,
- "no_copy": 0,
- "options": "Monday\nTuesday\nWednesday\nThursday\nFriday\nSaturday",
- "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.frequency == 'Quarterly' || doc.frequency == 'Half Yearly' || doc.frequency == 'Yearly' || doc.frequency == 'Monthly'",
- "fieldname": "date",
- "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": "Date",
- "length": 0,
- "no_copy": 0,
- "options": "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30",
- "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.scope == 'Department'",
- "fieldname": "department",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Department",
- "length": 0,
- "no_copy": 0,
- "options": "Department",
- "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_8",
- "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": "Revision and Revised On",
- "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": "revision",
- "fieldtype": "Data",
- "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": "Revision",
- "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_10",
- "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": "revised_on",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Revised On",
- "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": "measurable_section",
- "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": "Measurable Goal",
- "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": "Yes",
- "fieldname": "measurable",
- "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": "Measurable Goal",
- "length": 0,
- "no_copy": 0,
- "options": "Yes\nNo",
- "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_20",
- "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": "Target and Unit are disabled",
- "depends_on": "eval:doc.measurable == 'No'",
- "fieldname": "measurable_display",
- "fieldtype": "Data",
- "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": "Measurable",
- "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": "section_break_11",
- "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": "Goal Objectives",
- "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": "objective",
- "fieldtype": "Table",
- "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": "Objective",
- "length": 0,
- "no_copy": 0,
- "options": "Quality Objective",
- "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
+ "default": "January-April-July-October",
+ "depends_on": "eval:doc.frequency == 'Quarterly';",
+ "fieldname": "quarter",
+ "fieldtype": "Select",
+ "label": "Quarter",
+ "options": "January-April-July-October",
+ "read_only": 1
}
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2018-11-12 14:35:18.498549",
- "modified_by": "Administrator",
- "module": "Quality Management",
- "name": "Quality Goal",
- "name_case": "",
- "owner": "Administrator",
+ ],
+ "modified": "2019-05-28 14:49:12.768863",
+ "modified_by": "Administrator",
+ "module": "Quality Management",
+ "name": "Quality Goal",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "System Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "share": 1,
+ "write": 1
+ },
+ {
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "All",
+ "share": 1,
"write": 1
}
- ],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
+ ],
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_goal/quality_goal.py b/erpnext/quality_management/doctype/quality_goal/quality_goal.py
index 236c72a..4ae015e 100644
--- a/erpnext/quality_management/doctype/quality_goal/quality_goal.py
+++ b/erpnext/quality_management/doctype/quality_goal/quality_goal.py
@@ -3,8 +3,12 @@
# For license information, please see license.txt
from __future__ import unicode_literals
+import frappe
+
from frappe.model.document import Document
class QualityGoal(Document):
- pass
+ def validate(self):
+ self.revision += 1
+ self.revised_on = frappe.utils.today()
diff --git a/erpnext/quality_management/doctype/quality_goal/quality_goal_dashboard.py b/erpnext/quality_management/doctype/quality_goal/quality_goal_dashboard.py
index 0acc1da..22af3c0 100644
--- a/erpnext/quality_management/doctype/quality_goal/quality_goal_dashboard.py
+++ b/erpnext/quality_management/doctype/quality_goal/quality_goal_dashboard.py
@@ -1,16 +1,12 @@
from frappe import _
def get_data():
- return {
- 'fieldname': 'goal',
- 'transactions': [
- {
- 'label': _('Review'),
- 'items': ['Quality Review']
- },
- {
- 'label': _('Action'),
- 'items': ['Quality Action']
- }
- ]
- }
\ No newline at end of file
+ return {
+ 'fieldname': 'goal',
+ 'transactions': [
+ {
+ 'label': _('Review'),
+ 'items': ['Quality Review']
+ }
+ ]
+ }
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_goal/test_quality_goal.py b/erpnext/quality_management/doctype/quality_goal/test_quality_goal.py
index 19512d9..d77187a 100644
--- a/erpnext/quality_management/doctype/quality_goal/test_quality_goal.py
+++ b/erpnext/quality_management/doctype/quality_goal/test_quality_goal.py
@@ -14,33 +14,31 @@
create_unit()
test_create_goal = create_goal()
test_get_goal = get_goal()
+
self.assertEquals(test_create_goal, test_get_goal)
def create_goal():
goal = frappe.get_doc({
"doctype": "Quality Goal",
"goal": "_Test Quality Goal",
- "revision": "1",
- "procedure": "_Test Quality Procedure",
- "frequency": "Daily",
- "measureable": "Yes",
- "objective": [
+ "procedure": "PRC-_Test Quality Procedure",
+ "objectives": [
{
"objective": "_Test Quality Objective",
"target": "4",
- "unit": "_Test UOM"
+ "uom": "_Test UOM"
}
]
})
- goal_exist = frappe.db.exists("Quality Goal", ""+ goal.goal +"")
+ goal_exist = frappe.db.exists("Quality Goal", {"goal": goal.goal})
if not goal_exist:
goal.insert()
- return goal.goal
+ return goal.name
else:
return goal_exist
def get_goal():
- goal = frappe.db.exists("Quality Goal", "_Test Quality Goal")
+ goal = frappe.db.exists("Quality Goal", "GOAL-_Test Quality Goal")
return goal
def create_unit():
@@ -48,6 +46,6 @@
"doctype": "UOM",
"uom_name": "_Test UOM",
})
- unit_exist = frappe.db.exists("UOM", ""+ unit.uom_name +"")
+ unit_exist = frappe.db.exists("UOM", unit.uom_name)
if not unit_exist:
unit.insert()
diff --git a/erpnext/quality_management/doctype/quality_objective/__init__.py b/erpnext/quality_management/doctype/quality_goal_objective/__init__.py
similarity index 100%
rename from erpnext/quality_management/doctype/quality_objective/__init__.py
rename to erpnext/quality_management/doctype/quality_goal_objective/__init__.py
diff --git a/erpnext/quality_management/doctype/quality_goal_objective/quality_goal_objective.json b/erpnext/quality_management/doctype/quality_goal_objective/quality_goal_objective.json
new file mode 100644
index 0000000..e3dbd66
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_goal_objective/quality_goal_objective.json
@@ -0,0 +1,51 @@
+{
+ "autoname": "format:{####}",
+ "creation": "2019-05-26 15:03:43.996455",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "objective",
+ "cb_00",
+ "target",
+ "uom"
+ ],
+ "fields": [
+ {
+ "fetch_from": "goal.objective",
+ "fieldname": "objective",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Objective",
+ "reqd": 1
+ },
+ {
+ "fieldname": "target",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Target"
+ },
+ {
+ "fieldname": "uom",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "UOM",
+ "options": "UOM"
+ },
+ {
+ "fieldname": "cb_00",
+ "fieldtype": "Column Break"
+ }
+ ],
+ "istable": 1,
+ "modified": "2019-05-26 16:12:54.832058",
+ "modified_by": "Administrator",
+ "module": "Quality Management",
+ "name": "Quality Goal Objective",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
+}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_goal_objective/quality_goal_objective.py b/erpnext/quality_management/doctype/quality_goal_objective/quality_goal_objective.py
new file mode 100644
index 0000000..f4bd357
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_goal_objective/quality_goal_objective.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+# import frappe
+from frappe.model.document import Document
+
+class QualityGoalObjective(Document):
+ pass
diff --git a/erpnext/quality_management/doctype/quality_meeting/quality_meeting.json b/erpnext/quality_management/doctype/quality_meeting/quality_meeting.json
index 45183c5..6985632 100644
--- a/erpnext/quality_management/doctype/quality_meeting/quality_meeting.json
+++ b/erpnext/quality_management/doctype/quality_meeting/quality_meeting.json
@@ -1,225 +1,93 @@
{
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "format:QMS-MTN-{date}",
- "beta": 0,
- "creation": "2018-10-15 16:25:41.548432",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
+ "autoname": "format:MTNG-{date}",
+ "creation": "2018-10-15 16:25:41.548432",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "date",
+ "cb_00",
+ "status",
+ "sb_00",
+ "agenda",
+ "sb_01",
+ "minutes"
+ ],
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Meeting Date",
- "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
- },
+ "fieldname": "date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "Date",
+ "read_only": 1
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_2",
- "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
- },
+ "default": "Open",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "label": "Status",
+ "options": "Open\nClose"
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "Open",
- "fieldname": "status",
- "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": "Status",
- "length": 0,
- "no_copy": 0,
- "options": "Open\nClose",
- "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
- },
+ "fieldname": "minutes",
+ "fieldtype": "Table",
+ "label": "Minutes",
+ "options": "Quality Meeting Minutes"
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "minutes_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": "Minutes",
- "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
- },
+ "fieldname": "cb_00",
+ "fieldtype": "Column Break"
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "minutes",
- "fieldtype": "Table",
- "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": "Minutes",
- "length": 0,
- "no_copy": 0,
- "options": "Quality Meeting Table",
- "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
+ "fieldname": "sb_00",
+ "fieldtype": "Section Break",
+ "label": "Agenda"
+ },
+ {
+ "fieldname": "agenda",
+ "fieldtype": "Table",
+ "label": "Agenda",
+ "options": "Quality Meeting Agenda"
+ },
+ {
+ "fieldname": "sb_01",
+ "fieldtype": "Section Break",
+ "label": "Minutes"
}
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2018-10-18 14:44:04.494395",
- "modified_by": "Administrator",
- "module": "Quality Management",
- "name": "Quality Meeting",
- "name_case": "",
- "owner": "Administrator",
+ ],
+ "modified": "2019-05-26 23:12:23.364357",
+ "modified_by": "Administrator",
+ "module": "Quality Management",
+ "name": "Quality Meeting",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "System Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "share": 1,
+ "write": 1
+ },
+ {
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "All",
+ "share": 1,
"write": 1
}
- ],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
+ ],
+ "quick_entry": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_meeting/quality_meeting.py b/erpnext/quality_management/doctype/quality_meeting/quality_meeting.py
index 88653a9..f8de229 100644
--- a/erpnext/quality_management/doctype/quality_meeting/quality_meeting.py
+++ b/erpnext/quality_management/doctype/quality_meeting/quality_meeting.py
@@ -6,13 +6,4 @@
from frappe.model.document import Document
class QualityMeeting(Document):
- def validate(self):
- problem = ''
- for data in self.minutes:
- if data.status == 'Open':
- problem = 'set'
-
- if problem == 'set':
- self.status = 'Open'
- else:
- self.status = 'Close'
\ No newline at end of file
+ pass
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_meeting/test_quality_meeting.py b/erpnext/quality_management/doctype/quality_meeting/test_quality_meeting.py
index b680a1b..e61b5df 100644
--- a/erpnext/quality_management/doctype/quality_meeting/test_quality_meeting.py
+++ b/erpnext/quality_management/doctype/quality_meeting/test_quality_meeting.py
@@ -5,27 +5,41 @@
import frappe
import unittest
+from erpnext.quality_management.doctype.quality_review.test_quality_review import create_review
class TestQualityMeeting(unittest.TestCase):
def test_quality_meeting(self):
+ create_review()
test_create_meeting = create_meeting()
test_get_meeting = get_meeting()
- self.assertEquals(test_create_meeting.name, test_get_meeting.name)
+ self.assertEquals(test_create_meeting, test_get_meeting)
def create_meeting():
meeting = frappe.get_doc({
"doctype": "Quality Meeting",
- "scope": "Company",
- "status": "Close",
- "date": ""+ frappe.as_unicode(frappe.utils.nowdate()) +""
+ "status": "Open",
+ "date": frappe.utils.nowdate(),
+ "agenda": [
+ {
+ "agenda": "Test Agenda"
+ }
+ ],
+ "minutes": [
+ {
+ "document_type": "Quality Review",
+ "document_name": frappe.db.exists("Quality Review", {"goal": "GOAL-_Test Quality Goal"}),
+ "minute": "Test Minute"
+ }
+ ]
})
- meeting_exist = frappe.get_list("Quality Meeting", filters={"date": ""+ meeting.date +""}, fields=["name"], limit=1)
- if len(meeting_exist) == 0:
+ meeting_exist = frappe.db.exists("Quality Meeting", {"date": frappe.utils.nowdate(), "status": "Open"})
+
+ if not meeting_exist:
meeting.insert()
- return meeting
+ return meeting.name
else:
- return meeting_exist[0]
+ return meeting_exist
def get_meeting():
- meeting = frappe.get_list("Quality Meeting", limit=1)
- return meeting[0]
\ No newline at end of file
+ meeting = frappe.db.exists("Quality Meeting", {"date": frappe.utils.nowdate(), "status": "Open"})
+ return meeting
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_meeting_table/__init__.py b/erpnext/quality_management/doctype/quality_meeting_agenda/__init__.py
similarity index 100%
rename from erpnext/quality_management/doctype/quality_meeting_table/__init__.py
rename to erpnext/quality_management/doctype/quality_meeting_agenda/__init__.py
diff --git a/erpnext/quality_management/doctype/quality_meeting_agenda/quality_meeting_agenda.js b/erpnext/quality_management/doctype/quality_meeting_agenda/quality_meeting_agenda.js
new file mode 100644
index 0000000..09989dc
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_meeting_agenda/quality_meeting_agenda.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Quality Meeting Agenda', {
+ // refresh: function(frm) {
+
+ // }
+});
diff --git a/erpnext/quality_management/doctype/quality_meeting_agenda/quality_meeting_agenda.json b/erpnext/quality_management/doctype/quality_meeting_agenda/quality_meeting_agenda.json
new file mode 100644
index 0000000..e53d186
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_meeting_agenda/quality_meeting_agenda.json
@@ -0,0 +1,28 @@
+{
+ "creation": "2019-05-26 20:46:57.999300",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "agenda"
+ ],
+ "fields": [
+ {
+ "fieldname": "agenda",
+ "fieldtype": "Text Editor",
+ "in_list_view": 1,
+ "label": "Agenda"
+ }
+ ],
+ "istable": 1,
+ "modified": "2019-05-26 20:49:01.328146",
+ "modified_by": "Administrator",
+ "module": "Quality Management",
+ "name": "Quality Meeting Agenda",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "sort_field": "modified",
+ "sort_order": "ASC",
+ "track_changes": 1
+}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_meeting_agenda/quality_meeting_agenda.py b/erpnext/quality_management/doctype/quality_meeting_agenda/quality_meeting_agenda.py
new file mode 100644
index 0000000..5d77975
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_meeting_agenda/quality_meeting_agenda.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+# import frappe
+from frappe.model.document import Document
+
+class QualityMeetingAgenda(Document):
+ pass
diff --git a/erpnext/quality_management/doctype/quality_meeting_agenda/test_quality_meeting_agenda.py b/erpnext/quality_management/doctype/quality_meeting_agenda/test_quality_meeting_agenda.py
new file mode 100644
index 0000000..4750cc1
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_meeting_agenda/test_quality_meeting_agenda.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+# import frappe
+import unittest
+
+class TestQualityMeetingAgenda(unittest.TestCase):
+ pass
diff --git a/erpnext/quality_management/doctype/quality_meeting_table/__init__.py b/erpnext/quality_management/doctype/quality_meeting_minutes/__init__.py
similarity index 100%
copy from erpnext/quality_management/doctype/quality_meeting_table/__init__.py
copy to erpnext/quality_management/doctype/quality_meeting_minutes/__init__.py
diff --git a/erpnext/quality_management/doctype/quality_meeting_minutes/quality_meeting_minutes.json b/erpnext/quality_management/doctype/quality_meeting_minutes/quality_meeting_minutes.json
new file mode 100644
index 0000000..3b9133a
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_meeting_minutes/quality_meeting_minutes.json
@@ -0,0 +1,55 @@
+{
+ "creation": "2019-05-26 20:45:26.226428",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "document_type",
+ "cb_00",
+ "document_name",
+ "sb_00",
+ "minute"
+ ],
+ "fields": [
+ {
+ "fieldname": "sb_00",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "minute",
+ "fieldtype": "Text Editor",
+ "in_list_view": 1,
+ "label": "Minute"
+ },
+ {
+ "fieldname": "document_type",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Document Type",
+ "options": "Quality Review\nQuality Action\nQuality Feedback",
+ "reqd": 1
+ },
+ {
+ "fieldname": "cb_00",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "document_name",
+ "fieldtype": "Dynamic Link",
+ "in_list_view": 1,
+ "label": "Document Name",
+ "options": "document_type"
+ }
+ ],
+ "istable": 1,
+ "modified": "2019-05-26 22:00:24.833920",
+ "modified_by": "Administrator",
+ "module": "Quality Management",
+ "name": "Quality Meeting Minutes",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
+}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_meeting_minutes/quality_meeting_minutes.py b/erpnext/quality_management/doctype/quality_meeting_minutes/quality_meeting_minutes.py
new file mode 100644
index 0000000..47b2c95
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_meeting_minutes/quality_meeting_minutes.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+# import frappe
+from frappe.model.document import Document
+
+class QualityMeetingMinutes(Document):
+ pass
diff --git a/erpnext/quality_management/doctype/quality_meeting_table/quality_meeting_table.json b/erpnext/quality_management/doctype/quality_meeting_table/quality_meeting_table.json
deleted file mode 100644
index 8e34a62..0000000
--- a/erpnext/quality_management/doctype/quality_meeting_table/quality_meeting_table.json
+++ /dev/null
@@ -1,175 +0,0 @@
-{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 0,
- "creation": "2018-10-15 16:28:59.840039",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "review",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Review",
- "length": 0,
- "no_copy": 0,
- "options": "Quality Review",
- "permlevel": 0,
- "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": "action",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Action",
- "length": 0,
- "no_copy": 0,
- "options": "Under Review\nPlanned",
- "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": "responsible",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Responsible",
- "length": 0,
- "no_copy": 0,
- "options": "Role",
- "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": "status",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Status",
- "length": 0,
- "no_copy": 0,
- "options": "Open\nClose",
- "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,
- "max_attachments": 0,
- "modified": "2018-11-01 14:34:53.964306",
- "modified_by": "Administrator",
- "module": "Quality Management",
- "name": "Quality Meeting Table",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_meeting_table/quality_meeting_table.py b/erpnext/quality_management/doctype/quality_meeting_table/quality_meeting_table.py
deleted file mode 100644
index 2e39c24..0000000
--- a/erpnext/quality_management/doctype/quality_meeting_table/quality_meeting_table.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-from frappe.model.document import Document
-
-class QualityMeetingTable(Document):
- pass
diff --git a/erpnext/quality_management/doctype/quality_objective/quality_objective.json b/erpnext/quality_management/doctype/quality_objective/quality_objective.json
deleted file mode 100644
index 49ffde9..0000000
--- a/erpnext/quality_management/doctype/quality_objective/quality_objective.json
+++ /dev/null
@@ -1,144 +0,0 @@
-{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "format:{####}",
- "beta": 0,
- "creation": "2018-10-02 16:47:59.600155",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_from": "goal.objective",
- "fieldname": "objective",
- "fieldtype": "Text",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Objective",
- "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": 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,
- "depends_on": "",
- "fieldname": "target",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Target",
- "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": "",
- "fieldname": "unit",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Unit",
- "length": 0,
- "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
- }
- ],
- "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,
- "max_attachments": 0,
- "modified": "2018-11-11 13:31:16.044780",
- "modified_by": "Administrator",
- "module": "Quality Management",
- "name": "Quality Objective",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_objective/quality_objective.py b/erpnext/quality_management/doctype/quality_objective/quality_objective.py
deleted file mode 100644
index 9e6a8fd..0000000
--- a/erpnext/quality_management/doctype/quality_objective/quality_objective.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-from frappe.model.document import Document
-
-class QualityObjective(Document):
- pass
diff --git a/erpnext/quality_management/doctype/quality_procedure/quality_procedure.json b/erpnext/quality_management/doctype/quality_procedure/quality_procedure.json
index 8733c7c..7b241ef 100644
--- a/erpnext/quality_management/doctype/quality_procedure/quality_procedure.json
+++ b/erpnext/quality_management/doctype/quality_procedure/quality_procedure.json
@@ -1,386 +1,106 @@
{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "format:{procedure}",
- "beta": 0,
- "creation": "2018-10-06 00:06:29.756804",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
+ "autoname": "format:PRC-{procedure}",
+ "creation": "2018-10-06 00:06:29.756804",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "procedure",
+ "parent_quality_procedure",
+ "is_group",
+ "sb_00",
+ "processes",
+ "lft",
+ "rgt",
+ "old_parent"
+ ],
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "procedure",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Procedure",
- "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": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
+ "fieldname": "parent_quality_procedure",
+ "fieldtype": "Link",
+ "label": "Parent Procedure",
+ "options": "Quality Procedure",
+ "read_only": 1
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "parent_quality_procedure",
- "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": "Parent Procedure",
- "length": 0,
- "no_copy": 0,
- "options": "Quality Procedure",
- "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
- },
+ "default": "0",
+ "fieldname": "is_group",
+ "fieldtype": "Check",
+ "label": "Is Group",
+ "read_only": 1
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "is_group",
- "fieldtype": "Check",
- "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": "Is Group",
- "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
- },
+ "fieldname": "lft",
+ "fieldtype": "Int",
+ "hidden": 1,
+ "label": "Lft",
+ "read_only": 1
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_2",
- "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
- },
+ "fieldname": "rgt",
+ "fieldtype": "Int",
+ "hidden": 1,
+ "label": "Rgt",
+ "read_only": 1
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "department",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Department",
- "length": 0,
- "no_copy": 0,
- "options": "Department",
- "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
- },
+ "fieldname": "old_parent",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "old_parent",
+ "read_only": 1
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "procedure_steps_section",
- "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": "Procedure Steps",
- "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
- },
+ "fieldname": "sb_00",
+ "fieldtype": "Section Break",
+ "label": "Processes"
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "procedure_step",
- "fieldtype": "Table",
- "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": "Procedure",
- "length": 0,
- "no_copy": 0,
- "options": "Quality Procedure Table",
- "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
- },
+ "fieldname": "processes",
+ "fieldtype": "Table",
+ "label": "Processes",
+ "options": "Quality Procedure Process"
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "lft",
- "fieldtype": "Int",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Lft",
- "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": "rgt",
- "fieldtype": "Int",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Rgt",
- "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": "old_parent",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "old_parent",
- "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
+ "fieldname": "procedure",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Procedure",
+ "reqd": 1
}
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2018-11-12 14:30:19.803693",
- "modified_by": "Administrator",
- "module": "Quality Management",
- "name": "Quality Procedure",
- "name_case": "",
- "owner": "Administrator",
+ ],
+ "modified": "2019-05-26 22:11:53.771428",
+ "modified_by": "Administrator",
+ "module": "Quality Management",
+ "name": "Quality Procedure",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "System Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "share": 1,
+ "write": 1
+ },
+ {
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "All",
+ "share": 1,
"write": 1
}
- ],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
+ ],
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_procedure/quality_procedure.py b/erpnext/quality_management/doctype/quality_procedure/quality_procedure.py
index 126b8c7..52c3320 100644
--- a/erpnext/quality_management/doctype/quality_procedure/quality_procedure.py
+++ b/erpnext/quality_management/doctype/quality_procedure/quality_procedure.py
@@ -11,12 +11,11 @@
nsm_parent_field = 'parent_quality_procedure'
def before_save(self):
- for data in self.procedure_step:
- if data.procedure == 'Procedure' and data.procedure_name:
- data.step = data.procedure_name
- doc = frappe.get_doc("Quality Procedure", data.procedure_name)
- if(doc.parent_quality_procedure):
- frappe.throw(_("'"+ data.procedure_name +"' already has a Parent Procedure '"+ doc.parent_quality_procedure +"'"))
+ for process in self.processes:
+ if process.procedure:
+ doc = frappe.get_doc("Quality Procedure", process.procedure)
+ if doc.parent_quality_procedure:
+ frappe.throw(_("{0} already has a Parent Procedure {1}.".format(process.procedure, doc.parent_quality_procedure)))
self.is_group = 1
def on_update(self):
@@ -28,25 +27,28 @@
def on_trash(self):
if self.parent_quality_procedure:
doc = frappe.get_doc("Quality Procedure", self.parent_quality_procedure)
- for data in doc.procedure_step:
- if data.procedure_name == self.name:
- doc.procedure_step.remove(data)
- doc.save()
+ for process in doc.processes:
+ if process.procedure == self.name:
+ doc.processes.remove(process)
+ doc.save(ignore_permissions=True)
+
flag_is_group = 0
doc.load_from_db()
- for data in doc.procedure_step:
- if data.procedure == "Procedure":
+
+ for process in doc.processes:
+ if process.procedure:
flag_is_group = 1
+
if flag_is_group == 0:
doc.is_group = 0
- doc.save()
+ doc.save(ignore_permissions=True)
def set_parent(self):
- for data in self.procedure_step:
- if data.procedure == 'Procedure' and data.procedure_name:
- doc = frappe.get_doc("Quality Procedure", data.procedure_name)
+ for process in self.processes:
+ if process.procedure:
+ doc = frappe.get_doc("Quality Procedure", process.procedure)
doc.parent_quality_procedure = self.name
- doc.save()
+ doc.save(ignore_permissions=True)
@frappe.whitelist()
def get_children(doctype, parent=None, parent_quality_procedure=None, is_root=False):
@@ -57,8 +59,11 @@
@frappe.whitelist()
def add_node():
from frappe.desk.treeview import make_tree_args
+
args = frappe.form_dict
args = make_tree_args(**args)
+
if args.parent_quality_procedure == 'All Quality Procedures':
args.parent_quality_procedure = None
+
frappe.get_doc(args).insert()
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_procedure/quality_procedure_dashboard.py b/erpnext/quality_management/doctype/quality_procedure/quality_procedure_dashboard.py
index 8eff33c..407028b 100644
--- a/erpnext/quality_management/doctype/quality_procedure/quality_procedure_dashboard.py
+++ b/erpnext/quality_management/doctype/quality_procedure/quality_procedure_dashboard.py
@@ -1,20 +1,20 @@
from frappe import _
def get_data():
- return {
- 'fieldname': 'procedure',
- 'transactions': [
- {
- 'label': _('Goal'),
- 'items': ['Quality Goal']
- },
- {
- 'label': _('Review'),
- 'items': ['Quality Review']
- },
- {
- 'label': _('Action'),
- 'items': ['Quality Action']
- }
- ],
- }
\ No newline at end of file
+ return {
+ 'fieldname': 'procedure',
+ 'transactions': [
+ {
+ 'label': _('Goal'),
+ 'items': ['Quality Goal']
+ },
+ {
+ 'label': _('Review'),
+ 'items': ['Quality Review']
+ },
+ {
+ 'label': _('Action'),
+ 'items': ['Quality Action']
+ }
+ ],
+ }
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_procedure/test_quality_procedure.py b/erpnext/quality_management/doctype/quality_procedure/test_quality_procedure.py
index af7adec..79f8771 100644
--- a/erpnext/quality_management/doctype/quality_procedure/test_quality_procedure.py
+++ b/erpnext/quality_management/doctype/quality_procedure/test_quality_procedure.py
@@ -11,25 +11,26 @@
test_create_procedure = create_procedure()
test_create_nested_procedure = create_nested_procedure()
test_get_procedure, test_get_nested_procedure = get_procedure()
- self.assertEquals(test_create_procedure, test_get_procedure.name)
- self.assertEquals(test_create_nested_procedure, test_get_nested_procedure.name)
- self.assertEquals(test_get_nested_procedure.name, test_get_procedure.parent_quality_procedure)
+
+ self.assertEquals(test_create_procedure, test_get_procedure.get("name"))
+ self.assertEquals(test_create_nested_procedure, test_get_nested_procedure.get("name"))
def create_procedure():
procedure = frappe.get_doc({
"doctype": "Quality Procedure",
"procedure": "_Test Quality Procedure",
- "procedure_step": [
+ "processes": [
{
- "procedure": "Step",
- "step": "_Test Quality Procedure Table",
+ "process_description": "_Test Quality Procedure Table",
}
]
})
- procedure_exist = frappe.db.exists("Quality Procedure",""+ procedure.procedure +"")
+
+ procedure_exist = frappe.db.exists("Quality Procedure", "PRC-_Test Quality Procedure")
+
if not procedure_exist:
procedure.insert()
- return procedure.procedure
+ return procedure.name
else:
return procedure_exist
@@ -37,21 +38,22 @@
nested_procedure = frappe.get_doc({
"doctype": "Quality Procedure",
"procedure": "_Test Nested Quality Procedure",
- "procedure_step": [
+ "processes": [
{
- "procedure": "Procedure",
- "procedure_name": "_Test Quality Procedure",
+ "procedure": "PRC-_Test Quality Procedure"
}
]
})
- nested_procedure_exist = frappe.db.exists("Quality Procedure",""+ nested_procedure.procedure +"")
+
+ nested_procedure_exist = frappe.db.exists("Quality Procedure", "PRC-_Test Nested Quality Procedure")
+
if not nested_procedure_exist:
nested_procedure.insert()
- return nested_procedure.procedure
+ return nested_procedure.name
else:
return nested_procedure_exist
def get_procedure():
- procedure = frappe.get_all("Quality Procedure", filters={"procedure": "_Test Quality Procedure"}, fields=["name", "parent_quality_procedure"], limit=1)
- nested_procedure = frappe.get_all("Quality Procedure", filters={"procedure": "_Test Nested Quality Procedure"}, fields=["name", "parent_quality_procedure"], limit=1)
- return procedure[0], nested_procedure[0]
\ No newline at end of file
+ procedure = frappe.get_doc("Quality Procedure", "PRC-_Test Quality Procedure")
+ nested_procedure = frappe.get_doc("Quality Procedure", "PRC-_Test Nested Quality Procedure")
+ return {"name": procedure.name}, {"name": nested_procedure.name, "parent_quality_procedure": nested_procedure.parent_quality_procedure}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_procedure_table/__init__.py b/erpnext/quality_management/doctype/quality_procedure_process/__init__.py
similarity index 100%
rename from erpnext/quality_management/doctype/quality_procedure_table/__init__.py
rename to erpnext/quality_management/doctype/quality_procedure_process/__init__.py
diff --git a/erpnext/quality_management/doctype/quality_procedure_process/quality_procedure_process.json b/erpnext/quality_management/doctype/quality_procedure_process/quality_procedure_process.json
new file mode 100644
index 0000000..f5c0fbc
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_procedure_process/quality_procedure_process.json
@@ -0,0 +1,36 @@
+{
+ "creation": "2019-05-26 00:10:00.248885",
+ "doctype": "DocType",
+ "engine": "InnoDB",
+ "field_order": [
+ "process_description",
+ "procedure"
+ ],
+ "fields": [
+ {
+ "fieldname": "process_description",
+ "fieldtype": "Text Editor",
+ "in_list_view": 1,
+ "label": "Process Description"
+ },
+ {
+ "description": "Link existing Quality Procedure.",
+ "fieldname": "procedure",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Procedure",
+ "options": "Quality Procedure"
+ }
+ ],
+ "istable": 1,
+ "modified": "2019-05-26 22:05:49.007189",
+ "modified_by": "Administrator",
+ "module": "Quality Management",
+ "name": "Quality Procedure Process",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
+}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_procedure_process/quality_procedure_process.py b/erpnext/quality_management/doctype/quality_procedure_process/quality_procedure_process.py
new file mode 100644
index 0000000..0d9a286
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_procedure_process/quality_procedure_process.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+# import frappe
+from frappe.model.document import Document
+
+class QualityProcedureProcess(Document):
+ pass
diff --git a/erpnext/quality_management/doctype/quality_procedure_table/quality_procedure_table.json b/erpnext/quality_management/doctype/quality_procedure_table/quality_procedure_table.json
deleted file mode 100644
index 965edbc..0000000
--- a/erpnext/quality_management/doctype/quality_procedure_table/quality_procedure_table.json
+++ /dev/null
@@ -1,176 +0,0 @@
-{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 0,
- "creation": "2018-10-17 15:48:57.617831",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 0,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "procedure",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Procedure",
- "length": 0,
- "no_copy": 0,
- "options": "Step\nProcedure",
- "permlevel": 0,
- "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,
- "depends_on": "eval:doc.procedure == \"Procedure\"",
- "fieldname": "procedure_name",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Procedure",
- "length": 0,
- "no_copy": 0,
- "options": "Quality Procedure",
- "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.procedure == \"Step\"",
- "fieldname": "step",
- "fieldtype": "Text",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Step",
- "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": "responsible_individual",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Responsible Individual",
- "length": 0,
- "no_copy": 0,
- "options": "Role",
- "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,
- "max_attachments": 0,
- "modified": "2018-11-01 14:26:33.558345",
- "modified_by": "Administrator",
- "module": "Quality Management",
- "name": "Quality Procedure Table",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_procedure_table/quality_procedure_table.py b/erpnext/quality_management/doctype/quality_procedure_table/quality_procedure_table.py
deleted file mode 100644
index 6fe927a..0000000
--- a/erpnext/quality_management/doctype/quality_procedure_table/quality_procedure_table.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-from frappe.model.document import Document
-
-class QualityProcedureTable(Document):
- pass
diff --git a/erpnext/quality_management/doctype/quality_review/quality_review.js b/erpnext/quality_management/doctype/quality_review/quality_review.js
index 48b5c88..b624581 100644
--- a/erpnext/quality_management/doctype/quality_review/quality_review.js
+++ b/erpnext/quality_management/doctype/quality_review/quality_review.js
@@ -4,69 +4,25 @@
frappe.ui.form.on('Quality Review', {
onload: function(frm){
frm.set_value("date", frappe.datetime.get_today());
- $(".grid-add-row").hide();
- if(frm.doc.measurable == "Yes"){
- show_target_achieved_unit(frm);
- }
- else{
- hide_target_achieved_unit(frm);
- }
- frm.refresh();
},
goal: function(frm) {
- frm.fields_dict.values.grid.remove_all();
- if (frm.doc.goal){
- frappe.call({
- "method": "frappe.client.get",
- args: {
- doctype: "Quality Goal",
- name: frm.doc.goal
- },
- callback: function (data) {
- for (var i = 0; i < data.message.objective.length; i++ ){
- frm.add_child("values");
- frm.fields_dict.values.get_value()[i].objective = data.message.objective[i].objective;
- if(frm.doc.measurable == "Yes"){
- if(i < 1){
- show_target_achieved_unit(frm);
- }
- frm.fields_dict.values.get_value()[i].target = data.message.objective[i].target;
- frm.fields_dict.values.get_value()[i].achieved = 0;
- frm.fields_dict.values.get_value()[i].unit = data.message.objective[i].unit;
- }
- if(frm.doc.measurable == "No"){
- if(i < 1){
- hide_target_achieved_unit(frm);
- }
- frm.fields_dict.values.get_value()[i].yes_no = "No";
- }
- }
- frm.refresh();
+ frappe.call({
+ "method": "frappe.client.get",
+ args: {
+ doctype: "Quality Goal",
+ name: frm.doc.goal
+ },
+ callback: function(data){
+ frm.fields_dict.reviews.grid.remove_all();
+ let objectives = data.message.objectives;
+ for (var i in objectives) {
+ frm.add_child("reviews");
+ frm.fields_dict.reviews.get_value()[i].objective = objectives[i].objective;
+ frm.fields_dict.reviews.get_value()[i].target = objectives[i].target;
+ frm.fields_dict.reviews.get_value()[i].uom = objectives[i].uom;
}
- });
- }
- else{
- frm.doc.procedure = '';
- frm.doc.scope = '';
- frm.doc.action = '';
- frm.doc.measurable = '';
- frm.refresh();
- }
+ frm.refresh();
+ }
+ });
},
-});
-
-function show_target_achieved_unit(frm){
- // shows target, achieved and unit columns as the goal can be measured in numeric values
- frm.fields_dict.values.grid.docfields[1].hidden = 0;
- frm.fields_dict.values.grid.docfields[2].hidden = 0;
- frm.fields_dict.values.grid.docfields[3].hidden = 0;
- frm.fields_dict.values.grid.docfields[4].hidden = 1;
-}
-
-function hide_target_achieved_unit(frm){
- // hides target and unit columns as the goal cannot be measured in numeric values
- frm.fields_dict.values.grid.docfields[1].hidden = 1;
- frm.fields_dict.values.grid.docfields[2].hidden = 1;
- frm.fields_dict.values.grid.docfields[3].hidden = 1;
- frm.fields_dict.values.grid.docfields[4].hidden = 0;
-}
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_review/quality_review.json b/erpnext/quality_management/doctype/quality_review/quality_review.json
index 689c1c5..bd5e935 100644
--- a/erpnext/quality_management/doctype/quality_review/quality_review.json
+++ b/erpnext/quality_management/doctype/quality_review/quality_review.json
@@ -1,424 +1,110 @@
{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "QMS-REV-.#####",
- "beta": 0,
- "creation": "2018-10-02 11:45:16.301955",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
+ "autoname": "format:REV-{#####}",
+ "creation": "2018-10-02 11:45:16.301955",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "goal",
+ "date",
+ "cb_00",
+ "procedure",
+ "status",
+ "sb_00",
+ "reviews",
+ "sb_01",
+ "additional_information"
+ ],
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_from": "",
- "fieldname": "goal",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Quality Goal",
- "length": 0,
- "no_copy": 0,
- "options": "Quality Goal",
- "permlevel": 0,
- "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
- },
+ "fieldname": "date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "Date",
+ "read_only": 1
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Evaluation Date",
- "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
- },
+ "fetch_from": "goal.procedure",
+ "fieldname": "procedure",
+ "fieldtype": "Link",
+ "label": "Procedure",
+ "options": "Quality Procedure",
+ "read_only": 1
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_from": "goal.measurable",
- "fieldname": "measurable",
- "fieldtype": "Data",
- "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": "Measurable Goal",
- "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
- },
+ "fieldname": "additional_information",
+ "fieldtype": "Text",
+ "label": "Additional Information"
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_4",
- "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
- },
+ "fieldname": "cb_00",
+ "fieldtype": "Column Break"
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_from": "goal.procedure",
- "fieldname": "procedure",
- "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": "Procedure",
- "length": 0,
- "no_copy": 0,
- "options": "Quality Procedure",
- "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
- },
+ "fieldname": "sb_00",
+ "fieldtype": "Section Break",
+ "label": "Review"
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_from": "goal.scope",
- "fieldname": "scope",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Scope",
- "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
- },
+ "collapsible": 1,
+ "fieldname": "sb_01",
+ "fieldtype": "Section Break",
+ "label": "Additional Information"
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.scope == 'Department'",
- "fetch_from": "goal.department",
- "fieldname": "department",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Department",
- "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
- },
+ "fieldname": "reviews",
+ "fieldtype": "Table",
+ "label": "Reviews",
+ "options": "Quality Review Objective"
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "values_section",
- "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": "Values",
- "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
- },
+ "default": "Open",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "label": "Status",
+ "options": "Open\nClosed"
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "values",
- "fieldtype": "Table",
- "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": "Values",
- "length": 0,
- "no_copy": 0,
- "options": "Quality Review Table",
- "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": 1,
- "columns": 0,
- "fieldname": "additional_info_section",
- "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": "Additional Information",
- "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": "additional_information",
- "fieldtype": "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": "Additional Information",
- "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
+ "fieldname": "goal",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Goal",
+ "options": "Quality Goal",
+ "reqd": 1
}
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2018-11-12 14:25:02.383387",
- "modified_by": "Administrator",
- "module": "Quality Management",
- "name": "Quality Review",
- "name_case": "",
- "owner": "Administrator",
+ ],
+ "modified": "2019-05-26 23:12:47.302189",
+ "modified_by": "Administrator",
+ "module": "Quality Management",
+ "name": "Quality Review",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "System Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "share": 1,
+ "write": 1
+ },
+ {
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "All",
+ "share": 1,
"write": 1
}
- ],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
+ ],
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_review/quality_review.py b/erpnext/quality_management/doctype/quality_review/quality_review.py
index 8a28335..2bc8867 100644
--- a/erpnext/quality_management/doctype/quality_review/quality_review.py
+++ b/erpnext/quality_management/doctype/quality_review/quality_review.py
@@ -5,63 +5,50 @@
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
-import datetime
+
class QualityReview(Document):
pass
def review():
- now = datetime.datetime.now()
- day = now.day
- day_name = now.strftime("%A")
- month=now.strftime("%B")
+ day = frappe.utils.getdate().day
+ weekday = frappe.utils.getdate().strftime("%A")
+ month = frappe.utils.getdate().strftime("%B")
- for data in frappe.get_all("Quality Goal",fields=['name', 'frequency', 'date', 'weekly', 'measurable']):
- if data.frequency == 'Daily':
- create_review(data.name, data.measurable)
+ for goal in frappe.get_list("Quality Goal", fields=['name', 'frequency', 'date', 'weekday']):
+ if goal.frequency == 'Daily':
+ create_review(goal.name)
- elif data.frequency == 'Weekly':
- if data.weekly == day_name:
- create_review(data.name, data.measurable)
+ elif goal.frequency == 'Weekly' and goal.weekday == weekday:
+ create_review(goal.name)
- elif data.frequency == 'Monthly':
- if data.date == str(day):
- create_review(data.name, data.measurable)
+ elif goal.frequency == 'Monthly' and goal.date == str(day):
+ create_review(goal.name)
- elif data.frequency == 'Quarterly':
- if (month == 'January' or month == 'April' or month == 'July' or month == 'October') and str(day) == data.date:
- create_review(data.name, data.measurable)
+ elif goal.frequency == 'Quarterly' and goal.data == str(day) and get_quarter(month):
+ create_review(goal.name)
- elif data.frequency == 'Half Yearly':
- if (month == 'January' or month == 'July') and str(day) == data.date:
- create_review(data.name, data.measurable)
+def create_review(goal):
+ goal = frappe.get_doc("Quality Goal", goal)
- elif data.frequency == 'Yearly':
- if month == data.yearly and str(day) == data.date:
- create_review(data.name, data.measurable)
-
- else:
- pass
-
-def create_review(name, measurable):
- objectives = frappe.get_all("Quality Objective", filters={'parent': name }, fields=['objective', 'target', 'unit'])
- doc = frappe.get_doc({
+ review = frappe.get_doc({
"doctype": "Quality Review",
- "goal": name,
- "date": frappe.as_unicode(frappe.utils.nowdate()),
- "measurable": measurable,
+ "goal": goal.name,
+ "date": frappe.utils.getdate()
})
- if measurable == 'Yes':
- for objective in objectives:
- doc.append("values",{
- 'objective': objective.objective,
- 'target': objective.target,
- 'achieved': 0,
- 'unit': objective.unit
- })
+
+ for objective in goal.objectives:
+ review.append("reviews",
+ {
+ "objective": objective.objective,
+ "target": objective.target,
+ "uom": objective.uom
+ }
+ )
+
+ review.insert(ignore_permissions=True)
+
+def get_quarter(month):
+ if month in ["January", "April", "July", "October"]:
+ return True
else:
- for objective in objectives:
- doc.append("values",{
- 'objective': objective.objective,
- })
- doc.insert()
- frappe.db.commit()
\ No newline at end of file
+ return False
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_review/quality_review_dashboard.py b/erpnext/quality_management/doctype/quality_review/quality_review_dashboard.py
deleted file mode 100644
index 85e4ccc..0000000
--- a/erpnext/quality_management/doctype/quality_review/quality_review_dashboard.py
+++ /dev/null
@@ -1,16 +0,0 @@
-from frappe import _
-
-def get_data():
- return {
- 'fieldname': 'review',
- 'transactions': [
- {
- 'label': _('Action'),
- 'items': ['Quality Action']
- },
- {
- 'label': _('Meeting'),
- 'items': ['Quality Meeting']
- }
- ],
- }
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_review/test_quality_review.py b/erpnext/quality_management/doctype/quality_review/test_quality_review.py
index 421d20d..8add6db 100644
--- a/erpnext/quality_management/doctype/quality_review/test_quality_review.py
+++ b/erpnext/quality_management/doctype/quality_review/test_quality_review.py
@@ -17,31 +17,30 @@
create_goal()
test_create_review = create_review()
test_get_review = get_review()
- self.assertEquals(test_create_review.name, test_get_review.name)
+ self.assertEquals(test_create_review, test_get_review)
def create_review():
review = frappe.get_doc({
"doctype": "Quality Review",
- "goal": "_Test Quality Goal",
- "procedure": "_Test Quality Procedure",
- "scope": "Company",
- "date": ""+ frappe.utils.nowdate() +"",
- "values": [
+ "goal": "GOAL-_Test Quality Goal",
+ "procedure": "PRC-_Test Quality Procedure",
+ "date": frappe.utils.nowdate(),
+ "reviews": [
{
"objective": "_Test Quality Objective",
"target": "100",
- "achieved": "100",
- "unit": "_Test UOM"
+ "uom": "_Test UOM",
+ "review": "Test Review"
}
]
})
- review_exist = frappe.get_list("Quality Review", filters={"goal": "_Test Quality Goal"}, limit=1)
- if len(review_exist) == 0:
- review.insert()
- return review
+ review_exist = frappe.db.exists("Quality Review", {"goal": "GOAL-_Test Quality Goal"})
+ if not review_exist:
+ review.insert(ignore_permissions=True)
+ return review.name
else:
- return review_exist[0]
+ return review_exist
def get_review():
- review = frappe.get_list("Quality Review", filters={"goal": "_Test Quality Goal"}, limit=1)
- return review[0]
\ No newline at end of file
+ review = frappe.db.exists("Quality Review", {"goal": "GOAL-_Test Quality Goal"})
+ return review
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_objective/__init__.py b/erpnext/quality_management/doctype/quality_review_objective/__init__.py
similarity index 100%
copy from erpnext/quality_management/doctype/quality_objective/__init__.py
copy to erpnext/quality_management/doctype/quality_review_objective/__init__.py
diff --git a/erpnext/quality_management/doctype/quality_review_objective/quality_review_objective.json b/erpnext/quality_management/doctype/quality_review_objective/quality_review_objective.json
new file mode 100644
index 0000000..91f7bc0
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_review_objective/quality_review_objective.json
@@ -0,0 +1,64 @@
+{
+ "creation": "2019-05-26 15:17:44.796958",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "objective",
+ "cb_00",
+ "target",
+ "uom",
+ "sb_00",
+ "review"
+ ],
+ "fields": [
+ {
+ "fieldname": "objective",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Objective",
+ "read_only": 1
+ },
+ {
+ "fieldname": "target",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Target",
+ "read_only": 1
+ },
+ {
+ "fetch_from": "target_unit",
+ "fieldname": "uom",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "UOM",
+ "options": "UOM",
+ "read_only": 1
+ },
+ {
+ "fieldname": "review",
+ "fieldtype": "Text Editor",
+ "in_list_view": 1,
+ "label": "Review"
+ },
+ {
+ "fieldname": "sb_00",
+ "fieldtype": "Section Break",
+ "label": "Review"
+ },
+ {
+ "fieldname": "cb_00",
+ "fieldtype": "Column Break"
+ }
+ ],
+ "istable": 1,
+ "modified": "2019-05-26 16:14:12.586128",
+ "modified_by": "Administrator",
+ "module": "Quality Management",
+ "name": "Quality Review Objective",
+ "owner": "Administrator",
+ "permissions": [],
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
+}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_review_objective/quality_review_objective.py b/erpnext/quality_management/doctype/quality_review_objective/quality_review_objective.py
new file mode 100644
index 0000000..3092a1e
--- /dev/null
+++ b/erpnext/quality_management/doctype/quality_review_objective/quality_review_objective.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+# import frappe
+from frappe.model.document import Document
+
+class QualityReviewObjective(Document):
+ pass
diff --git a/erpnext/quality_management/doctype/quality_review_table/__init__.py b/erpnext/quality_management/doctype/quality_review_table/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/quality_management/doctype/quality_review_table/__init__.py
+++ /dev/null
diff --git a/erpnext/quality_management/doctype/quality_review_table/quality_review_table.json b/erpnext/quality_management/doctype/quality_review_table/quality_review_table.json
deleted file mode 100644
index 442c4c6..0000000
--- a/erpnext/quality_management/doctype/quality_review_table/quality_review_table.json
+++ /dev/null
@@ -1,207 +0,0 @@
-{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 0,
- "creation": "2018-10-09 13:03:37.666929",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "objective",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "objective",
- "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": "target",
- "fieldtype": "Int",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Target",
- "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,
- "default": "",
- "fieldname": "achieved",
- "fieldtype": "Int",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Achieved",
- "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,
- "fetch_from": "target_unit",
- "fieldname": "unit",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Unit",
- "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,
- "default": "",
- "fieldname": "yes_no",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Yes/No",
- "length": 0,
- "no_copy": 0,
- "options": "No\nYes",
- "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,
- "max_attachments": 0,
- "modified": "2018-11-03 11:10:53.818818",
- "modified_by": "Administrator",
- "module": "Quality Management",
- "name": "Quality Review Table",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/quality_review_table/quality_review_table.py b/erpnext/quality_management/doctype/quality_review_table/quality_review_table.py
deleted file mode 100644
index 5760cbc..0000000
--- a/erpnext/quality_management/doctype/quality_review_table/quality_review_table.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-from frappe.model.document import Document
-
-class QualityReviewTable(Document):
- pass
diff --git a/erpnext/regional/report/gstr_1/gstr_1.py b/erpnext/regional/report/gstr_1/gstr_1.py
index 5aa2441..a6de94a 100644
--- a/erpnext/regional/report/gstr_1/gstr_1.py
+++ b/erpnext/regional/report/gstr_1/gstr_1.py
@@ -60,8 +60,11 @@
else:
for inv, items_based_on_rate in self.items_based_on_tax_rate.items():
invoice_details = self.invoices.get(inv)
- for rate, items in items_based_on_rate.items():
- row, taxable_value = self.get_row_data_for_invoice(inv, invoice_details, rate, items)
+ for key, items in items_based_on_rate.items():
+ rate = key[0]
+ account = key[1]
+
+ row, taxable_value = self.get_row_data_for_invoice(inv, invoice_details, rate, account, items)
if self.filters.get("type_of_business") == "CDNR":
row.append("Y" if invoice_details.posting_date <= date(2017, 7, 1) else "N")
@@ -100,7 +103,7 @@
for key, value in iteritems(b2cs_output):
self.data.append(value)
- def get_row_data_for_invoice(self, invoice, invoice_details, tax_rate, items):
+ def get_row_data_for_invoice(self, invoice, invoice_details, tax_rate, account, items):
row = []
for fieldname in self.invoice_fields:
if self.filters.get("type_of_business") == "CDNR" and fieldname == "invoice_value":
@@ -117,8 +120,10 @@
taxable_value = 0
for item_code, net_amount in self.invoice_items.get(invoice).items():
if item_code in items:
- if self.item_tax_rate.get(invoice) and tax_rate == self.item_tax_rate.get(invoice, {}).get(item_code):
- taxable_value += abs(net_amount)
+ if self.item_tax_rate.get(invoice) and self.item_tax_rate.get(invoice, {}).get(item_code):
+ item_tax_rate = self.item_tax_rate.get(invoice, {}).get(item_code)
+ if account in item_tax_rate and tax_rate == item_tax_rate.get(account):
+ taxable_value += abs(net_amount)
elif not self.item_tax_rate.get(invoice):
taxable_value += abs(net_amount)
@@ -207,8 +212,7 @@
item_tax_rate = json.loads(d.item_tax_rate)
if item_tax_rate:
- for account, rate in item_tax_rate.items():
- self.item_tax_rate.setdefault(d.parent, {}).setdefault(d.item_code, rate)
+ self.item_tax_rate.setdefault(d.parent, {}).setdefault(d.item_code, item_tax_rate)
def get_items_based_on_tax_rate(self):
self.tax_details = frappe.db.sql("""
@@ -248,7 +252,7 @@
tax_rate *= 2
rate_based_dict = self.items_based_on_tax_rate\
- .setdefault(parent, {}).setdefault(tax_rate, [])
+ .setdefault(parent, {}).setdefault((tax_rate, account), [])
if item_code not in rate_based_dict:
rate_based_dict.append(item_code)
except ValueError:
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index 5a287b1..fc715c9 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -76,9 +76,8 @@
"is_customer_provided_item",
"customer",
"supplier_details",
+ "manufacturers",
"delivered_by_supplier",
- "manufacturer",
- "manufacturer_part_no",
"column_break2",
"supplier_items",
"foreign_trade_details",
@@ -198,6 +197,7 @@
"search_index": 1
},
{
+ "default": "0",
"fieldname": "is_item_from_hub",
"fieldtype": "Check",
"label": "Is Item from Hub",
@@ -218,11 +218,13 @@
"fieldtype": "Column Break"
},
{
+ "default": "0",
"fieldname": "disabled",
"fieldtype": "Check",
"label": "Disabled"
},
{
+ "default": "0",
"fieldname": "allow_alternative_item",
"fieldtype": "Check",
"label": "Allow Alternative Item"
@@ -263,6 +265,7 @@
"label": "Standard Selling Rate"
},
{
+ "default": "0",
"fieldname": "is_fixed_asset",
"fieldtype": "Check",
"label": "Is Fixed Asset",
@@ -439,6 +442,7 @@
"label": "Serial Nos and Batches"
},
{
+ "default": "0",
"depends_on": "eval:doc.is_stock_item",
"fieldname": "has_batch_no",
"fieldtype": "Check",
@@ -448,6 +452,7 @@
"oldfieldtype": "Select"
},
{
+ "default": "0",
"depends_on": "has_batch_no",
"fieldname": "create_new_batch",
"fieldtype": "Check",
@@ -462,12 +467,14 @@
"translatable": 1
},
{
+ "default": "0",
"depends_on": "has_batch_no",
"fieldname": "has_expiry_date",
"fieldtype": "Check",
"label": "Has Expiry Date"
},
{
+ "default": "0",
"depends_on": "has_batch_no",
"fieldname": "retain_sample",
"fieldtype": "Check",
@@ -485,6 +492,7 @@
"fieldtype": "Column Break"
},
{
+ "default": "0",
"depends_on": "eval:doc.is_stock_item || doc.is_fixed_asset",
"fieldname": "has_serial_no",
"fieldtype": "Check",
@@ -601,6 +609,7 @@
"read_only": 1
},
{
+ "default": "0",
"fieldname": "is_customer_provided_item",
"fieldtype": "Check",
"label": "Is Customer Provided Item"
@@ -619,26 +628,15 @@
"label": "Supplier Details"
},
{
+ "default": "0",
"fieldname": "delivered_by_supplier",
"fieldtype": "Check",
"label": "Delivered by Supplier (Drop Ship)",
"print_hide": 1
},
{
- "fieldname": "manufacturer",
- "fieldtype": "Link",
- "label": "Manufacturer",
- "options": "Manufacturer"
- },
- {
- "fieldname": "manufacturer_part_no",
- "fieldtype": "Data",
- "label": "Manufacturer Part Number"
- },
- {
"fieldname": "column_break2",
"fieldtype": "Column Break",
- "label": "Item Code for Suppliers",
"oldfieldtype": "Column Break",
"width": "50%"
},
@@ -718,6 +716,7 @@
"options": "Account"
},
{
+ "default": "0",
"fieldname": "enable_deferred_revenue",
"fieldtype": "Check",
"label": "Enable Deferred Revenue"
@@ -747,6 +746,7 @@
"options": "Account"
},
{
+ "default": "0",
"fieldname": "enable_deferred_expense",
"fieldtype": "Check",
"label": "Enable Deferred Expense"
@@ -800,6 +800,7 @@
"options": "fa fa-search"
},
{
+ "default": "0",
"fieldname": "inspection_required_before_purchase",
"fieldtype": "Check",
"label": "Inspection Required before Purchase",
@@ -807,6 +808,7 @@
"oldfieldtype": "Select"
},
{
+ "default": "0",
"fieldname": "inspection_required_before_delivery",
"fieldtype": "Check",
"label": "Inspection Required before Delivery"
@@ -840,6 +842,7 @@
"read_only": 1
},
{
+ "default": "0",
"description": "If subcontracted to a vendor",
"fieldname": "is_sub_contracted_item",
"fieldtype": "Check",
@@ -867,6 +870,7 @@
"options": "fa fa-globe"
},
{
+ "default": "0",
"depends_on": "eval:!doc.variant_of",
"fieldname": "show_in_website",
"fieldtype": "Check",
@@ -874,6 +878,7 @@
"search_index": 1
},
{
+ "default": "0",
"depends_on": "variant_of",
"fieldname": "show_variant_in_website",
"fieldtype": "Check",
@@ -1016,6 +1021,12 @@
"fieldtype": "Check",
"label": "Synced With Hub",
"read_only": 1
+ },
+ {
+ "fieldname": "manufacturers",
+ "fieldtype": "Table",
+ "label": "Manufacturers",
+ "options": "Item Manufacturer"
}
],
"has_web_view": 1,
@@ -1023,7 +1034,7 @@
"idx": 2,
"image_field": "image",
"max_attachments": 1,
- "modified": "2019-05-16 09:32:27.056036",
+ "modified": "2019-06-02 04:45:59.911507",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",
diff --git a/erpnext/stock/doctype/item/item_dashboard.py b/erpnext/stock/doctype/item/item_dashboard.py
index 8e4f74d..b3733d3 100644
--- a/erpnext/stock/doctype/item/item_dashboard.py
+++ b/erpnext/stock/doctype/item/item_dashboard.py
@@ -41,7 +41,7 @@
},
{
'label': _('Manufacture'),
- 'items': ['Work Order']
+ 'items': ['Work Order', 'Item Manufacturer']
}
]
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/templates/item.html b/erpnext/stock/doctype/item/templates/item.html
new file mode 100644
index 0000000..db12309
--- /dev/null
+++ b/erpnext/stock/doctype/item/templates/item.html
@@ -0,0 +1,7 @@
+{% extends "templates/web.html" %}
+
+{% block page_content %}
+<h1>{{ title }}</h1>
+{% endblock %}
+
+<!-- this is a sample default web page template -->
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/templates/item_row.html b/erpnext/stock/doctype/item/templates/item_row.html
new file mode 100644
index 0000000..2b99981
--- /dev/null
+++ b/erpnext/stock/doctype/item/templates/item_row.html
@@ -0,0 +1,4 @@
+<div>
+ <a href={{ route }}>{{ title }}</a>
+</div>
+<!-- this is a sample default list template -->
\ No newline at end of file
diff --git a/erpnext/quality_management/doctype/customer_feedback/__init__.py b/erpnext/stock/doctype/item_manufacturer/__init__.py
similarity index 100%
copy from erpnext/quality_management/doctype/customer_feedback/__init__.py
copy to erpnext/stock/doctype/item_manufacturer/__init__.py
diff --git a/erpnext/stock/doctype/item_manufacturer/item_manufacturer.js b/erpnext/stock/doctype/item_manufacturer/item_manufacturer.js
new file mode 100644
index 0000000..a4df923
--- /dev/null
+++ b/erpnext/stock/doctype/item_manufacturer/item_manufacturer.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Item Manufacturer', {
+ // refresh: function(frm) {
+
+ // }
+});
diff --git a/erpnext/stock/doctype/item_manufacturer/item_manufacturer.json b/erpnext/stock/doctype/item_manufacturer/item_manufacturer.json
new file mode 100644
index 0000000..956c92e
--- /dev/null
+++ b/erpnext/stock/doctype/item_manufacturer/item_manufacturer.json
@@ -0,0 +1,105 @@
+{
+ "allow_import": 1,
+ "creation": "2019-06-02 04:41:37.332911",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "item_code",
+ "manufacturer",
+ "manufacturer_part_no",
+ "column_break_3",
+ "item_name",
+ "description"
+ ],
+ "fields": [
+ {
+ "fieldname": "manufacturer",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Manufacturer",
+ "options": "Manufacturer",
+ "reqd": 1
+ },
+ {
+ "fieldname": "manufacturer_part_no",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Manufacturer Part Number",
+ "reqd": 1
+ },
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "label": "Item Code",
+ "options": "Item",
+ "reqd": 1
+ },
+ {
+ "fetch_from": "item_code.item_name",
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "label": "Item Name",
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break_3",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fetch_from": "item_code.description",
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "label": "Description",
+ "read_only": 1
+ }
+ ],
+ "modified": "2019-06-06 19:07:31.175919",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Item Manufacturer",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Stock User",
+ "share": 1,
+ "write": 1
+ },
+ {
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Stock Manager",
+ "share": 1,
+ "write": 1
+ },
+ {
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Item Manager",
+ "share": 1,
+ "write": 1
+ }
+ ],
+ "quick_entry": 1,
+ "sort_field": "modified",
+ "sort_order": "ASC",
+ "title_field": "item_code",
+ "track_changes": 1
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item_manufacturer/item_manufacturer.py b/erpnext/stock/doctype/item_manufacturer/item_manufacturer.py
new file mode 100644
index 0000000..67eab82
--- /dev/null
+++ b/erpnext/stock/doctype/item_manufacturer/item_manufacturer.py
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+
+import frappe
+from frappe import _
+from frappe.model.document import Document
+
+class ItemManufacturer(Document):
+ def validate(self):
+ self.validate_duplicate_entry()
+
+ def validate_duplicate_entry(self):
+ if self.is_new():
+ filters = {
+ 'item_code': self.item_code,
+ 'manufacturer': self.manufacturer,
+ 'manufacturer_part_no': self.manufacturer_part_no
+ }
+
+ if frappe.db.exists("Item Manufacturer", filters):
+ frappe.throw(_("Duplicate entry against the item code {0} and manufacturer {1}")
+ .format(self.item_code, self.manufacturer))
+
+@frappe.whitelist()
+def get_item_manufacturer_part_no(item_code, manufacturer):
+ return frappe.db.get_value("Item Manufacturer",
+ {'item_code': item_code, 'manufacturer': manufacturer}, 'manufacturer_part_no')
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item_manufacturer/test_item_manufacturer.py b/erpnext/stock/doctype/item_manufacturer/test_item_manufacturer.py
new file mode 100644
index 0000000..1cef20c
--- /dev/null
+++ b/erpnext/stock/doctype/item_manufacturer/test_item_manufacturer.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+# import frappe
+import unittest
+
+class TestItemManufacturer(unittest.TestCase):
+ pass
diff --git a/erpnext/stock/doctype/material_request_item/material_request_item.json b/erpnext/stock/doctype/material_request_item/material_request_item.json
index 9f4f14a..795971b 100644
--- a/erpnext/stock/doctype/material_request_item/material_request_item.json
+++ b/erpnext/stock/doctype/material_request_item/material_request_item.json
@@ -15,6 +15,10 @@
"brand",
"image_section",
"image",
+ "manufacture_details",
+ "manufacturer",
+ "column_break_12",
+ "manufacturer_part_no",
"quantity_and_warehouse",
"qty",
"uom",
@@ -378,11 +382,32 @@
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "manufacture_details",
+ "fieldtype": "Section Break",
+ "label": "Manufacture"
+ },
+ {
+ "fieldname": "manufacturer",
+ "fieldtype": "Link",
+ "label": "Manufacturer",
+ "options": "Manufacturer"
+ },
+ {
+ "fieldname": "column_break_12",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "manufacturer_part_no",
+ "fieldtype": "Data",
+ "label": "Manufacturer Part Number",
+ "read_only": 1
}
],
"idx": 1,
"istable": 1,
- "modified": "2019-05-25 22:03:10.517886",
+ "modified": "2019-06-02 06:49:36.493957",
"modified_by": "Administrator",
"module": "Stock",
"name": "Material Request Item",
diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
index 66df86b..bb5cd52 100644
--- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
+++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
@@ -19,6 +19,10 @@
"image_section",
"image",
"image_view",
+ "manufacture_details",
+ "manufacturer",
+ "column_break_16",
+ "manufacturer_part_no",
"received_and_accepted",
"received_qty",
"qty",
@@ -788,11 +792,33 @@
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "manufacture_details",
+ "fieldtype": "Section Break",
+ "label": "Manufacture"
+ },
+ {
+ "fieldname": "manufacturer",
+ "fieldtype": "Link",
+ "label": "Manufacturer",
+ "options": "Manufacturer"
+ },
+ {
+ "fieldname": "column_break_16",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "manufacturer_part_no",
+ "fieldtype": "Data",
+ "label": "Manufacturer Part Number",
+ "read_only": 1
}
],
"idx": 1,
"istable": 1,
- "modified": "2019-06-01 23:25:20.732134",
+ "modified": "2019-06-02 06:37:48.198745",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt Item",
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 4b9cf7b..ceb6207 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -676,35 +676,36 @@
ret = frappe._dict({
'uom' : item.stock_uom,
- 'stock_uom' : item.stock_uom,
+ 'stock_uom' : item.stock_uom,
'description' : item.description,
- 'image' : item.image,
+ 'image' : item.image,
'item_name' : item.item_name,
- 'expense_account' : args.get("expense_account"),
- 'cost_center' : get_default_cost_center(args, item, item_group_defaults, brand_defaults),
- 'qty' : args.get("qty"),
+ 'cost_center' : get_default_cost_center(args, item, item_group_defaults, brand_defaults, self.company),
+ 'qty' : args.get("qty"),
'transfer_qty' : args.get('qty'),
'conversion_factor' : 1,
- 'batch_no' : '',
+ 'batch_no' : '',
'actual_qty' : 0,
'basic_rate' : 0,
- 'serial_no' : '',
+ 'serial_no' : '',
'has_serial_no' : item.has_serial_no,
'has_batch_no' : item.has_batch_no,
'sample_quantity' : item.sample_quantity
})
- for d in [["Account", "expense_account", "default_expense_account"],
- ["Cost Center", "cost_center", "cost_center"]]:
- company = frappe.db.get_value(d[0], ret.get(d[1]), "company")
- if not ret[d[1]] or (company and self.company != company):
- ret[d[1]] = frappe.get_cached_value('Company', self.company, d[2]) if d[2] else None
# update uom
if args.get("uom") and for_update:
ret.update(get_uom_details(args.get('item_code'), args.get('uom'), args.get('qty')))
- if not ret["expense_account"]:
- ret["expense_account"] = frappe.get_cached_value('Company', self.company, "stock_adjustment_account")
+ if self.purpose == 'Material Issue':
+ ret["expense_account"] = (item.get("expense_account") or
+ item_group_defaults.get("expense_account") or
+ frappe.get_cached_value('Company', self.company, "default_expense_account"))
+
+ for company_field, field in {'stock_adjustment_account': 'expense_account',
+ 'cost_center': 'cost_center'}.items():
+ if not ret.get(field):
+ ret[field] = frappe.get_cached_value('Company', self.company, company_field)
args['posting_date'] = self.posting_date
args['posting_time'] = self.posting_time
@@ -1084,8 +1085,7 @@
return item_dict
def add_to_stock_entry_detail(self, item_dict, bom_no=None):
- expense_account, cost_center = frappe.db.get_values("Company", self.company, \
- ["default_expense_account", "cost_center"])[0]
+ cost_center = frappe.db.get_value("Company", self.company, 'cost_center')
for d in item_dict:
stock_uom = item_dict[d].get("stock_uom") or frappe.db.get_value("Item", d, "stock_uom")
@@ -1099,7 +1099,7 @@
se_child.uom = item_dict[d]["uom"] if item_dict[d].get("uom") else stock_uom
se_child.stock_uom = stock_uom
se_child.qty = flt(item_dict[d]["qty"], se_child.precision("qty"))
- se_child.expense_account = item_dict[d].get("expense_account") or expense_account
+ se_child.expense_account = item_dict[d].get("expense_account")
se_child.cost_center = item_dict[d].get("cost_center") or cost_center
se_child.allow_alternative_item = item_dict[d].get("allow_alternative_item", 0)
se_child.subcontracted_item = item_dict[d].get("main_item_code")
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index f694af8..6ec5606 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -14,6 +14,7 @@
from erpnext.stock.doctype.item.item import get_item_defaults, get_uom_conv_factor
from erpnext.setup.doctype.item_group.item_group import get_item_group_defaults
from erpnext.setup.doctype.brand.brand import get_brand_defaults
+from erpnext.stock.doctype.item_manufacturer.item_manufacturer import get_item_manufacturer_part_no
from six import string_types, iteritems
@@ -312,6 +313,14 @@
for fieldname in ("item_name", "item_group", "barcodes", "brand", "stock_uom"):
out[fieldname] = item.get(fieldname)
+ if args.get("manufacturer"):
+ part_no = get_item_manufacturer_part_no(args.get("item_code"), args.get("manufacturer"))
+ if part_no:
+ out["manufacturer_part_no"] = part_no
+ else:
+ out["manufacturer_part_no"] = None
+ out["manufacturer"] = None
+
return out
@frappe.whitelist()
@@ -414,7 +423,7 @@
else:
return None
-def get_default_cost_center(args, item, item_group, brand):
+def get_default_cost_center(args, item, item_group, brand, company=None):
cost_center = None
if args.get('project'):
cost_center = frappe.db.get_value("Project", args.get("project"), "cost_center", cache=True)
@@ -425,7 +434,13 @@
else:
cost_center = item.get('buying_cost_center') or item_group.get('buying_cost_center') or brand.get('buying_cost_center')
- return cost_center or args.get("cost_center")
+ cost_center = cost_center or args.get("cost_center")
+
+ if (company and cost_center
+ and frappe.get_cached_value("Cost Center", cost_center, "company") != company):
+ return None
+
+ return cost_center
def get_default_supplier(args, item, item_group, brand):
return (item.get("default_supplier")
diff --git a/erpnext/www/lms/content.html b/erpnext/www/lms/content.html
index 9b8c45c..5607c08 100644
--- a/erpnext/www/lms/content.html
+++ b/erpnext/www/lms/content.html
@@ -58,7 +58,7 @@
{% macro title() %}
<div class="mb-3">
- <a href="#" class="text-muted">
+ <a href="/lms/course?name={{ course }}&program={{ program }}" class="text-muted">
Back to Course
</a>
</div>
diff --git a/erpnext/www/lms/course.html b/erpnext/www/lms/course.html
index 0bfd059..f2fd936 100644
--- a/erpnext/www/lms/course.html
+++ b/erpnext/www/lms/course.html
@@ -42,10 +42,10 @@
{% if has_access %}
<a href="/lms/topic?program={{ program }}&course={{ course.name }}&topic={{ topic.name }}" class="no-decoration no-underline">
{% else %}
- <div>
+ <a href="/login#login">
{% endif %}
{% if topic.hero_image %}
- <div class="card-hero-img" style="background-image: url({{ topic.hero_image }})"></div>
+ <div class="card-hero-img" style="background-image: url('{{ topic.hero_image }}')"></div>
{% else %}
<div class="card-image-wrapper text-center">
<div class="image-body"><i class="fa fa-picture-o" aria-hidden="true"></i></div>
@@ -81,7 +81,7 @@
</div>
</a>
{% else %}
- </div>
+ </a>
{% endif %}
</div>
</div>
@@ -96,7 +96,7 @@
{{ card(topic) }}
{% endfor %}
{% if topics %}
- {% for n in range(3 - ((topics|length)%3)) %}
+ {% for n in range( (3 - (topics|length)) %3) %}
{{ null_card() }}
{% endfor %}
{% endif %}
diff --git a/erpnext/www/lms/course.py b/erpnext/www/lms/course.py
index e7ed2e3..c18d64e 100644
--- a/erpnext/www/lms/course.py
+++ b/erpnext/www/lms/course.py
@@ -5,9 +5,16 @@
no_cache = 1
def get_context(context):
+ try:
+ program = frappe.form_dict['program']
+ course_name = frappe.form_dict['name']
+ except KeyError:
+ frappe.local.flags.redirect_location = '/lms'
+ raise frappe.Redirect
+
context.education_settings = frappe.get_single("Education Settings")
- course = frappe.get_doc('Course', frappe.form_dict['name'])
- context.program = frappe.form_dict['program']
+ course = frappe.get_doc('Course', course_name)
+ context.program = program
context.course = course
context.topics = course.get_topics()
diff --git a/erpnext/www/lms/index.html b/erpnext/www/lms/index.html
index 7ea39d8..ffb4419 100644
--- a/erpnext/www/lms/index.html
+++ b/erpnext/www/lms/index.html
@@ -45,7 +45,7 @@
<p class='lead'>{{ education_settings.description }}</p>
<p class="mt-4">
{% if frappe.session.user == 'Guest' %}
- <a class="btn btn-primary btn-lg" href="'/login#signup'}}">Start Learning</a>
+ <a class="btn btn-primary btn-lg" href="'/login#signup'">Sign Up</a>
{% endif %}
</p>
</div>
@@ -55,7 +55,7 @@
{{ program_card(program.program, program.has_access) }}
{% endfor %}
{% if featured_programs %}
- {% for n in range(3 - ((featured_programs|length)%3)) %}
+ {% for n in range( (3 - (featured_programs|length)) %3) %}
{{ null_card() }}
{% endfor %}
{% endif %}
diff --git a/erpnext/www/lms/macros/card.html b/erpnext/www/lms/macros/card.html
index f227355..076061d 100644
--- a/erpnext/www/lms/macros/card.html
+++ b/erpnext/www/lms/macros/card.html
@@ -3,7 +3,7 @@
<a href="/lms/program?program={{ program.name }}" class="no-decoration no-underline">
<div class="card h-100">
{% if program.hero_image %}
- <div class="card-hero-img" style="background-image: url({{ program.hero_image }})"></div>
+ <div class="card-hero-img" style="background-image: url('{{ program.hero_image }}')"></div>
{% else %}
<div class="card-image-wrapper text-center">
<div class="image-body"><i class="fa fa-picture-o" aria-hidden="true"></i></div>
@@ -28,7 +28,7 @@
{% macro null_card() %}
<div class="col-sm-4 mb-4 text-left">
- <div class="h-100" style="border: 1px solid rgba(209,216,221,0.5);border-radius: 0.25rem;background-color: rgb(250, 251, 252);">
+ <div class="h-100 d-none d-sm-block" style="border: 1px solid rgba(209,216,221,0.5);border-radius: 0.25rem;background-color: rgb(250, 251, 252);">
</div>
</div>
{% endmacro %}
\ No newline at end of file
diff --git a/erpnext/www/lms/program.html b/erpnext/www/lms/program.html
index d122778..271b781 100644
--- a/erpnext/www/lms/program.html
+++ b/erpnext/www/lms/program.html
@@ -42,7 +42,7 @@
<a href="/lms/course?name={{ course.name }}&program={{ program.name }}" class="no-decoration no-underline">
<div class="card h-100">
{% if course.hero_image %}
- <div class="card-hero-img" style="background-image: url({{ course.hero_image }})"></div>
+ <div class="card-hero-img" style="background-image: url('{{ course.hero_image }}')"></div>
{% else %}
<div class="card-image-wrapper text-center">
<div class="image-body"><i class="fa fa-picture-o" aria-hidden="true"></i></div>
@@ -77,7 +77,7 @@
{{ card(course) }}
{% endfor %}
{% if courses %}
- {% for n in range(3 - ((courses|length)%3)) %}
+ {% for n in range( (3 - (courses|length)) %3) %}
{{ null_card() }}
{% endfor %}
{% endif %}
diff --git a/erpnext/www/lms/program.py b/erpnext/www/lms/program.py
index 1fcb3d3..7badedc 100644
--- a/erpnext/www/lms/program.py
+++ b/erpnext/www/lms/program.py
@@ -6,10 +6,16 @@
no_cache = 1
def get_context(context):
+ try:
+ program = frappe.form_dict['program']
+ except KeyError:
+ frappe.local.flags.redirect_location = '/lms'
+ raise frappe.Redirect
+
context.education_settings = frappe.get_single("Education Settings")
- context.program = get_program(frappe.form_dict['program'])
+ context.program = get_program(program)
context.courses = [frappe.get_doc("Course", course.course) for course in context.program.courses]
- context.has_access = utils.allowed_program_access(frappe.form_dict['program'])
+ context.has_access = utils.allowed_program_access(program)
context.progress = get_course_progress(context.courses, context.program)
def get_program(program_name):
diff --git a/erpnext/www/lms/topic.html b/erpnext/www/lms/topic.html
index 3a77776..1f0d187 100644
--- a/erpnext/www/lms/topic.html
+++ b/erpnext/www/lms/topic.html
@@ -1,5 +1,5 @@
{% extends "templates/base.html" %}
-{% block title %}Topic Title{% endblock %}
+{% block title %}{{ topic.name }}{% endblock %}
{% from "www/lms/macros/hero.html" import hero %}
{% from "www/lms/macros/card.html" import null_card %}
@@ -13,11 +13,11 @@
{% macro card(content, index, length) %}
-<div class="col-sm-{{ 12 if length%3 == 1 and index == 1 else 6 if length%3 == 2 and index in [1,2] else 4}} mb-4 text-left">
+<div class="col-sm-4 mb-4 text-left">
<a href="/lms/content?program={{ program }}&course={{ course }}&topic={{ topic.name }}&type={{ content.content_type }}&content={{ content.content.name }}" class="no-decoration no-underline">
<div class="card h-100">
<div class='card-body'>
- <div>{{ content.content_type or '' }}</div>
+ <div class="text-muted">{{ content.content_type or '' }}</div>
<h5 class='card-title'>{{ content.content.name }}</h5>
</div>
{% if has_access %}
@@ -48,7 +48,7 @@
{{ card(content, loop.index, topic.contents|length) }}
{% endfor %}
{% if contents %}
- {% for n in range(3 - ((contents|length)%3)) %}
+ {% for n in range( (3 - (contents|length)) %3) %}
{{ null_card() }}
{% endfor %}
{% endif %}
diff --git a/erpnext/www/lms/topic.py b/erpnext/www/lms/topic.py
index 0af0778..f75ae8e 100644
--- a/erpnext/www/lms/topic.py
+++ b/erpnext/www/lms/topic.py
@@ -5,9 +5,13 @@
no_cache = 1
def get_context(context):
- course = frappe.form_dict['course']
- program = frappe.form_dict['program']
- topic = frappe.form_dict['topic']
+ try:
+ course = frappe.form_dict['course']
+ program = frappe.form_dict['program']
+ topic = frappe.form_dict['topic']
+ except KeyError:
+ frappe.local.flags.redirect_location = '/lms'
+ raise frappe.Redirect
context.program = program
context.course = course