Merge pull request #3573 from rmehta/fix-labels
[fix] [minor] fix customer_name, supplier_name labels
diff --git a/erpnext/config/accounts.py b/erpnext/config/accounts.py
index 64508b8..f32aeed 100644
--- a/erpnext/config/accounts.py
+++ b/erpnext/config/accounts.py
@@ -75,6 +75,11 @@
"items": [
{
"type": "doctype",
+ "name": "Company",
+ "description": _("Company (not Customer or Supplier) master.")
+ },
+ {
+ "type": "doctype",
"name": "Fiscal Year",
"description": _("Financial / accounting year.")
},
diff --git a/erpnext/config/setup.py b/erpnext/config/setup.py
index 961e4f7..a660942 100644
--- a/erpnext/config/setup.py
+++ b/erpnext/config/setup.py
@@ -110,43 +110,7 @@
"description": _("Setup SMS gateway settings")
},
]
- },
- {
- "label": _("Masters"),
- "icon": "icon-star",
- "items": [
- {
- "type": "doctype",
- "name": "Company",
- "description": _("Company (not Customer or Supplier) master.")
- },
- {
- "type": "doctype",
- "name": "Item",
- "description": _("Item master.")
- },
- {
- "type": "doctype",
- "name": "Customer",
- "description": _("Customer master.")
- },
- {
- "type": "doctype",
- "name": "Supplier",
- "description": _("Supplier master.")
- },
- {
- "type": "doctype",
- "name": "Contact",
- "description": _("Contact master.")
- },
- {
- "type": "doctype",
- "name": "Address",
- "description": _("Address master.")
- },
- ]
- },
+ }
]
for module, label, icon in (
diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py
index cb0ce11..a2bb10c 100644
--- a/erpnext/hr/doctype/employee/employee.py
+++ b/erpnext/hr/doctype/employee/employee.py
@@ -45,6 +45,10 @@
if self.user_id:
self.validate_for_enabled_user_id()
self.validate_duplicate_user_id()
+ else:
+ existing_user_id = frappe.db.get_value("Employee", self.name, "user_id")
+ if existing_user_id:
+ frappe.permissions.remove_user_permission("Employee", self.name, existing_user_id)
def on_update(self):
if self.user_id:
diff --git a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py
index e012d78..f53acca 100644
--- a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py
+++ b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py
@@ -75,8 +75,20 @@
filters["month"] = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov",
"Dec"].index(filters["month"]) + 1
+ from frappe.model.document import Document
+ fiscal_years = frappe.get_doc("Fiscal Year",filters["fiscal_year"])
+ import datetime
+ year_start = fiscal_years.year_start_date.strftime("%Y")
+ year_end = fiscal_years.year_end_date.strftime("%Y")
+ dt_test = datetime.datetime.strptime(year_end + "-" + str(100+int(filters["month"]))[2:3] + "-01", "%Y-%m-%d")
+ date_test = datetime.date(dt_test.year, dt_test.month, dt_test.day)
+ if date_test > fiscal_years.year_end_date:
+ year_target = year_start
+ else:
+ year_target = year_end
+
from calendar import monthrange
- filters["total_days_in_month"] = monthrange(cint(filters["fiscal_year"].split("-")[-1]),
+ filters["total_days_in_month"] = monthrange(cint(year_target),
filters["month"])[1]
conditions = " and month(att_date) = %(month)s and fiscal_year = %(fiscal_year)s"
diff --git a/erpnext/stock/doctype/manage_variants/manage_variants.js b/erpnext/stock/doctype/manage_variants/manage_variants.js
index ba5c46e..e8b7ade 100644
--- a/erpnext/stock/doctype/manage_variants/manage_variants.js
+++ b/erpnext/stock/doctype/manage_variants/manage_variants.js
@@ -3,7 +3,7 @@
frappe.ui.form.on("Manage Variants", {
onload: function(frm) {
- var df = frappe.meta.get_docfield("Variant Attribute", "attribute_value");
+ var df = frappe.meta.get_docfield("Variant Attribute", "attribute_value", "Manage Variants");
df.on_make = function(field) {
$(field.input_area).addClass("ui-front");
field.$input.autocomplete({
diff --git a/erpnext/templates/print_formats/includes/item_table_description.html b/erpnext/templates/print_formats/includes/item_table_description.html
index f259626..ece5386 100644
--- a/erpnext/templates/print_formats/includes/item_table_description.html
+++ b/erpnext/templates/print_formats/includes/item_table_description.html
@@ -1,6 +1,7 @@
{% if doc.in_format_data("image") and doc.get("image") and not doc.is_print_hide("image")-%}
<div class="pull-left" style="max-width: 38.2%; margin-right: 10px;">
- <img src="{{ doc.image }}" style="max-width: 100%">
+ <!-- width: 100% is a mozilla bug -->
+ <img src="{{ doc.image }}" class="img-responsive" style="width: 100%;">
</div>
{%- endif %}
<div>
@@ -8,14 +9,14 @@
<div class="primary">{{ doc.item_code }}</div>
{%- endif %}
{% if (doc.in_format_data("item_name") and not doc.is_print_hide("item_name") and
- (not doc.in_format_data("item_code") or doc.is_print_hide("item_code")
+ (not doc.in_format_data("item_code") or doc.is_print_hide("item_code")
or doc.item_code != doc.item_name)) -%}
<div class="primary">{{ doc.get_formatted("item_name") }}</div>
{%- endif %}
{% if (doc.in_format_data("description") and doc.description and
(
(
- (not doc.in_format_data("item_code") or doc.is_print_hide("item_code")) and
+ (not doc.in_format_data("item_code") or doc.is_print_hide("item_code")) and
(not doc.in_format_data("item_name") or doc.is_print_hide("item_name"))
) or not (doc.item_code == doc.item_name == doc.description)
))