Merge branch 'develop'
This commit is contained in:
commit
5e9d72d57b
@ -2,7 +2,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
__version__ = '8.0.7'
|
||||
__version__ = '8.0.8'
|
||||
|
||||
def get_default_company(user=None):
|
||||
'''Get default company for user'''
|
||||
|
@ -182,6 +182,7 @@ def get_customers_address(customers):
|
||||
address_data = address[0]
|
||||
address_data.update({'full_name': data.customer_name})
|
||||
customer_address[data.name] = address_data
|
||||
|
||||
return customer_address
|
||||
|
||||
def get_child_nodes(group_type, root):
|
||||
@ -337,11 +338,14 @@ def add_customer(name):
|
||||
def make_address(args, customer):
|
||||
if not args.get('address_line1'): return
|
||||
|
||||
name = args.get('name') or get_customers_address(customer)[customer].get("name")
|
||||
name = args.get('name')
|
||||
|
||||
if not name:
|
||||
data = get_customers_address(customer)
|
||||
name = data[customer].get('name') if data else None
|
||||
|
||||
if name:
|
||||
address = frappe.get_doc('Address', name)
|
||||
frappe.errprint(address)
|
||||
address = frappe.get_doc('Address', name)
|
||||
else:
|
||||
address = frappe.new_doc('Address')
|
||||
address.country = frappe.db.get_value('Company', args.get('company'), 'country')
|
||||
|
@ -106,24 +106,25 @@ def validate_returned_items(doc):
|
||||
|
||||
def validate_quantity(doc, args, ref, valid_items, already_returned_items):
|
||||
fields = ['qty']
|
||||
if doc.doctype in ['Purchase Invoice', 'Purchase Receipt']:
|
||||
if doc.doctype in ['Purchase Receipt', 'Purchase Invoice']:
|
||||
fields.extend(['received_qty', 'rejected_qty'])
|
||||
|
||||
already_returned_data = already_returned_items.get(args.item_code) or {}
|
||||
|
||||
for column in fields:
|
||||
return_qty = flt(already_returned_data.get(column, 0)) if len(already_returned_data) > 0 else 0
|
||||
referenced_qty = ref.get(column)
|
||||
max_return_qty = flt(referenced_qty) - return_qty
|
||||
returned_qty = flt(already_returned_data.get(column, 0)) if len(already_returned_data) > 0 else 0
|
||||
reference_qty = ref.get(column)
|
||||
max_returnable_qty = flt(reference_qty) - returned_qty
|
||||
label = column.replace('_', ' ').title()
|
||||
|
||||
if flt(args.get(column)) > 0:
|
||||
frappe.throw(_("{0} must be negative in return document").format(label))
|
||||
elif return_qty >= referenced_qty and flt(args.get(column)) != 0:
|
||||
frappe.throw(_("Item {0} has already been returned").format(args.item_code), StockOverReturnError)
|
||||
elif abs(args.get(column)) > max_return_qty:
|
||||
frappe.throw(_("Row # {0}: Cannot return more than {1} for Item {2}")
|
||||
.format(args.idx, referenced_qty, args.item_code), StockOverReturnError)
|
||||
if reference_qty:
|
||||
if flt(args.get(column)) > 0:
|
||||
frappe.throw(_("{0} must be negative in return document").format(label))
|
||||
elif returned_qty >= reference_qty and args.get(column):
|
||||
frappe.throw(_("Item {0} has already been returned")
|
||||
.format(args.item_code), StockOverReturnError)
|
||||
elif abs(args.get(column)) > max_returnable_qty:
|
||||
frappe.throw(_("Row # {0}: Cannot return more than {1} for Item {2}")
|
||||
.format(args.idx, reference_qty, args.item_code), StockOverReturnError)
|
||||
|
||||
def get_ref_item_dict(valid_items, ref_item_row):
|
||||
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
|
||||
|
@ -140,16 +140,20 @@ def period_wise_columns_query(filters, trans):
|
||||
else:
|
||||
trans_date = 'transaction_date'
|
||||
|
||||
qty_field = "t2.stock_qty"
|
||||
if trans == 'Purchase Invoice':
|
||||
qty_field = "t2.qty"
|
||||
|
||||
if filters.get("period") != 'Yearly':
|
||||
for dt in bet_dates:
|
||||
get_period_wise_columns(dt, filters.get("period"), pwc)
|
||||
query_details = get_period_wise_query(dt, trans_date, query_details)
|
||||
query_details = get_period_wise_query(dt, trans_date, query_details, qty_field)
|
||||
else:
|
||||
pwc = [_(filters.get("fiscal_year")) + " ("+_("Qty") + "):Float:120",
|
||||
_(filters.get("fiscal_year")) + " ("+ _("Amt") + "):Currency:120"]
|
||||
query_details = " SUM(t2.stock_qty), SUM(t2.base_net_amount),"
|
||||
query_details = " SUM(%s), SUM(t2.base_net_amount),"%(qty_field)
|
||||
|
||||
query_details += 'SUM(t2.stock_qty), SUM(t2.base_net_amount)'
|
||||
query_details += 'SUM(%s), SUM(t2.base_net_amount)'%(qty_field)
|
||||
return pwc, query_details
|
||||
|
||||
def get_period_wise_columns(bet_dates, period, pwc):
|
||||
@ -160,10 +164,10 @@ def get_period_wise_columns(bet_dates, period, pwc):
|
||||
pwc += [_(get_mon(bet_dates[0])) + "-" + _(get_mon(bet_dates[1])) + " (" + _("Qty") + "):Float:120",
|
||||
_(get_mon(bet_dates[0])) + "-" + _(get_mon(bet_dates[1])) + " (" + _("Amt") + "):Currency:120"]
|
||||
|
||||
def get_period_wise_query(bet_dates, trans_date, query_details):
|
||||
query_details += """SUM(IF(t1.%(trans_date)s BETWEEN '%(sd)s' AND '%(ed)s', t2.stock_qty, NULL)),
|
||||
def get_period_wise_query(bet_dates, trans_date, query_details, qty_field):
|
||||
query_details += """SUM(IF(t1.%(trans_date)s BETWEEN '%(sd)s' AND '%(ed)s', %(qty_field)s, NULL)),
|
||||
SUM(IF(t1.%(trans_date)s BETWEEN '%(sd)s' AND '%(ed)s', t2.base_net_amount, NULL)),
|
||||
""" % {"trans_date": trans_date, "sd": bet_dates[0],"ed": bet_dates[1]}
|
||||
""" % {"trans_date": trans_date, "sd": bet_dates[0],"ed": bet_dates[1], "qty_field": qty_field}
|
||||
return query_details
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
|
@ -574,7 +574,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Territory",
|
||||
"length": 0,
|
||||
@ -1152,7 +1152,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-03-12 21:55:21.598112",
|
||||
"modified": "2017-04-04 01:21:02.165730",
|
||||
"modified_by": "Administrator",
|
||||
"module": "CRM",
|
||||
"name": "Opportunity",
|
||||
|
@ -4,6 +4,7 @@ frappe.ui.form.on("Employee Attendance Tool", {
|
||||
},
|
||||
|
||||
onload: function(frm) {
|
||||
frm.doc.department = frm.doc.branch = frm.doc.company = "All";
|
||||
frm.set_value("date", get_today());
|
||||
erpnext.employee_attendance_tool.load_employees(frm);
|
||||
},
|
||||
|
@ -13,11 +13,18 @@ class EmployeeAttendanceTool(Document):
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_employees(date, department=None, branch=None, company=None):
|
||||
def get_employees(date, department = None, branch = None, company = None):
|
||||
attendance_not_marked = []
|
||||
attendance_marked = []
|
||||
employee_list = frappe.get_list("Employee", fields=["employee", "employee_name"], filters={
|
||||
"status": "Active", "department": department, "branch": branch, "company": company}, order_by="employee_name")
|
||||
filters = {"status": "Active"}
|
||||
if department != "All":
|
||||
filters["department"] = department
|
||||
if branch != "All":
|
||||
filters["branch"] = branch
|
||||
if company != "All":
|
||||
filters["company"] = company
|
||||
|
||||
employee_list = frappe.get_list("Employee", fields=["employee", "employee_name"], filters=filters, order_by="employee_name")
|
||||
marked_employee = {}
|
||||
for emp in frappe.get_list("Attendance", fields=["employee", "status"],
|
||||
filters={"attendance_date": date}):
|
||||
|
@ -76,7 +76,7 @@ class SalarySlip(TransactionBase):
|
||||
def eval_condition_and_formula(self, d, data):
|
||||
try:
|
||||
if d.condition:
|
||||
if not eval(d.condition, None, data):
|
||||
if not eval(d.condition, {}, data):
|
||||
return None
|
||||
amount = d.amount
|
||||
if d.amount_based_on_formula:
|
||||
|
@ -14,9 +14,6 @@ frappe.ui.form.on('Student Batch', {
|
||||
});
|
||||
});
|
||||
frm.add_custom_button(__("Newsletter"), function() {
|
||||
frappe.route_options = {
|
||||
email_group: frm.doc.name
|
||||
}
|
||||
frappe.set_route("List", "Newsletter");
|
||||
});
|
||||
}
|
||||
|
@ -26,9 +26,6 @@ frappe.ui.form.on("Student Group", {
|
||||
});
|
||||
});
|
||||
frm.add_custom_button(__("Newsletter"), function() {
|
||||
frappe.route_options = {
|
||||
email_group: frm.doc.name
|
||||
}
|
||||
frappe.set_route("List", "Newsletter");
|
||||
});
|
||||
}
|
||||
|
@ -371,7 +371,7 @@
|
||||
"oldfieldname": "delivery_date",
|
||||
"oldfieldtype": "Date",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
@ -3516,7 +3516,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-03-29 04:38:25.247179",
|
||||
"modified": "2017-03-30 03:23:30.487992",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Selling",
|
||||
"name": "Sales Order",
|
||||
|
@ -287,36 +287,6 @@
|
||||
"unique": 0,
|
||||
"width": "150px"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.docstatus==0",
|
||||
"fieldname": "set_posting_time",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Edit Posting Date and Time",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@ -385,6 +355,36 @@
|
||||
"unique": 0,
|
||||
"width": "100px"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.docstatus==0",
|
||||
"fieldname": "set_posting_time",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Edit Posting Date and Time",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@ -3288,7 +3288,7 @@
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2017-03-29 04:55:45.044810",
|
||||
"modified": "2017-04-03 03:13:58.051782",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Delivery Note",
|
||||
|
@ -11,7 +11,7 @@ frappe.listview_settings['Item'] = {
|
||||
} else if (doc.end_of_life && doc.end_of_life < frappe.datetime.get_today()) {
|
||||
return [__("Expired"), "grey", "end_of_life,<,Today"];
|
||||
} else if (doc.has_variants) {
|
||||
return [__("Template"), "blue", "has_variants,=,Yes"];
|
||||
return [__("Template"), "orange", "has_variants,=,Yes"];
|
||||
} else if (doc.variant_of) {
|
||||
return [__("Variant"), "green", "variant_of,=," + doc.variant_of];
|
||||
}
|
||||
|
@ -225,36 +225,6 @@
|
||||
"unique": 0,
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.docstatus==0",
|
||||
"fieldname": "set_posting_time",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Edit Posting Date and Time",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@ -323,6 +293,36 @@
|
||||
"unique": 0,
|
||||
"width": "100px"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.docstatus==0",
|
||||
"fieldname": "set_posting_time",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Edit Posting Date and Time",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@ -2846,7 +2846,7 @@
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2017-03-14 16:10:58.769483",
|
||||
"modified": "2017-04-05 03:17:55.726121",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Purchase Receipt",
|
||||
|
@ -383,36 +383,6 @@
|
||||
"unique": 0,
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.docstatus==0",
|
||||
"fieldname": "set_posting_time",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Edit Posting Date and Time",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@ -476,6 +446,36 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.docstatus==0",
|
||||
"fieldname": "set_posting_time",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Edit Posting Date and Time",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@ -1654,7 +1654,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-03-14 16:11:11.741704",
|
||||
"modified": "2017-04-05 03:18:05.437204",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Stock Entry",
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 1,
|
||||
"allow_rename": 1,
|
||||
"autoname": "naming_series:",
|
||||
@ -285,7 +286,7 @@
|
||||
"columns": 0,
|
||||
"depends_on": "",
|
||||
"fieldname": "description",
|
||||
"fieldtype": "Text",
|
||||
"fieldtype": "Text Editor",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
@ -607,7 +608,7 @@
|
||||
"columns": 0,
|
||||
"depends_on": "eval:!doc.__islocal",
|
||||
"fieldname": "resolution_details",
|
||||
"fieldtype": "Small Text",
|
||||
"fieldtype": "Text Editor",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
@ -808,18 +809,18 @@
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"icon": "fa fa-ticket",
|
||||
"idx": 7,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"in_dialog": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-02-20 13:32:31.898423",
|
||||
"modified": "2017-04-05 21:42:23.740187",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Support",
|
||||
"name": "Issue",
|
||||
|
Loading…
Reference in New Issue
Block a user