Merge branch 'master' of github.com:webnotes/erpnext into edge

This commit is contained in:
Anand Doshi 2013-03-12 20:08:16 +05:30
commit f91c9bc95d
7 changed files with 15 additions and 19 deletions

View File

@ -1 +1 @@
SELECT DISTINCT `tabAttendance`.employee, `tabAttendance`.employee_name FROM `tabAttendance` WHERE `tabAttendance`.fiscal_year like '%(fiscal_year)s%%' AND `tabAttendance`.`company` like '%(company)s%%' AND `tabAttendance`.`employee` like '%(employee)s%%'
SELECT DISTINCT `tabAttendance`.employee, `tabEmployee`.employee_name FROM `tabAttendance`, `tabEmployee` WHERE `tabEmployee`.name = `tabAttendance`.employee and `tabAttendance`.fiscal_year like '%(fiscal_year)s%%' AND `tabAttendance`.company like '%(company)s%%' AND `tabAttendance`.employee like '%(employee)s%%'

View File

@ -1,6 +0,0 @@
import webnotes
def execute():
webnotes.reload_doc("website", "doctype", "blog_post")
from website.utils import clear_cache
clear_cache()

View File

@ -189,7 +189,6 @@ patch_list = [
"execute:webnotes.delete_doc('DocType', 'Service Order Detail')",
"execute:webnotes.delete_doc('DocType', 'Service Quotation Detail')",
"patches.february_2013.p06_material_request_mappers",
"patches.february_2013.p07_clear_web_cache",
"execute:webnotes.delete_doc('Page', 'Query Report')",
"execute:webnotes.delete_doc('Search Criteria', 'employeewise_balance_leave_report')",
"execute:webnotes.delete_doc('Search Criteria', 'employee_leave_balance_report')",
@ -213,4 +212,5 @@ patch_list = [
"patches.march_2013.p02_get_global_default",
"execute:webnotes.bean('Style Settings', 'Style Settings').save()",
"patches.march_2013.p03_rename_blog_to_blog_post",
"execute:webnotes.reload_doc('hr', 'search_criteria', 'monthly_attendance_details')",
]

View File

@ -171,7 +171,7 @@ def get_buying_amount(item_code, warehouse, qty, voucher_type, voucher_no, vouch
buying_amount = 0.0
for bom_item in item_sales_bom[item_code]:
buying_amount += _get_buying_amount(voucher_type, voucher_no, "[** No Item Row **]",
item_code, warehouse, bom_item.qty * qty, stock_ledger_entries)
bom_item.item_code, warehouse, bom_item.qty * qty, stock_ledger_entries)
return buying_amount
else:
# doesn't have sales bom
@ -188,13 +188,13 @@ def _get_buying_amount(voucher_type, voucher_no, item_row, item_code, warehouse,
abs(flt(sle.qty)) == qty):
buying_amount = flt(stock_ledger_entries[i+1].stock_value) - \
flt(sle.stock_value)
return buying_amount
return 0.0
def get_sales_bom():
item_sales_bom = {}
# for r in webnotes.conn.sql("""select parent_item, item_code, qty, warehouse, voucher_detail_no
# from `tabDelivery Note Packing Item` where docstatus = 1""", as_dict=1):
for r in webnotes.conn.sql("""select parent, item_code, qty from `tabSales BOM Item`""",
as_dict=1):
item_sales_bom.setdefault(r.parent, []).append(r)

View File

@ -53,11 +53,13 @@ class DocType:
del self.doc.fields[f]
def validate_colors(self):
if self.doc.page_background==self.doc.page_text:
if (self.doc.page_background or self.doc.page_text) and \
self.doc.page_background==self.doc.page_text:
webnotes.msgprint(_("Page text and background is same color. Please change."),
raise_exception=1)
if self.doc.top_bar_background==self.doc.top_bar_foreground:
if (self.doc.top_bar_background or self.doc.top_bar_foreground) and \
self.doc.top_bar_background==self.doc.top_bar_foreground:
webnotes.msgprint(_("Top Bar text and background is same color. Please change."),
raise_exception=1)

View File

@ -83,7 +83,7 @@ def add_comment(args=None):
# notify commentors
commentors = [d[0] for d in webnotes.conn.sql("""select comment_by from tabComment where
comment_doctype='Blog' and comment_docname=%s and
comment_doctype='Blog Post' and comment_docname=%s and
ifnull(unsubscribed, 0)=0""", args.get('comment_docname'))]
blog = webnotes.conn.sql("""select * from `tabBlog Post` where name=%s""",

View File

@ -36,7 +36,7 @@ $(document).ready(function() {
comment_by: $("[name='comment_by']").val(),
comment: $("[name='comment']").val(),
cmd: "website.helpers.blog.add_comment",
comment_doctype: "Blog",
comment_doctype: "Blog Post",
comment_docname: "{{ name }}",
page_name: "{{ page_name }}",
_type: "POST"