Merge branch 'develop' of github.com:frappe/erpnext into v4-hotfix
This commit is contained in:
commit
a521343063
@ -12,8 +12,6 @@ erpnext.hr.EmployeeController = frappe.ui.form.Controller.extend({
|
||||
|
||||
onload: function() {
|
||||
this.setup_leave_approver_select();
|
||||
this.frm.toggle_display(["esic_card_no", "gratuity_lic_id", "pan_number", "pf_number"],
|
||||
frappe.boot.sysdefaults.country==="India");
|
||||
if(this.frm.doc.__islocal) this.frm.set_value("employee_name", "");
|
||||
},
|
||||
|
||||
|
@ -337,30 +337,6 @@
|
||||
"oldfieldtype": "Data",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "esic_card_no",
|
||||
"fieldtype": "Data",
|
||||
"label": "ESIC CARD No",
|
||||
"oldfieldname": "esic_card_no",
|
||||
"oldfieldtype": "Data",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "pf_number",
|
||||
"fieldtype": "Data",
|
||||
"label": "PF Number",
|
||||
"oldfieldname": "pf_number",
|
||||
"oldfieldtype": "Data",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "gratuity_lic_id",
|
||||
"fieldtype": "Data",
|
||||
"label": "Gratuity LIC ID",
|
||||
"oldfieldname": "gratuity_lic_id",
|
||||
"oldfieldtype": "Data",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "organization_profile",
|
||||
"fieldtype": "Section Break",
|
||||
@ -497,12 +473,6 @@
|
||||
"permlevel": 0,
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"fieldname": "pan_number",
|
||||
"fieldtype": "Data",
|
||||
"label": "PAN Number",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "passport_number",
|
||||
"fieldtype": "Data",
|
||||
@ -711,7 +681,7 @@
|
||||
],
|
||||
"icon": "icon-user",
|
||||
"idx": 1,
|
||||
"modified": "2014-04-30 09:03:10.879762",
|
||||
"modified": "2014-04-30 09:03:11.879762",
|
||||
"modified_by": "Administrator",
|
||||
"module": "HR",
|
||||
"name": "Employee",
|
||||
|
@ -71,24 +71,6 @@
|
||||
"read_only": 1,
|
||||
"search_index": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "pf_no",
|
||||
"fieldtype": "Data",
|
||||
"label": "PF No.",
|
||||
"oldfieldname": "pf_no",
|
||||
"oldfieldtype": "Data",
|
||||
"permlevel": 0,
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "esic_no",
|
||||
"fieldtype": "Data",
|
||||
"label": "ESIC No.",
|
||||
"oldfieldname": "esic_no",
|
||||
"oldfieldtype": "Data",
|
||||
"permlevel": 0,
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "letter_head",
|
||||
"fieldtype": "Link",
|
||||
@ -343,7 +325,7 @@
|
||||
"icon": "icon-file-text",
|
||||
"idx": 1,
|
||||
"is_submittable": 1,
|
||||
"modified": "2014-05-01 04:21:14.543092",
|
||||
"modified": "2014-05-01 04:22:14.543092",
|
||||
"modified_by": "Administrator",
|
||||
"module": "HR",
|
||||
"name": "Salary Slip",
|
||||
|
@ -38,12 +38,10 @@ class SalarySlip(TransactionBase):
|
||||
|
||||
def pull_emp_details(self):
|
||||
emp = frappe.db.get_value("Employee", self.employee,
|
||||
["bank_name", "bank_ac_no", "esic_card_no", "pf_number"], as_dict=1)
|
||||
["bank_name", "bank_ac_no"], as_dict=1)
|
||||
if emp:
|
||||
self.bank_name = emp.bank_name
|
||||
self.bank_account_no = emp.bank_ac_no
|
||||
self.esic_no = emp.esic_card_no
|
||||
self.pf_no = emp.pf_number
|
||||
|
||||
def get_leave_details(self, lwp=None):
|
||||
if not self.fiscal_year:
|
||||
|
@ -29,12 +29,10 @@ class SalaryStructure(Document):
|
||||
return ret
|
||||
|
||||
def get_ss_values(self,employee):
|
||||
basic_info = frappe.db.sql("""select bank_name, bank_ac_no, esic_card_no, pf_number
|
||||
basic_info = frappe.db.sql("""select bank_name, bank_ac_no
|
||||
from `tabEmployee` where name =%s""", employee)
|
||||
ret = {'bank_name': basic_info and basic_info[0][0] or '',
|
||||
'bank_ac_no': basic_info and basic_info[0][1] or '',
|
||||
'esic_no': basic_info and basic_info[0][2] or '',
|
||||
'pf_no': basic_info and basic_info[0][3] or ''}
|
||||
'bank_ac_no': basic_info and basic_info[0][1] or ''}
|
||||
return ret
|
||||
|
||||
def make_table(self, doct_name, tab_fname, tab_name):
|
||||
|
@ -37,3 +37,4 @@ execute:frappe.delete_doc("Page", "Financial Statements")
|
||||
execute:frappe.delete_doc("DocType", "Stock Ledger")
|
||||
execute:frappe.db.sql("update `tabJournal Voucher` set voucher_type='Journal Entry' where ifnull(voucher_type, '')=''")
|
||||
execute:frappe.delete_doc("DocType", "Grade")
|
||||
erpnext.patches.4_0.remove_india_specific_fields
|
||||
|
27
erpnext/patches/4_0/remove_india_specific_fields.py
Normal file
27
erpnext/patches/4_0/remove_india_specific_fields.py
Normal file
@ -0,0 +1,27 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.core.doctype.custom_field.custom_field import create_custom_field_if_values_exist
|
||||
|
||||
def execute():
|
||||
docfields = {
|
||||
("Purchase Receipt", "challan_no"): frappe.get_meta("Purchase Receipt").get_field("challan_no"),
|
||||
("Purchase Receipt", "challan_date"): frappe.get_meta("Purchase Receipt").get_field("challan_date"),
|
||||
("Employee", "pf_number"): frappe.get_meta("Employee").get_field("pf_number"),
|
||||
("Employee", "pan_number"): frappe.get_meta("Employee").get_field("pan_number"),
|
||||
("Employee", "gratuity_lic_id"): frappe.get_meta("Employee").get_field("gratuity_lic_id"),
|
||||
("Employee", "esic_card_no"): frappe.get_meta("Employee").get_field("esic_card_no"),
|
||||
("Salary Slip", "esic_no"): frappe.get_meta("Salary Slip").get_field("esic_no"),
|
||||
("Salary Slip", "pf_no"): frappe.get_meta("Salary Slip").get_field("pf_no")
|
||||
}
|
||||
|
||||
for (doctype, fieldname), df in docfields.items():
|
||||
opts = df.as_dict()
|
||||
if df.idx >= 2:
|
||||
opts["insert_after"] = frappe.get_meta(doctype).get("fields")[df.idx - 2].fieldname
|
||||
|
||||
frappe.delete_doc("DocField", df.name)
|
||||
frappe.clear_cache(doctype=doctype)
|
||||
create_custom_field_if_values_exist(doctype, opts)
|
@ -40,10 +40,6 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
if(frappe.boot.sysdefaults.country == 'India') {
|
||||
unhide_field(['challan_no', 'challan_date']);
|
||||
}
|
||||
},
|
||||
|
||||
received_qty: function(doc, cdt, cdn) {
|
||||
|
@ -131,34 +131,6 @@
|
||||
"search_index": 0,
|
||||
"width": "100px"
|
||||
},
|
||||
{
|
||||
"fieldname": "challan_no",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 1,
|
||||
"label": "Supplier Shipment No",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "challan_no",
|
||||
"oldfieldtype": "Data",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_width": "100px",
|
||||
"reqd": 0,
|
||||
"width": "100px"
|
||||
},
|
||||
{
|
||||
"fieldname": "challan_date",
|
||||
"fieldtype": "Date",
|
||||
"hidden": 1,
|
||||
"label": "Supplier Shipment Date",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "challan_date",
|
||||
"oldfieldtype": "Date",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_width": "100px",
|
||||
"reqd": 0,
|
||||
"width": "100px"
|
||||
},
|
||||
{
|
||||
"fieldname": "currency_price_list",
|
||||
"fieldtype": "Section Break",
|
||||
@ -782,7 +754,7 @@
|
||||
"icon": "icon-truck",
|
||||
"idx": 1,
|
||||
"is_submittable": 1,
|
||||
"modified": "2014-02-17 12:01:00.000000",
|
||||
"modified": "2014-02-17 12:02:00.000000",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Purchase Receipt",
|
||||
|
@ -53,7 +53,6 @@ class PurchaseReceipt(BuyingController):
|
||||
self.validate_inspection()
|
||||
self.validate_uom_is_integer("uom", ["qty", "received_qty"])
|
||||
self.validate_uom_is_integer("stock_uom", "stock_qty")
|
||||
self.validate_challan_no()
|
||||
|
||||
pc_obj = frappe.get_doc('Purchase Common')
|
||||
pc_obj.validate_for_items(self)
|
||||
@ -89,15 +88,6 @@ class PurchaseReceipt(BuyingController):
|
||||
frappe.throw(_("Accepted + Rejected Qty must be equal to Received quantity for Item {0}").format(d.item_code))
|
||||
|
||||
|
||||
def validate_challan_no(self):
|
||||
"Validate if same challan no exists for same supplier in a submitted purchase receipt"
|
||||
if self.challan_no:
|
||||
exists = frappe.db.sql_list("""select name from `tabPurchase Receipt`
|
||||
where docstatus=1 and name!=%s and supplier=%s and challan_no=%s
|
||||
and fiscal_year=%s""", (self.name, self.supplier, self.challan_no, self.doc.fiscal_year))
|
||||
if exists:
|
||||
frappe.throw(_("Supplier delivery number duplicate in {0}").format(exists))
|
||||
|
||||
def validate_with_previous_doc(self):
|
||||
super(PurchaseReceipt, self).validate_with_previous_doc(self.tname, {
|
||||
"Purchase Order": {
|
||||
|
Loading…
Reference in New Issue
Block a user