diff --git a/erpnext/accounts/doctype/budget_detail/budget_detail.json b/erpnext/accounts/doctype/budget_detail/budget_detail.json index d63b0014a4..227e7e1c25 100644 --- a/erpnext/accounts/doctype/budget_detail/budget_detail.json +++ b/erpnext/accounts/doctype/budget_detail/budget_detail.json @@ -1,5 +1,5 @@ { - "autoname": "CBD/.######", + "autoname": "hash", "creation": "2013-03-07 11:55:04", "docstatus": 0, "doctype": "DocType", @@ -44,7 +44,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-05-09 02:12:39.595788", + "modified": "2015-02-19 01:06:59.471417", "modified_by": "Administrator", "module": "Accounts", "name": "Budget Detail", diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py index 49893daa88..fffe420be0 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.py +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py @@ -53,7 +53,7 @@ class GLEntry(Document): def validate_posting_date(self): from erpnext.accounts.utils import validate_fiscal_year - validate_fiscal_year(self.posting_date, self.fiscal_year, "Posting Date") + validate_fiscal_year(self.posting_date, self.fiscal_year, _("Posting Date"), self) def check_pl_account(self): if self.is_opening=='Yes' and \ diff --git a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json index 84a5643ba6..b336d4910c 100644 --- a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json +++ b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json @@ -1,5 +1,5 @@ { - "autoname": "JVD.######", + "autoname": "hash", "creation": "2013-02-22 01:27:39", "docstatus": 0, "doctype": "DocType", @@ -206,7 +206,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-12-25 15:44:03.077639", + "modified": "2015-02-19 01:07:00.388689", "modified_by": "Administrator", "module": "Accounts", "name": "Journal Entry Account", diff --git a/erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.json b/erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.json index aac6a30fa1..eaff49c579 100644 --- a/erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.json +++ b/erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.json @@ -1,5 +1,5 @@ { - "autoname": "BDD/.#####", + "autoname": "hash", "creation": "2013-02-22 01:27:38", "docstatus": 0, "doctype": "DocType", @@ -27,7 +27,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-12-25 15:45:11.173204", + "modified": "2015-02-19 01:07:00.800015", "modified_by": "Administrator", "module": "Accounts", "name": "Monthly Distribution Percentage", 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 2bb3220bf6..33ccb27f9d 100755 --- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json +++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json @@ -1,5 +1,5 @@ { - "autoname": "EVD.######", + "autoname": "hash", "creation": "2013-05-22 12:43:10", "docstatus": 0, "doctype": "DocType", @@ -399,7 +399,7 @@ ], "idx": 1, "istable": 1, - "modified": "2015-01-01 14:29:58.851242", + "modified": "2015-02-19 01:07:01.060411", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice Item", diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.json b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.json index 6079fa28d7..8244d12e61 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.json +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.json @@ -1,164 +1,164 @@ { - "autoname": "PVTD.######", - "creation": "2013-05-21 16:16:04", - "docstatus": 0, - "doctype": "DocType", + "autoname": "hash", + "creation": "2013-05-21 16:16:04", + "docstatus": 0, + "doctype": "DocType", "fields": [ { - "default": "Valuation and Total", - "fieldname": "category", - "fieldtype": "Select", - "in_list_view": 0, - "label": "Consider Tax or Charge for", - "oldfieldname": "category", - "oldfieldtype": "Select", - "options": "Valuation and Total\nValuation\nTotal", - "permlevel": 0, - "read_only": 0, + "default": "Valuation and Total", + "fieldname": "category", + "fieldtype": "Select", + "in_list_view": 0, + "label": "Consider Tax or Charge for", + "oldfieldname": "category", + "oldfieldtype": "Select", + "options": "Valuation and Total\nValuation\nTotal", + "permlevel": 0, + "read_only": 0, "reqd": 1 - }, + }, { - "default": "Add", - "fieldname": "add_deduct_tax", - "fieldtype": "Select", - "label": "Add or Deduct", - "oldfieldname": "add_deduct_tax", - "oldfieldtype": "Select", - "options": "Add\nDeduct", - "permlevel": 0, - "read_only": 0, + "default": "Add", + "fieldname": "add_deduct_tax", + "fieldtype": "Select", + "label": "Add or Deduct", + "oldfieldname": "add_deduct_tax", + "oldfieldtype": "Select", + "options": "Add\nDeduct", + "permlevel": 0, + "read_only": 0, "reqd": 1 - }, + }, { - "fieldname": "charge_type", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Type", - "oldfieldname": "charge_type", - "oldfieldtype": "Select", - "options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total", - "permlevel": 0, - "read_only": 0, + "fieldname": "charge_type", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Type", + "oldfieldname": "charge_type", + "oldfieldtype": "Select", + "options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total", + "permlevel": 0, + "read_only": 0, "reqd": 1 - }, + }, { - "depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1", - "fieldname": "row_id", - "fieldtype": "Data", - "hidden": 0, - "label": "Reference Row #", - "oldfieldname": "row_id", - "oldfieldtype": "Data", - "permlevel": 0, + "depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1", + "fieldname": "row_id", + "fieldtype": "Data", + "hidden": 0, + "label": "Reference Row #", + "oldfieldname": "row_id", + "oldfieldtype": "Data", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "description", - "fieldtype": "Small Text", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Small Text", - "permlevel": 0, - "print_width": "300px", - "read_only": 0, - "reqd": 1, + "fieldname": "description", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_width": "300px", + "read_only": 0, + "reqd": 1, "width": "300px" - }, + }, { - "fieldname": "col_break1", - "fieldtype": "Column Break", + "fieldname": "col_break1", + "fieldtype": "Column Break", "permlevel": 0 - }, + }, { - "fieldname": "account_head", - "fieldtype": "Link", - "in_list_view": 0, - "label": "Account Head", - "oldfieldname": "account_head", - "oldfieldtype": "Link", - "options": "Account", - "permlevel": 0, - "read_only": 0, + "fieldname": "account_head", + "fieldtype": "Link", + "in_list_view": 0, + "label": "Account Head", + "oldfieldname": "account_head", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "read_only": 0, "reqd": 1 - }, + }, { - "default": ":Company", - "fieldname": "cost_center", - "fieldtype": "Link", - "in_list_view": 0, - "label": "Cost Center", - "oldfieldname": "cost_center", - "oldfieldtype": "Link", - "options": "Cost Center", - "permlevel": 0, + "default": ":Company", + "fieldname": "cost_center", + "fieldtype": "Link", + "in_list_view": 0, + "label": "Cost Center", + "oldfieldname": "cost_center", + "oldfieldtype": "Link", + "options": "Cost Center", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "rate", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Rate", - "oldfieldname": "rate", - "oldfieldtype": "Currency", - "permlevel": 0, - "read_only": 0, + "fieldname": "rate", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Rate", + "oldfieldname": "rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 0, "reqd": 0 - }, + }, { - "fieldname": "tax_amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Amount", - "oldfieldname": "tax_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "read_only": 1, + "fieldname": "tax_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "oldfieldname": "tax_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1, "reqd": 0 - }, + }, { - "fieldname": "total", - "fieldtype": "Currency", - "label": "Total", - "oldfieldname": "total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, + "fieldname": "total", + "fieldtype": "Currency", + "label": "Total", + "oldfieldname": "total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, "read_only": 1 - }, + }, { - "fieldname": "item_wise_tax_detail", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Item Wise Tax Detail ", - "oldfieldname": "item_wise_tax_detail", - "oldfieldtype": "Small Text", - "permlevel": 0, - "print_hide": 1, + "fieldname": "item_wise_tax_detail", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Item Wise Tax Detail ", + "oldfieldname": "item_wise_tax_detail", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "fieldname": "parenttype", - "fieldtype": "Data", - "hidden": 1, - "in_filter": 1, - "label": "Parenttype", - "oldfieldname": "parenttype", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, + "fieldname": "parenttype", + "fieldtype": "Data", + "hidden": 1, + "in_filter": 1, + "label": "Parenttype", + "oldfieldname": "parenttype", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, "search_index": 0 } - ], - "hide_heading": 1, - "idx": 1, - "istable": 1, - "modified": "2014-05-30 03:43:32.494112", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Purchase Taxes and Charges", - "owner": "Administrator", + ], + "hide_heading": 1, + "idx": 1, + "istable": 1, + "modified": "2015-02-19 01:07:01.581115", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Purchase Taxes and Charges", + "owner": "Administrator", "permissions": [] -} +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json index ba93b88df4..b87c6322f6 100644 --- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json +++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json @@ -1,5 +1,5 @@ { - "autoname": "INVD.######", + "autoname": "hash", "creation": "2013-06-04 11:02:19", "docstatus": 0, "doctype": "DocType", @@ -439,7 +439,7 @@ ], "idx": 1, "istable": 1, - "modified": "2015-01-01 14:29:59.027192", + "modified": "2015-02-19 01:07:01.862525", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Item", diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.json b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.json index d820c871a5..06c981fe4f 100644 --- a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.json +++ b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.json @@ -1,5 +1,5 @@ { - "autoname": "INVTD.######", + "autoname": "hash", "creation": "2013-04-24 11:39:32", "docstatus": 0, "doctype": "DocType", @@ -147,7 +147,7 @@ "hide_heading": 1, "idx": 1, "istable": 1, - "modified": "2014-12-10 12:26:41.222471", + "modified": "2015-02-19 01:07:02.165094", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Taxes and Charges", diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 415a51a800..b8ffa87670 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -41,10 +41,13 @@ def get_fiscal_years(transaction_date=None, fiscal_year=None, label="Date", verb raise FiscalYearError, error_msg return fy -def validate_fiscal_year(date, fiscal_year, label="Date"): +def validate_fiscal_year(date, fiscal_year, label=_("Date"), doc=None): years = [f[0] for f in get_fiscal_years(date, label=label)] if fiscal_year not in years: - throw(_("{0} '{1}' not in Fiscal Year {2}").format(label, formatdate(date), fiscal_year)) + if doc: + doc.fiscal_year = years[0] + else: + throw(_("{0} '{1}' not in Fiscal Year {2}").format(label, formatdate(date), fiscal_year)) @frappe.whitelist() def get_balance_on(account=None, date=None, party_type=None, party=None): 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 0df7c8b000..b0ba316a40 100755 --- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json +++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json @@ -1,5 +1,5 @@ { - "autoname": "POD/.#####", + "autoname": "hash", "creation": "2013-05-24 19:29:06", "docstatus": 0, "doctype": "DocType", @@ -484,7 +484,7 @@ ], "idx": 1, "istable": 1, - "modified": "2015-02-12 15:11:13.784588", + "modified": "2015-02-19 01:07:01.224244", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order Item", diff --git a/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.json b/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.json index 21712efe21..9618d0425a 100644 --- a/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.json +++ b/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.json @@ -1,6 +1,6 @@ { - "autoname": "QASD/.#####", - "creation": "2013-02-22 01:27:43.000000", + "autoname": "hash", + "creation": "2013-02-22 01:27:43", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -120,9 +120,10 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:39.000000", + "modified": "2015-02-19 01:07:01.658125", "modified_by": "Administrator", "module": "Buying", "name": "Quality Inspection Reading", - "owner": "Administrator" + "owner": "Administrator", + "permissions": [] } \ No newline at end of file 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 08d5871b72..4e736defcf 100644 --- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json +++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json @@ -1,5 +1,5 @@ { - "autoname": "SQI-.#####", + "autoname": "hash", "creation": "2013-05-22 12:43:10", "docstatus": 0, "doctype": "DocType", @@ -360,7 +360,7 @@ ], "idx": 1, "istable": 1, - "modified": "2015-02-12 15:16:13.616428", + "modified": "2015-02-19 01:07:02.403267", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation Item", diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 744a0eb689..c0a63cd9e9 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -69,7 +69,7 @@ class AccountsController(TransactionBase): if date_field and self.get(date_field): validate_fiscal_year(self.get(date_field), self.fiscal_year, - label=self.meta.get_label(date_field)) + self.meta.get_label(date_field), self) def validate_due_date(self): from erpnext.accounts.party import validate_due_date diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py index 39dd61439c..30139c2855 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.py +++ b/erpnext/crm/doctype/opportunity/opportunity.py @@ -29,7 +29,7 @@ class Opportunity(TransactionBase): self.validate_cust_name() from erpnext.accounts.utils import validate_fiscal_year - validate_fiscal_year(self.transaction_date, self.fiscal_year, "Opportunity Date") + validate_fiscal_year(self.transaction_date, self.fiscal_year, _("Opportunity Date"), self) def on_submit(self): if self.lead: @@ -52,11 +52,11 @@ class Opportunity(TransactionBase): def has_quotation(self): return frappe.db.get_value("Quotation Item", {"prevdoc_docname": self.name, "docstatus": 1}) - + def has_ordered_quotation(self): - return frappe.db.sql("""select q.name from `tabQuotation` q, `tabQuotation Item` qi + return frappe.db.sql("""select q.name from `tabQuotation` q, `tabQuotation Item` qi where q.name = qi.parent and q.docstatus=1 and qi.prevdoc_docname =%s and q.status = 'Ordered'""", self.name) - + def validate_cust_name(self): self.customer_name = self.customer or self.lead diff --git a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.json b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.json index a40b2bc57e..6075ea2ad9 100644 --- a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.json +++ b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.json @@ -1,6 +1,6 @@ { - "autoname": "APRSLD.#####", - "creation": "2013-02-22 01:27:44.000000", + "autoname": "hash", + "creation": "2013-02-22 01:27:44", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -59,9 +59,10 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:22:53.000000", + "modified": "2015-02-19 01:06:59.212681", "modified_by": "Administrator", "module": "HR", "name": "Appraisal Goal", - "owner": "ashwini@webnotestech.com" + "owner": "ashwini@webnotestech.com", + "permissions": [] } \ No newline at end of file diff --git a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.json b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.json index f23ec8c00f..12e640d3cb 100644 --- a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.json +++ b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.json @@ -1,6 +1,6 @@ { - "autoname": "KSHEET.#####", - "creation": "2013-02-22 01:27:44.000000", + "autoname": "hash", + "creation": "2013-02-22 01:27:44", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -32,9 +32,10 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:22:54.000000", + "modified": "2015-02-19 01:06:59.356774", "modified_by": "Administrator", "module": "HR", "name": "Appraisal Template Goal", - "owner": "ashwini@webnotestech.com" + "owner": "ashwini@webnotestech.com", + "permissions": [] } \ No newline at end of file diff --git a/erpnext/hr/doctype/attendance/attendance.py b/erpnext/hr/doctype/attendance/attendance.py index dbab09796c..b7034511b5 100644 --- a/erpnext/hr/doctype/attendance/attendance.py +++ b/erpnext/hr/doctype/attendance/attendance.py @@ -29,10 +29,6 @@ class Attendance(Document): frappe.throw(_("Employee {0} was on leave on {1}. Cannot mark attendance.").format(self.employee, self.att_date)) - def validate_fiscal_year(self): - from erpnext.accounts.utils import validate_fiscal_year - validate_fiscal_year(self.att_date, self.fiscal_year) - def validate_att_date(self): if getdate(self.att_date) > getdate(nowdate()): frappe.throw(_("Attendance can not be marked for future dates")) @@ -45,8 +41,9 @@ class Attendance(Document): def validate(self): from erpnext.utilities import validate_status + from erpnext.accounts.utils import validate_fiscal_year validate_status(self.status, ["Present", "Absent", "Half Day"]) - self.validate_fiscal_year() + validate_fiscal_year(self.att_date, self.fiscal_year, _("Attendance Date"), self) self.validate_att_date() self.validate_duplicate_record() self.check_leave_record() diff --git a/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.json b/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.json index 76335fb971..962ad6a907 100644 --- a/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.json +++ b/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.json @@ -1,6 +1,6 @@ { "allow_import": 0, - "autoname": "LAPPR-/.#####", + "autoname": "hash", "creation": "2013-04-12 06:56:15", "description": "Users who can approve a specific employee's leave applications", "docstatus": 0, @@ -21,7 +21,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-08-27 06:21:36.887205", + "modified": "2015-02-19 01:07:00.128600", "modified_by": "Administrator", "module": "HR", "name": "Employee Leave Approver", diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.py b/erpnext/hr/doctype/expense_claim/expense_claim.py index b2b9b95030..5e7e2fc82c 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim.py +++ b/erpnext/hr/doctype/expense_claim/expense_claim.py @@ -7,6 +7,7 @@ from frappe import _ from frappe.utils import get_fullname from frappe.model.document import Document from erpnext.hr.utils import set_employee_name +from erpnext.accounts.utils import validate_fiscal_year class InvalidExpenseApproverError(frappe.ValidationError): pass @@ -16,7 +17,7 @@ class ExpenseClaim(Document): self.employee_name, self.total_claimed_amount) def validate(self): - self.validate_fiscal_year() + validate_fiscal_year(self.posting_date, self.fiscal_year, _("Posting Date"), self) self.validate_exp_details() self.validate_expense_approver() set_employee_name(self) @@ -25,10 +26,6 @@ class ExpenseClaim(Document): if self.approval_status=="Draft": frappe.throw(_("""Approval Status must be 'Approved' or 'Rejected'""")) - def validate_fiscal_year(self): - from erpnext.accounts.utils import validate_fiscal_year - validate_fiscal_year(self.posting_date, self.fiscal_year, "Posting Date") - def validate_exp_details(self): if not self.get('expenses'): frappe.throw(_("Please add expense voucher details")) diff --git a/erpnext/hr/doctype/leave_block_list/leave_block_list.py b/erpnext/hr/doctype/leave_block_list/leave_block_list.py index e9bc6ab7f9..67f498a9d6 100644 --- a/erpnext/hr/doctype/leave_block_list/leave_block_list.py +++ b/erpnext/hr/doctype/leave_block_list/leave_block_list.py @@ -11,41 +11,41 @@ from frappe import _ from frappe.model.document import Document class LeaveBlockList(Document): - + def validate(self): dates = [] for d in self.get("leave_block_list_dates"): # validate fiscal year validate_fiscal_year(d.block_date, self.year, _("Block Date")) - + # date is not repeated if d.block_date in dates: frappe.msgprint(_("Date is repeated") + ":" + d.block_date, raise_exception=1) dates.append(d.block_date) @frappe.whitelist() -def get_applicable_block_dates(from_date, to_date, employee=None, +def get_applicable_block_dates(from_date, to_date, employee=None, company=None, all_lists=False): block_dates = [] for block_list in get_applicable_block_lists(employee, company, all_lists): - block_dates.extend(frappe.db.sql("""select block_date, reason - from `tabLeave Block List Date` where parent=%s - and block_date between %s and %s""", (block_list, from_date, to_date), + block_dates.extend(frappe.db.sql("""select block_date, reason + from `tabLeave Block List Date` where parent=%s + and block_date between %s and %s""", (block_list, from_date, to_date), as_dict=1)) - + return block_dates - + def get_applicable_block_lists(employee=None, company=None, all_lists=False): block_lists = [] - + if not employee: employee = frappe.db.get_value("Employee", {"user_id":frappe.session.user}) if not employee: return [] - + if not company: company = frappe.db.get_value("Employee", employee, "company") - + def add_block_list(block_list): if block_list: if all_lists or not is_user_in_allow_list(block_list): @@ -61,9 +61,9 @@ def get_applicable_block_lists(employee=None, company=None, all_lists=False): for block_list in frappe.db.sql_list("""select name from `tabLeave Block List` where ifnull(applies_to_all_departments,0)=1 and company=%s""", company): add_block_list(block_list) - + return list(set(block_lists)) - + def is_user_in_allow_list(block_list): return frappe.session.user in frappe.db.sql_list("""select allow_user - from `tabLeave Block List Allow` where parent=%s""", block_list) \ No newline at end of file + from `tabLeave Block List Allow` where parent=%s""", block_list) diff --git a/erpnext/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js index 22bddaa69a..2ec74f2437 100644 --- a/erpnext/manufacturing/doctype/bom/bom.js +++ b/erpnext/manufacturing/doctype/bom/bom.js @@ -164,6 +164,8 @@ cur_frm.cscript.validate = function(doc, dt, dn) { frappe.ui.form.on("BOM Operation", "operation", function(frm, cdt, cdn) { var d = locals[cdt][cdn]; + if(!d.operation) return; + frappe.call({ "method": "frappe.client.get", args: { @@ -206,4 +208,4 @@ frappe.ui.form.on("BOM Item", "items_remove", function(frm) { cur_frm.cscript.image = function() { refresh_field("image_view"); -} \ No newline at end of file +} diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 6c50c86d0e..8ff0a835bf 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -14,10 +14,9 @@ class BOM(Document): def autoname(self): last_name = frappe.db.sql("""select max(name) from `tabBOM` - where name like "BOM/%s/%%" """ % cstr(self.item).replace('"', '\\"')) + where name like "BOM/%s/%%" """ % frappe.db.escape(self.item)) if last_name: idx = cint(cstr(last_name[0][0]).split('/')[-1].split('-')[0]) + 1 - else: idx = 1 self.name = 'BOM/' + self.item + ('/%.3i' % idx) diff --git a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.json b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.json index 59ef647bf5..14f091a068 100644 --- a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.json +++ b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.json @@ -1,5 +1,5 @@ { - "autoname": "FBD/.######", + "autoname": "hash", "creation": "2013-03-07 11:42:57", "default_print_format": "Standard", "docstatus": 0, @@ -140,7 +140,7 @@ ], "idx": 1, "istable": 1, - "modified": "2015-02-12 15:16:56.092124", + "modified": "2015-02-19 01:06:59.399382", "modified_by": "Administrator", "module": "Manufacturing", "name": "BOM Explosion Item", diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js index 8ab6237104..f7f3e87df3 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.js +++ b/erpnext/manufacturing/doctype/production_order/production_order.js @@ -1,41 +1,142 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -$.extend(cur_frm.cscript, { - onload: function (doc, dt, dn) { - if (!doc.status) doc.status = 'Draft'; - cfn_set_fields(doc, dt, dn); +frappe.ui.form.on("Production Order", "onload", function(frm) { + if (!frm.doc.status) + frm.doc.status = 'Draft'; - this.frm.add_fetch("sales_order", "delivery_date", "expected_delivery_date"); + frm.add_fetch("sales_order", "delivery_date", "expected_delivery_date"); - if(doc.__islocal) { - cur_frm.set_value({ + if(frm.doc.__islocal) { + frm.set_value({ "actual_start_date": "", "actual_end_date": "" - }); + }); + } + + erpnext.production_order.set_custom_buttons(frm); + erpnext.production_order.setup_company_filter(frm); + erpnext.production_order.setup_bom_filter(frm); +}); + +frappe.ui.form.on("Production Order", "refresh", function(frm) { + erpnext.toggle_naming_series(); + frm.set_intro(""); + erpnext.production_order.set_custom_buttons(frm); + + if (frm.doc.docstatus === 0 && !frm.doc.__islocal) { + frm.set_intro(__("Submit this Production Order for further processing.")); + } +}); + +frappe.ui.form.on("Production Order", "additional_operating_cost", function(frm) { + erpnext.production_order.calculate_total_cost(frm); +}); + +frappe.ui.form.on("Production Order Operation", "workstation", function(frm, cdt, cdn) { + var d = locals[cdt][cdn]; + frappe.call({ + "method": "frappe.client.get", + args: { + doctype: "Workstation", + name: d.workstation + }, + callback: function (data) { + frappe.model.set_value(d.doctype, d.name, "hour_rate", data.message.hour_rate); + erpnext.production_order.calculate_cost(frm.doc); + erpnext.production_order.calculate_total_cost(frm); } - }, + }) +}); - before_submit: function() { - cur_frm.toggle_reqd(["fg_warehouse", "wip_warehouse"], true); - }, +frappe.ui.form.on("Production Order Operation", "time_in_mins", function(frm, cdt, cdn) { + erpnext.production_order.calculate_cost(frm.doc); + erpnext.production_order.calculate_total_cost(frm) +}); - refresh: function(doc, dt, dn) { - this.frm.dashboard.reset(); - erpnext.toggle_naming_series(); - this.frm.set_intro(""); - cfn_set_fields(doc, dt, dn); +erpnext.production_order = { + set_custom_buttons: function(frm) { + var doc = frm.doc; + if (doc.docstatus === 1) { - if (doc.docstatus === 0 && !doc.__islocal) { - this.frm.set_intro(__("Submit this Production Order for further processing.")); - } else if (doc.docstatus === 1) { - var percent = flt(doc.produced_qty) / flt(doc.qty) * 100; - this.frm.dashboard.add_progress(cint(percent) + "% " + __("Complete"), percent); + if (doc.material_transferred_for_qty < doc.qty) { + frm.add_custom_button(__('Transfer Materials for Manufacture'), + cur_frm.cscript['Transfer Raw Materials'], frappe.boot.doctype_icons["Stock Entry"]); + } - if(doc.status === "Stopped") { - this.frm.dashboard.set_headline_alert(__("Stopped"), "alert-danger", "icon-stop"); + if (doc.produced_qty < doc.material_transferred_for_qty) { + frm.add_custom_button(__('Update Finished Goods'), + cur_frm.cscript['Update Finished Goods'], frappe.boot.doctype_icons["Stock Entry"]); + } + + if(doc.status==="Completed") { + frm.add_custom_button(__("Show Stock Entries"), function() { + frappe.route_options = { + production_order: frm.doc.name + } + frappe.set_route("List", "Stock Entry"); + }); + } + + if (doc.status != 'Stopped' && doc.status != 'Completed') { + frm.add_custom_button(__('Stop'), cur_frm.cscript['Stop Production Order'], + "icon-exclamation", "btn-default"); + } else if (doc.status == 'Stopped') { + frm.add_custom_button(__('Unstop'), cur_frm.cscript['Unstop Production Order'], + "icon-check", "btn-default"); } } + + }, + calculate_cost: function(doc) { + if (doc.operations){ + var op = doc.operations; + doc.planned_operating_cost = 0.0; + for(var i=0;i self.qty: - frappe.throw(_("Manufactured quantity {0} cannot be greater than planned quanitity {1} in Production Order {2}").format(produced_qty, self.qty, self.name), StockOverProductionError) + if qty > self.qty: + frappe.throw(_("{0} ({1}) cannot be greater than planned quanitity ({2}) in Production Order {3}").format(\ + self.meta.get_label(fieldname), qty, self.qty, self.name), StockOverProductionError) - self.db_set("produced_qty", produced_qty) + self.db_set(fieldname, qty) def on_submit(self): if not self.wip_warehouse: @@ -223,10 +227,6 @@ class ProductionOrder(Document): def validate_delivery_date(self): if self.docstatus==1: - if self.planned_start_date and self.expected_delivery_date \ - and getdate(self.expected_delivery_date) < getdate(self.planned_start_date): - frappe.throw(_("Expected Delivery Date cannot be greater than Planned Start Date")) - if self.planned_end_date and self.expected_delivery_date \ and getdate(self.expected_delivery_date) < getdate(self.planned_end_date): frappe.msgprint(_("Production might not be able to finish by the Expected Delivery Date.")) @@ -280,12 +280,12 @@ def get_events(start, end, filters=None): if filters[key]: conditions += " and " + key + ' = "' + filters[key].replace('"', '\"') + '"' - data = frappe.db.sql("""select name,production_item, production_start_date, production_end_date + data = frappe.db.sql("""select name, production_item, planned_start_date, planned_end_date from `tabProduction Order` - where ((ifnull(production_start_date, '0000-00-00')!= '0000-00-00') \ - and (production_start_date between %(start)s and %(end)s) \ - or ((ifnull(production_start_date, '0000-00-00')!= '0000-00-00') \ - and production_end_date between %(start)s and %(end)s)) {conditions} + where ((ifnull(planned_start_date, '0000-00-00')!= '0000-00-00') \ + and (planned_start_date between %(start)s and %(end)s) \ + or ((ifnull(planned_start_date, '0000-00-00')!= '0000-00-00') \ + and planned_end_date between %(start)s and %(end)s)) {conditions} """.format(conditions=conditions), { "start": start, "end": end diff --git a/erpnext/manufacturing/doctype/production_order/production_order_calendar.js b/erpnext/manufacturing/doctype/production_order/production_order_calendar.js index 3509d328e4..1310687462 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order_calendar.js +++ b/erpnext/manufacturing/doctype/production_order/production_order_calendar.js @@ -3,10 +3,10 @@ frappe.views.calendar["Production Order"] = { field_map: { - "start": "production_start_date", - "end": "production_end_date", + "start": "planned_start_date", + "end": "planned_end_date", "id": "name", - "title": "production_item", + "title": "name", "allDay": "allDay" }, gantt: true, diff --git a/erpnext/manufacturing/doctype/production_order/production_order_list.js b/erpnext/manufacturing/doctype/production_order/production_order_list.js index b38581ba4f..f08158c13c 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order_list.js +++ b/erpnext/manufacturing/doctype/production_order/production_order_list.js @@ -1,15 +1,18 @@ frappe.listview_settings['Production Order'] = { add_fields: ["bom_no", "status", "sales_order", "qty", "produced_qty", "expected_delivery_date"], - filters: [["status", "!=", "Completed"], ["status", "!=", "Stopped"]], + filters: [["status", "!=", "Stopped"]], get_indicator: function(doc) { - return [__(doc.status), { - "Draft": "red", - "Submitted": "blue", - "Stopped": "red", - "In Process": "orange", - "Completed": "green", - "Cancelled": "darkgrey" - }[doc.status], "status,=," + doc.status]; + if(doc.status==="Submitted") { + return [__("Not Started"), "orange", "status,=,Submitted"]; + } else { + return [__(doc.status), { + "Draft": "red", + "Stopped": "red", + "In Process": "orange", + "Completed": "green", + "Cancelled": "darkgrey" + }[doc.status], "status,=," + doc.status]; + } } }; diff --git a/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.json b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.json index cb5d24f8c9..71349385df 100644 --- a/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.json +++ b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.json @@ -1,6 +1,6 @@ { - "autoname": "PPID/.#####", - "creation": "2013-02-22 01:27:49.000000", + "autoname": "hash", + "creation": "2013-02-22 01:27:49", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -104,9 +104,10 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:25.000000", + "modified": "2015-02-19 01:07:00.936590", "modified_by": "Administrator", "module": "Manufacturing", "name": "Production Plan Item", - "owner": "Administrator" + "owner": "Administrator", + "permissions": [] } \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.json b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.json index 39634feb80..087acdd85d 100644 --- a/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.json +++ b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.json @@ -1,5 +1,5 @@ { - "autoname": "PP/.SO/.#####", + "autoname": "hash", "creation": "2013-02-22 01:27:49", "docstatus": 0, "doctype": "DocType", @@ -59,7 +59,7 @@ ], "idx": 1, "istable": 1, - "modified": "2015-02-17 14:29:14.479541", + "modified": "2015-02-19 01:07:00.991795", "modified_by": "Administrator", "module": "Manufacturing", "name": "Production Plan Sales Order", diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 1c366d2bb0..e444eec4e9 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -118,3 +118,4 @@ erpnext.patches.v5_0.rename_customer_issue erpnext.patches.v5_0.update_material_transfer_for_manufacture erpnext.patches.v5_0.manufacturing_activity_type erpnext.patches.v5_0.update_item_description_and_image +erpnext.patches.v5_0.update_material_transferred_for_qty diff --git a/erpnext/patches/v5_0/new_crm_module.py b/erpnext/patches/v5_0/new_crm_module.py index ecf20e5853..b102261583 100644 --- a/erpnext/patches/v5_0/new_crm_module.py +++ b/erpnext/patches/v5_0/new_crm_module.py @@ -21,4 +21,3 @@ def add_crm_to_user_desktop_items(): user_desktop_items.append("CRM") frappe.db.set_default(key, json.dumps(user_desktop_items), parent=user) - diff --git a/erpnext/patches/v5_0/update_material_transferred_for_qty.py b/erpnext/patches/v5_0/update_material_transferred_for_qty.py new file mode 100644 index 0000000000..45b4889956 --- /dev/null +++ b/erpnext/patches/v5_0/update_material_transferred_for_qty.py @@ -0,0 +1,9 @@ +import frappe + +def execute(): + frappe.reload_doctype("Production Order") + frappe.db.sql("""update `tabProduction Order` set material_transferred_for_qty= + (select sum(fg_completed_qty) from `tabStock Entry` + where docstatus=1 + and production_order=`tabProduction Order`.name + and purpose = "Material Transfer for Manufacture")""") diff --git a/erpnext/projects/doctype/time_log/time_log.js b/erpnext/projects/doctype/time_log/time_log.js index 3e28e7074f..8172650c8e 100644 --- a/erpnext/projects/doctype/time_log/time_log.js +++ b/erpnext/projects/doctype/time_log/time_log.js @@ -22,6 +22,12 @@ frappe.ui.form.on("Time Log", "hours", function(frm) { frm._setting_hours = false; }); +// clear production order if making time log +frappe.ui.form.on("Time Log", "before_save", function(frm) { + frm.doc.production_order && frappe.model.remove_from_locals("Production Order", + frm.doc.production_order); +}); + // set hours if to_time is updated frappe.ui.form.on("Time Log", "to_time", function(frm) { if(frm._setting_hours) return; @@ -69,7 +75,7 @@ $.extend(cur_frm.cscript, { } }); }, - + time_log_for: function(doc) { if (doc.time_log_for == 'Manufacturing') { cur_frm.set_value("activity_type", "Manufacturing") diff --git a/erpnext/projects/doctype/time_log/time_log.json b/erpnext/projects/doctype/time_log/time_log.json index 9dc2d5932b..bc68805580 100644 --- a/erpnext/projects/doctype/time_log/time_log.json +++ b/erpnext/projects/doctype/time_log/time_log.json @@ -16,15 +16,6 @@ "read_only": 0, "reqd": 1 }, - { - "fieldname": "time_log_for", - "fieldtype": "Select", - "label": "Time Log For", - "options": "\nProject\nManufacturing", - "permlevel": 0, - "precision": "", - "reqd": 0 - }, { "fieldname": "from_time", "fieldtype": "Datetime", @@ -51,6 +42,14 @@ "permlevel": 0, "read_only": 0 }, + { + "fieldname": "billable", + "fieldtype": "Check", + "in_list_view": 0, + "label": "Billable", + "permlevel": 0, + "read_only": 0 + }, { "fieldname": "column_break_3", "fieldtype": "Column Break", @@ -67,6 +66,15 @@ "read_only": 1, "reqd": 0 }, + { + "fieldname": "time_log_for", + "fieldtype": "Select", + "label": "Time Log For", + "options": "\nProject\nManufacturing", + "permlevel": 0, + "precision": "", + "reqd": 0 + }, { "depends_on": "", "fieldname": "activity_type", @@ -87,6 +95,13 @@ "permlevel": 0, "read_only": 0 }, + { + "depends_on": "eval:doc.time_log_for == 'Manufacturing'", + "fieldname": "section_break_11", + "fieldtype": "Section Break", + "permlevel": 0, + "precision": "" + }, { "depends_on": "eval:doc.time_log_for == 'Manufacturing'", "fieldname": "production_order", @@ -105,6 +120,12 @@ "permlevel": 0, "precision": "" }, + { + "fieldname": "column_break_14", + "fieldtype": "Column Break", + "permlevel": 0, + "precision": "" + }, { "depends_on": "eval:doc.time_log_for == 'Manufacturing'", "fieldname": "workstation", @@ -116,6 +137,7 @@ "read_only": 1 }, { + "depends_on": "eval:doc.time_log_for == 'Manufacturing'", "description": "Operation completed for how many finished goods?", "fieldname": "completed_qty", "fieldtype": "Float", @@ -123,14 +145,6 @@ "permlevel": 0, "precision": "" }, - { - "fieldname": "billable", - "fieldtype": "Check", - "in_list_view": 0, - "label": "Billable", - "permlevel": 0, - "read_only": 0 - }, { "fieldname": "section_break_7", "fieldtype": "Section Break", @@ -199,7 +213,7 @@ "icon": "icon-time", "idx": 1, "is_submittable": 1, - "modified": "2015-02-05 05:11:48.252723", + "modified": "2015-02-19 04:16:33.756377", "modified_by": "Administrator", "module": "Projects", "name": "Time Log", diff --git a/erpnext/selling/doctype/installation_note/installation_note.py b/erpnext/selling/doctype/installation_note/installation_note.py index 4aba9ab653..fb6e9b663c 100644 --- a/erpnext/selling/doctype/installation_note/installation_note.py +++ b/erpnext/selling/doctype/installation_note/installation_note.py @@ -10,6 +10,7 @@ from frappe import _ from erpnext.stock.utils import get_valid_serial_nos from erpnext.utilities.transaction_base import TransactionBase +from erpnext.accounts.utils import validate_fiscal_year class InstallationNote(TransactionBase): def __init__(self, arg1, arg2=None): @@ -30,17 +31,13 @@ class InstallationNote(TransactionBase): }] def validate(self): - self.validate_fiscal_year() + validate_fiscal_year(self.inst_date, self.fiscal_year, _("Installation Date"), self) self.validate_installation_date() self.check_item_table() from erpnext.controllers.selling_controller import check_active_sales_items check_active_sales_items(self) - def validate_fiscal_year(self): - from erpnext.accounts.utils import validate_fiscal_year - validate_fiscal_year(self.inst_date, self.fiscal_year, "Installation Date") - def is_serial_no_added(self, item_code, serial_no): ar_required = frappe.db.get_value("Item", item_code, "has_serial_no") if ar_required == 'Yes' and not serial_no: diff --git a/erpnext/selling/doctype/installation_note_item/installation_note_item.json b/erpnext/selling/doctype/installation_note_item/installation_note_item.json index 0e94d10013..36c3358bd5 100644 --- a/erpnext/selling/doctype/installation_note_item/installation_note_item.json +++ b/erpnext/selling/doctype/installation_note_item/installation_note_item.json @@ -1,6 +1,6 @@ { - "autoname": "IID/.#####", - "creation": "2013-02-22 01:27:51.000000", + "autoname": "hash", + "creation": "2013-02-22 01:27:51", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -100,9 +100,10 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:14.000000", + "modified": "2015-02-19 01:07:00.200686", "modified_by": "Administrator", "module": "Selling", "name": "Installation Note Item", - "owner": "Administrator" + "owner": "Administrator", + "permissions": [] } \ No newline at end of file diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.json b/erpnext/selling/doctype/quotation_item/quotation_item.json index 401842e039..23b0b18591 100644 --- a/erpnext/selling/doctype/quotation_item/quotation_item.json +++ b/erpnext/selling/doctype/quotation_item/quotation_item.json @@ -1,5 +1,5 @@ { - "autoname": "QUOD/.#####", + "autoname": "hash", "creation": "2013-03-07 11:42:57", "docstatus": 0, "doctype": "DocType", @@ -349,7 +349,7 @@ ], "idx": 1, "istable": 1, - "modified": "2015-02-12 15:18:41.236797", + "modified": "2015-02-19 01:07:01.742936", "modified_by": "Administrator", "module": "Selling", "name": "Quotation Item", diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.json b/erpnext/selling/doctype/sales_order_item/sales_order_item.json index 853a7a314b..131ec4db7e 100644 --- a/erpnext/selling/doctype/sales_order_item/sales_order_item.json +++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.json @@ -1,455 +1,455 @@ { - "autoname": "SOD/.#####", - "creation": "2013-03-07 11:42:58", - "docstatus": 0, - "doctype": "DocType", + "autoname": "hash", + "creation": "2013-03-07 11:42:58", + "docstatus": 0, + "doctype": "DocType", "fields": [ { - "fieldname": "item_code", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "permlevel": 0, - "print_width": "150px", - "read_only": 0, - "reqd": 1, - "search_index": 1, + "fieldname": "item_code", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "print_width": "150px", + "read_only": 0, + "reqd": 1, + "search_index": 1, "width": "150px" - }, + }, { - "fieldname": "customer_item_code", - "fieldtype": "Data", - "hidden": 1, - "label": "Customer's Item Code", - "permlevel": 0, - "print_hide": 1, + "fieldname": "customer_item_code", + "fieldtype": "Data", + "hidden": 1, + "label": "Customer's Item Code", + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "fieldname": "col_break1", - "fieldtype": "Column Break", + "fieldname": "col_break1", + "fieldtype": "Column Break", "permlevel": 0 - }, + }, { - "fieldname": "item_name", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Item Name", - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 1, - "print_width": "150", - "read_only": 0, - "reqd": 1, + "fieldname": "item_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Item Name", + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "150", + "read_only": 0, + "reqd": 1, "width": "150" - }, + }, { - "fieldname": "section_break_5", - "fieldtype": "Section Break", - "permlevel": 0, + "fieldname": "section_break_5", + "fieldtype": "Section Break", + "permlevel": 0, "precision": "" - }, + }, { - "fieldname": "description", - "fieldtype": "Small Text", - "in_filter": 1, - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Small Text", - "permlevel": 0, - "print_width": "300px", - "read_only": 0, - "reqd": 1, - "search_index": 1, + "fieldname": "description", + "fieldtype": "Small Text", + "in_filter": 1, + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_width": "300px", + "read_only": 0, + "reqd": 1, + "search_index": 1, "width": "300px" - }, + }, { - "fieldname": "column_break_7", - "fieldtype": "Column Break", - "permlevel": 0, + "fieldname": "column_break_7", + "fieldtype": "Column Break", + "permlevel": 0, "precision": "" - }, + }, { - "fieldname": "image", - "fieldtype": "Attach", - "hidden": 1, - "label": "Image", - "permlevel": 0, - "precision": "", + "fieldname": "image", + "fieldtype": "Attach", + "hidden": 1, + "label": "Image", + "permlevel": 0, + "precision": "", "print_hide": 1 - }, + }, { - "fieldname": "image_view", - "fieldtype": "Image", - "label": "Image View", - "options": "image", - "permlevel": 0, + "fieldname": "image_view", + "fieldtype": "Image", + "label": "Image View", + "options": "image", + "permlevel": 0, "precision": "" - }, + }, { - "fieldname": "quantity_and_rate", - "fieldtype": "Section Break", - "label": "Quantity and Rate", + "fieldname": "quantity_and_rate", + "fieldtype": "Section Break", + "label": "Quantity and Rate", "permlevel": 0 - }, + }, { - "fieldname": "qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Quantity", - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_width": "100px", - "read_only": 0, - "reqd": 1, + "fieldname": "qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Quantity", + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_width": "100px", + "read_only": 0, + "reqd": 1, "width": "100px" - }, + }, { - "fieldname": "price_list_rate", - "fieldtype": "Currency", - "label": "Price List Rate", - "oldfieldname": "ref_rate", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "70px", - "read_only": 1, - "reqd": 0, + "fieldname": "price_list_rate", + "fieldtype": "Currency", + "label": "Price List Rate", + "oldfieldname": "ref_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "70px", + "read_only": 1, + "reqd": 0, "width": "70px" - }, + }, { - "fieldname": "discount_percentage", - "fieldtype": "Percent", - "in_list_view": 1, - "label": "Discount(%)", - "oldfieldname": "adj_rate", - "oldfieldtype": "Float", - "permlevel": 0, - "print_hide": 1, - "print_width": "70px", - "read_only": 0, + "fieldname": "discount_percentage", + "fieldtype": "Percent", + "in_list_view": 1, + "label": "Discount(%)", + "oldfieldname": "adj_rate", + "oldfieldtype": "Float", + "permlevel": 0, + "print_hide": 1, + "print_width": "70px", + "read_only": 0, "width": "70px" - }, + }, { - "fieldname": "col_break2", - "fieldtype": "Column Break", + "fieldname": "col_break2", + "fieldtype": "Column Break", "permlevel": 0 - }, + }, { - "fieldname": "stock_uom", - "fieldtype": "Link", - "hidden": 0, - "in_list_view": 1, - "label": "UOM", - "oldfieldname": "stock_uom", - "oldfieldtype": "Data", - "options": "UOM", - "permlevel": 0, - "print_width": "70px", - "read_only": 1, - "reqd": 0, + "fieldname": "stock_uom", + "fieldtype": "Link", + "hidden": 0, + "in_list_view": 1, + "label": "UOM", + "oldfieldname": "stock_uom", + "oldfieldtype": "Data", + "options": "UOM", + "permlevel": 0, + "print_width": "70px", + "read_only": 1, + "reqd": 0, "width": "70px" - }, + }, { - "fieldname": "base_price_list_rate", - "fieldtype": "Currency", - "label": "Price List Rate (Company Currency)", - "oldfieldname": "base_ref_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "100px", - "read_only": 1, + "fieldname": "base_price_list_rate", + "fieldtype": "Currency", + "label": "Price List Rate (Company Currency)", + "oldfieldname": "base_ref_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, "width": "100px" - }, + }, { - "fieldname": "section_break_simple1", - "fieldtype": "Section Break", + "fieldname": "section_break_simple1", + "fieldtype": "Section Break", "permlevel": 0 - }, + }, { - "fieldname": "rate", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Rate", - "oldfieldname": "export_rate", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_width": "100px", - "read_only": 0, - "reqd": 0, + "fieldname": "rate", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Rate", + "oldfieldname": "export_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_width": "100px", + "read_only": 0, + "reqd": 0, "width": "100px" - }, + }, { - "fieldname": "amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Amount", - "no_copy": 0, - "oldfieldname": "export_amount", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_width": "100px", - "read_only": 1, - "reqd": 0, + "fieldname": "amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "no_copy": 0, + "oldfieldname": "export_amount", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_width": "100px", + "read_only": 1, + "reqd": 0, "width": "100px" - }, + }, { - "fieldname": "col_break3", - "fieldtype": "Column Break", + "fieldname": "col_break3", + "fieldtype": "Column Break", "permlevel": 0 - }, + }, { - "fieldname": "base_rate", - "fieldtype": "Currency", - "label": "Basic Rate (Company Currency)", - "oldfieldname": "basic_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "reqd": 0, + "fieldname": "base_rate", + "fieldtype": "Currency", + "label": "Basic Rate (Company Currency)", + "oldfieldname": "basic_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "reqd": 0, "width": "100px" - }, + }, { - "fieldname": "base_amount", - "fieldtype": "Currency", - "label": "Amount (Company Currency)", - "no_copy": 0, - "oldfieldname": "amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "reqd": 0, + "fieldname": "base_amount", + "fieldtype": "Currency", + "label": "Amount (Company Currency)", + "no_copy": 0, + "oldfieldname": "amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "reqd": 0, "width": "100px" - }, + }, { - "fieldname": "pricing_rule", - "fieldtype": "Link", - "label": "Pricing Rule", - "options": "Pricing Rule", - "permlevel": 0, + "fieldname": "pricing_rule", + "fieldtype": "Link", + "label": "Pricing Rule", + "options": "Pricing Rule", + "permlevel": 0, "read_only": 1 - }, + }, { - "fieldname": "warehouse_and_reference", - "fieldtype": "Section Break", - "label": "Warehouse and Reference", + "fieldname": "warehouse_and_reference", + "fieldtype": "Section Break", + "label": "Warehouse and Reference", "permlevel": 0 - }, + }, { - "fieldname": "warehouse", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Reserved Warehouse", - "no_copy": 0, - "oldfieldname": "reserved_warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "permlevel": 0, - "print_hide": 1, - "print_width": "150px", - "read_only": 0, - "reqd": 0, + "fieldname": "warehouse", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Reserved Warehouse", + "no_copy": 0, + "oldfieldname": "reserved_warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 0, + "reqd": 0, "width": "150px" - }, + }, { - "fieldname": "prevdoc_docname", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "label": "Quotation", - "no_copy": 1, - "oldfieldname": "prevdoc_docname", - "oldfieldtype": "Link", - "options": "Quotation", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, + "fieldname": "prevdoc_docname", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "label": "Quotation", + "no_copy": 1, + "oldfieldname": "prevdoc_docname", + "oldfieldtype": "Link", + "options": "Quotation", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, "search_index": 1 - }, + }, { - "fieldname": "brand", - "fieldtype": "Link", - "hidden": 1, - "in_filter": 1, - "label": "Brand Name", - "oldfieldname": "brand", - "oldfieldtype": "Link", - "options": "Brand", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, + "fieldname": "brand", + "fieldtype": "Link", + "hidden": 1, + "in_filter": 1, + "label": "Brand Name", + "oldfieldname": "brand", + "oldfieldtype": "Link", + "options": "Brand", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, "search_index": 1 - }, + }, { - "description": "", - "fieldname": "item_group", - "fieldtype": "Link", - "hidden": 1, - "in_filter": 1, - "label": "Item Group", - "oldfieldname": "item_group", - "oldfieldtype": "Link", - "options": "Item Group", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, + "description": "", + "fieldname": "item_group", + "fieldtype": "Link", + "hidden": 1, + "in_filter": 1, + "label": "Item Group", + "oldfieldname": "item_group", + "oldfieldtype": "Link", + "options": "Item Group", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, "search_index": 1 - }, + }, { - "allow_on_submit": 1, - "fieldname": "page_break", - "fieldtype": "Check", - "label": "Page Break", - "oldfieldname": "page_break", - "oldfieldtype": "Check", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, + "allow_on_submit": 1, + "fieldname": "page_break", + "fieldtype": "Check", + "label": "Page Break", + "oldfieldname": "page_break", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, "report_hide": 1 - }, + }, { - "fieldname": "col_break4", - "fieldtype": "Column Break", + "fieldname": "col_break4", + "fieldtype": "Column Break", "permlevel": 0 - }, + }, { - "allow_on_submit": 1, - "fieldname": "projected_qty", - "fieldtype": "Float", - "hidden": 0, - "label": "Projected Qty", - "no_copy": 1, - "oldfieldname": "projected_qty", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "70px", - "read_only": 1, + "allow_on_submit": 1, + "fieldname": "projected_qty", + "fieldtype": "Float", + "hidden": 0, + "label": "Projected Qty", + "no_copy": 1, + "oldfieldname": "projected_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "70px", + "read_only": 1, "width": "70px" - }, + }, { - "allow_on_submit": 1, - "fieldname": "actual_qty", - "fieldtype": "Float", - "label": "Actual Qty", - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "print_width": "70px", - "read_only": 1, + "allow_on_submit": 1, + "fieldname": "actual_qty", + "fieldtype": "Float", + "label": "Actual Qty", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "print_width": "70px", + "read_only": 1, "width": "70px" - }, + }, { - "fieldname": "delivered_qty", - "fieldtype": "Float", - "hidden": 0, - "in_filter": 0, - "label": "Delivered Qty", - "no_copy": 1, - "oldfieldname": "delivered_qty", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "search_index": 0, + "fieldname": "delivered_qty", + "fieldtype": "Float", + "hidden": 0, + "in_filter": 0, + "label": "Delivered Qty", + "no_copy": 1, + "oldfieldname": "delivered_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "search_index": 0, "width": "100px" - }, + }, { - "fieldname": "billed_amt", - "fieldtype": "Currency", - "label": "Billed Amt", - "no_copy": 1, - "options": "currency", - "permlevel": 0, - "print_hide": 1, + "fieldname": "billed_amt", + "fieldtype": "Currency", + "label": "Billed Amt", + "no_copy": 1, + "options": "currency", + "permlevel": 0, + "print_hide": 1, "read_only": 1 - }, + }, { - "description": "For Production", - "fieldname": "planned_qty", - "fieldtype": "Float", - "hidden": 1, - "label": "Planned Quantity", - "no_copy": 1, - "oldfieldname": "planned_qty", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "50px", - "read_only": 1, - "report_hide": 1, + "description": "For Production", + "fieldname": "planned_qty", + "fieldtype": "Float", + "hidden": 1, + "label": "Planned Quantity", + "no_copy": 1, + "oldfieldname": "planned_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "50px", + "read_only": 1, + "report_hide": 1, "width": "50px" - }, + }, { - "description": "For Production", - "fieldname": "produced_qty", - "fieldtype": "Float", - "hidden": 1, - "label": "Produced Quantity", - "oldfieldname": "produced_qty", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "50px", - "read_only": 1, - "report_hide": 1, + "description": "For Production", + "fieldname": "produced_qty", + "fieldtype": "Float", + "hidden": 1, + "label": "Produced Quantity", + "oldfieldname": "produced_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "50px", + "read_only": 1, + "report_hide": 1, "width": "50px" - }, + }, { - "fieldname": "item_tax_rate", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Item Tax Rate", - "oldfieldname": "item_tax_rate", - "oldfieldtype": "Small Text", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, + "fieldname": "item_tax_rate", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Item Tax Rate", + "oldfieldname": "item_tax_rate", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, "report_hide": 1 - }, + }, { - "description": "Used for Production Plan", - "fieldname": "transaction_date", - "fieldtype": "Date", - "hidden": 1, - "in_filter": 0, - "label": "Sales Order Date", - "oldfieldname": "transaction_date", - "oldfieldtype": "Date", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "report_hide": 1, + "description": "Used for Production Plan", + "fieldname": "transaction_date", + "fieldtype": "Date", + "hidden": 1, + "in_filter": 0, + "label": "Sales Order Date", + "oldfieldname": "transaction_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 1, "search_index": 0 } - ], - "idx": 1, - "istable": 1, - "modified": "2015-02-18 12:50:20.121459", - "modified_by": "Administrator", - "module": "Selling", - "name": "Sales Order Item", - "owner": "Administrator", - "permissions": [], - "sort_field": "modified", + ], + "idx": 1, + "istable": 1, + "modified": "2015-02-19 01:07:02.025024", + "modified_by": "Administrator", + "module": "Selling", + "name": "Sales Order Item", + "owner": "Administrator", + "permissions": [], + "sort_field": "modified", "sort_order": "DESC" } diff --git a/erpnext/setup/doctype/company/company.json b/erpnext/setup/doctype/company/company.json index 13a42ae31b..31688777f9 100644 --- a/erpnext/setup/doctype/company/company.json +++ b/erpnext/setup/doctype/company/company.json @@ -28,7 +28,7 @@ "reqd": 1 }, { - "description": "Please Enter Abbreviation or Short Name properly as it will be added as Suffix to all Account Heads.", + "description": "", "fieldname": "abbr", "fieldtype": "Data", "label": "Abbr", @@ -52,6 +52,14 @@ "permlevel": 0, "read_only": 0 }, + { + "fieldname": "default_letter_head", + "fieldtype": "Link", + "label": "Default Letter Head", + "options": "Letter Head", + "permlevel": 0, + "precision": "" + }, { "fieldname": "domain", "fieldtype": "Select", @@ -64,9 +72,17 @@ "fieldname": "charts_section", "fieldtype": "Section Break", "hidden": 0, - "label": "Chart of Accounts", + "label": "Localization", "permlevel": 0 }, + { + "fieldname": "default_holiday_list", + "fieldtype": "Link", + "label": "Default Holiday List", + "options": "Holiday List", + "permlevel": 0, + "precision": "" + }, { "fieldname": "country", "fieldtype": "Link", @@ -76,6 +92,22 @@ "permlevel": 0, "reqd": 1 }, + { + "fieldname": "column_break_10", + "fieldtype": "Column Break", + "permlevel": 0, + "precision": "" + }, + { + "fieldname": "default_currency", + "fieldtype": "Link", + "ignore_user_permissions": 1, + "label": "Default Currency", + "options": "Currency", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, { "fieldname": "chart_of_accounts", "fieldtype": "Select", @@ -130,6 +162,14 @@ "permlevel": 0, "read_only": 0 }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, { "depends_on": "eval:!doc.__islocal", "fieldname": "default_payable_account", @@ -164,36 +204,8 @@ "permlevel": 0 }, { - "fieldname": "default_holiday_list", - "fieldtype": "Link", - "label": "Default Holiday List", - "options": "Holiday List", - "permlevel": 0, - "precision": "" - }, - { - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "read_only": 0, - "width": "50%" - }, - { - "fieldname": "default_currency", - "fieldtype": "Link", - "ignore_user_permissions": 1, - "label": "Default Currency", - "options": "Currency", - "permlevel": 0, - "read_only": 0, - "reqd": 1 - }, - { - "fieldname": "default_letter_head", - "fieldtype": "Link", - "label": "Default Letter Head", - "options": "Letter Head", + "fieldname": "section_break_22", + "fieldtype": "Section Break", "permlevel": 0, "precision": "" }, @@ -228,6 +240,12 @@ "permlevel": 0, "read_only": 0 }, + { + "fieldname": "column_break_26", + "fieldtype": "Column Break", + "permlevel": 0, + "precision": "" + }, { "depends_on": "eval:!doc.__islocal", "fieldname": "yearly_bgt_flag", @@ -278,6 +296,12 @@ "permlevel": 0, "read_only": 0 }, + { + "fieldname": "column_break_32", + "fieldtype": "Column Break", + "permlevel": 0, + "precision": "" + }, { "fieldname": "expenses_included_in_valuation", "fieldtype": "Link", @@ -375,7 +399,7 @@ ], "icon": "icon-building", "idx": 1, - "modified": "2015-02-05 05:11:35.790597", + "modified": "2015-02-19 00:37:55.472911", "modified_by": "Administrator", "module": "Setup", "name": "Company", diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json index c67c5775c2..2545b0a132 100644 --- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json +++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json @@ -1,5 +1,5 @@ { - "autoname": "DND/.#######", + "autoname": "hash", "creation": "2013-04-22 13:15:44", "docstatus": 0, "doctype": "DocType", @@ -467,7 +467,7 @@ ], "idx": 1, "istable": 1, - "modified": "2015-02-12 15:19:29.701710", + "modified": "2015-02-19 01:06:59.675246", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note Item", diff --git a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.json b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.json index 42b917bce7..4f1a59cc70 100644 --- a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.json +++ b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.json @@ -1,6 +1,6 @@ { - "autoname": "ITEMCUST/.#####", - "creation": "2013-03-08 15:37:16.000000", + "autoname": "hash", + "creation": "2013-03-08 15:37:16", "description": "For the convenience of customers, these codes can be used in print formats like Invoices and Delivery Notes", "docstatus": 0, "doctype": "DocType", @@ -38,10 +38,11 @@ "idx": 1, "in_create": 0, "istable": 1, - "modified": "2013-12-20 19:23:16.000000", + "modified": "2015-02-19 01:07:00.255330", "modified_by": "Administrator", "module": "Stock", "name": "Item Customer Detail", "owner": "Administrator", + "permissions": [], "read_only": 0 } \ No newline at end of file diff --git a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.json b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.json index f7c35f2102..69aae27678 100644 --- a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.json +++ b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.json @@ -1,6 +1,6 @@ { - "autoname": "IISD/.#####", - "creation": "2013-02-22 01:28:01.000000", + "autoname": "hash", + "creation": "2013-02-22 01:28:01", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -30,9 +30,10 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:16.000000", + "modified": "2015-02-19 01:07:00.296584", "modified_by": "Administrator", "module": "Stock", "name": "Item Quality Inspection Parameter", - "owner": "Administrator" + "owner": "Administrator", + "permissions": [] } \ No newline at end of file diff --git a/erpnext/stock/doctype/item_reorder/item_reorder.json b/erpnext/stock/doctype/item_reorder/item_reorder.json index bc96b4a923..99cde730be 100644 --- a/erpnext/stock/doctype/item_reorder/item_reorder.json +++ b/erpnext/stock/doctype/item_reorder/item_reorder.json @@ -1,6 +1,6 @@ { - "autoname": "REORD-.#####", - "creation": "2013-03-07 11:42:59.000000", + "autoname": "hash", + "creation": "2013-03-07 11:42:59", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -45,9 +45,10 @@ "idx": 1, "in_create": 1, "istable": 1, - "modified": "2013-12-20 19:23:16.000000", + "modified": "2015-02-19 01:07:00.334482", "modified_by": "Administrator", "module": "Stock", "name": "Item Reorder", - "owner": "Administrator" + "owner": "Administrator", + "permissions": [] } \ No newline at end of file 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 f6f8831187..3b659e3ac2 100644 --- a/erpnext/stock/doctype/material_request_item/material_request_item.json +++ b/erpnext/stock/doctype/material_request_item/material_request_item.json @@ -1,5 +1,5 @@ { - "autoname": "MREQD-.#####", + "autoname": "hash", "creation": "2013-02-22 01:28:02", "docstatus": 0, "doctype": "DocType", @@ -264,7 +264,7 @@ ], "idx": 1, "istable": 1, - "modified": "2015-02-12 15:20:02.832792", + "modified": "2015-02-19 01:07:00.695393", "modified_by": "Administrator", "module": "Stock", "name": "Material Request Item", diff --git a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.json b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.json index 89f8f6ba8e..b051dd51fb 100644 --- a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.json +++ b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.json @@ -1,5 +1,5 @@ { - "autoname": "PSD/.#######", + "autoname": "hash", "creation": "2013-04-08 13:10:16", "docstatus": 0, "doctype": "DocType", @@ -90,7 +90,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-09-09 05:35:38.604554", + "modified": "2015-02-19 01:07:00.840553", "modified_by": "Administrator", "module": "Stock", "name": "Packing Slip 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 816b0b7a46..c29a270afb 100755 --- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json +++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json @@ -1,5 +1,5 @@ { - "autoname": "GRND/.#######", + "autoname": "hash", "creation": "2013-05-24 19:29:10", "docstatus": 0, "doctype": "DocType", @@ -588,7 +588,7 @@ ], "idx": 1, "istable": 1, - "modified": "2015-02-12 15:20:26.299671", + "modified": "2015-02-19 01:07:01.405923", "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 62c83edf90..16d045b40d 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -13,6 +13,7 @@ from erpnext.stock.stock_ledger import get_previous_sle, NegativeStockError from erpnext.controllers.queries import get_match_cond from erpnext.stock.get_item_details import get_available_qty, get_default_cost_center, get_conversion_factor from erpnext.manufacturing.doctype.bom.bom import validate_bom_no +from erpnext.accounts.utils import validate_fiscal_year class NotUpdateStockError(frappe.ValidationError): pass class StockOverReturnError(frappe.ValidationError): pass @@ -48,6 +49,8 @@ class StockEntry(StockController): pro_obj = self.production_order and \ frappe.get_doc('Production Order', self.production_order) or None + validate_fiscal_year(self.posting_date, self.fiscal_year, self.meta.get_label("posting_date"), self) + self.validate_item() self.set_transfer_qty() self.validate_uom_is_integer("uom", "qty") @@ -59,8 +62,7 @@ class StockEntry(StockController): self.validate_finished_goods() self.validate_return_reference_doc() self.validate_with_material_request() - self.validate_fiscal_year() - self.validate_valuation_rate() + #self.validate_valuation_rate() self.set_total_amount() def on_submit(self): @@ -76,11 +78,6 @@ class StockEntry(StockController): self.update_production_order() self.make_gl_entries_on_cancel() - def validate_fiscal_year(self): - from erpnext.accounts.utils import validate_fiscal_year - validate_fiscal_year(self.posting_date, self.fiscal_year, - self.meta.get_label("posting_date")) - def validate_purpose(self): valid_purposes = ["Material Issue", "Material Receipt", "Material Transfer", "Material Transfer for Manufacture", "Manufacture", "Repack", "Subcontract", "Sales Return", "Purchase Return"] @@ -220,8 +217,9 @@ class StockEntry(StockController): if d.t_warehouse and not d.s_warehouse: valuation_at_target += flt(d.amount) - if valuation_at_target < valuation_at_source: - frappe.throw(_("Total valuation for manufactured or repacked item(s) can not be less than total valuation of raw materials")) + if valuation_at_target + 0.001 < valuation_at_source: + frappe.throw(_("Total valuation ({0}) for manufactured or repacked item(s) can not be less than total valuation of raw materials ({1})").format(valuation_at_target, + valuation_at_source)) def set_total_amount(self): self.total_amount = sum([flt(item.amount) for item in self.get("items")]) @@ -419,7 +417,7 @@ class StockEntry(StockController): _validate_production_order(pro_doc) pro_doc.run_method("update_status") if self.purpose == "Manufacture": - pro_doc.run_method("update_produced_qty") + pro_doc.run_method("update_production_order_qty") self.update_planned_qty(pro_doc) def update_planned_qty(self, pro_doc): diff --git a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json index dda2580ba4..216be2980c 100644 --- a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json +++ b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json @@ -1,5 +1,5 @@ { - "autoname": "MTND/.######", + "autoname": "hash", "creation": "2013-03-29 18:22:12", "docstatus": 0, "doctype": "DocType", @@ -331,7 +331,7 @@ ], "idx": 1, "istable": 1, - "modified": "2015-02-12 15:20:56.815434", + "modified": "2015-02-19 01:07:02.254835", "modified_by": "Administrator", "module": "Stock", "name": "Stock Entry Detail", diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py index 0f90ca7f94..a6abe7cae1 100644 --- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py +++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py @@ -21,8 +21,7 @@ class StockLedgerEntry(Document): self.scrub_posting_time() from erpnext.accounts.utils import validate_fiscal_year - validate_fiscal_year(self.posting_date, self.fiscal_year, - self.meta.get_label("posting_date")) + validate_fiscal_year(self.posting_date, self.fiscal_year, self.meta.get_label("posting_date"), self) def on_submit(self): self.check_stock_frozen_date() @@ -67,10 +66,10 @@ class StockLedgerEntry(Document): frappe.throw(_("Batch number is mandatory for Item {0}").format(self.item_code)) elif not frappe.db.get_value("Batch",{"item": self.item_code, "name": self.batch_no}): frappe.throw(_("{0} is not a valid Batch Number for Item {1}").format(self.batch_no, self.item_code)) - + elif item_det.has_batch_no =='No' and self.batch_no: frappe.throw(_("The Item {0} cannot have Batch").format(self.item_code)) - + if item_det.has_variants: frappe.throw(_("Stock cannot exist for Item {0} since has variants").format(self.item_code), ItemTemplateCannotHaveStock) diff --git a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.json b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.json index 3c9c022bbe..521d688028 100644 --- a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.json +++ b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.json @@ -1,6 +1,6 @@ { - "autoname": "UCDD/.#####", - "creation": "2013-02-22 01:28:04.000000", + "autoname": "hash", + "creation": "2013-02-22 01:28:04", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -26,9 +26,10 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:21:53.000000", + "modified": "2015-02-19 01:07:02.522989", "modified_by": "Administrator", "module": "Stock", "name": "UOM Conversion Detail", - "owner": "Administrator" + "owner": "Administrator", + "permissions": [] } \ No newline at end of file diff --git a/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.json b/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.json index aee7274608..2e3e5d9765 100644 --- a/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.json +++ b/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.json @@ -1,6 +1,6 @@ { - "autoname": "MSD.#####", - "creation": "2013-02-22 01:28:05.000000", + "autoname": "hash", + "creation": "2013-02-22 01:28:05", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -89,9 +89,10 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-31 12:13:38.000000", + "modified": "2015-02-19 01:07:00.495149", "modified_by": "Administrator", "module": "Support", "name": "Maintenance Schedule Detail", - "owner": "Administrator" + "owner": "Administrator", + "permissions": [] } \ No newline at end of file diff --git a/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.json b/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.json index 38fa4b590c..d0c080a52c 100644 --- a/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.json +++ b/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.json @@ -1,6 +1,6 @@ { - "autoname": "IMD.#####", - "creation": "2013-02-22 01:28:05.000000", + "autoname": "hash", + "creation": "2013-02-22 01:28:05", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -133,9 +133,10 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-31 12:08:32.000000", + "modified": "2015-02-19 01:07:00.550040", "modified_by": "Administrator", "module": "Support", "name": "Maintenance Schedule Item", - "owner": "Administrator" + "owner": "Administrator", + "permissions": [] } \ No newline at end of file diff --git a/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.json b/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.json index 8e98397bd3..8dd525bee2 100644 --- a/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.json +++ b/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.json @@ -1,5 +1,5 @@ { - "autoname": "MVD.#####", + "autoname": "hash", "creation": "2013-02-22 01:28:06", "docstatus": 0, "doctype": "DocType", @@ -123,7 +123,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-07-07 02:53:48.442249", + "modified": "2015-02-19 01:07:00.623383", "modified_by": "Administrator", "module": "Support", "name": "Maintenance Visit Purpose",