Merge branch 'master' into develop

This commit is contained in:
Nabin Hait 2017-01-02 17:26:55 +05:30
commit ab42fc006f
7 changed files with 22 additions and 9 deletions

View File

@ -2,7 +2,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import frappe import frappe
__version__ = '7.2.5' __version__ = '7.2.6'
def get_default_company(user=None): def get_default_company(user=None):
'''Get default company for user''' '''Get default company for user'''

View File

@ -9,11 +9,13 @@
"doctype": "DocType", "doctype": "DocType",
"document_type": "", "document_type": "",
"editable_grid": 1, "editable_grid": 1,
"engine": "InnoDB",
"fields": [ "fields": [
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "account", "fieldname": "account",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
@ -30,6 +32,7 @@
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0, "print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 1, "reqd": 1,
"search_index": 0, "search_index": 0,
@ -40,6 +43,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "budget_amount", "fieldname": "budget_amount",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 0, "hidden": 0,
@ -50,11 +54,13 @@
"label": "Budget Amount", "label": "Budget Amount",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0, "print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 1, "reqd": 1,
"search_index": 0, "search_index": 0,
@ -72,7 +78,7 @@
"issingle": 0, "issingle": 0,
"istable": 1, "istable": 1,
"max_attachments": 0, "max_attachments": 0,
"modified": "2016-07-11 03:27:58.705376", "modified": "2017-01-02 17:02:53.339420",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Budget Account", "name": "Budget Account",

View File

@ -326,10 +326,12 @@ class JournalEntry(AccountsController):
if d.account_currency == self.company_currency: if d.account_currency == self.company_currency:
d.exchange_rate = 1 d.exchange_rate = 1
elif not d.exchange_rate or d.exchange_rate == 1 or \ elif not d.exchange_rate or d.exchange_rate == 1 or \
(d.reference_type in ("Sales Invoice", "Purchase Invoice") and d.reference_name and d.posting_date): (d.reference_type in ("Sales Invoice", "Purchase Invoice")
and d.reference_name and self.posting_date):
# Modified to include the posting date for which to retreive the exchange rate # Modified to include the posting date for which to retreive the exchange rate
d.exchange_rate = get_exchange_rate(self.posting_date, d.account, d.account_currency, self.company, d.exchange_rate = get_exchange_rate(self.posting_date, d.account, d.account_currency,
d.reference_type, d.reference_name, d.debit, d.credit, d.exchange_rate) self.company, d.reference_type, d.reference_name, d.debit, d.credit, d.exchange_rate)
if not d.exchange_rate: if not d.exchange_rate:
frappe.throw(_("Row {0}: Exchange Rate is mandatory").format(d.idx)) frappe.throw(_("Row {0}: Exchange Rate is mandatory").format(d.idx))

View File

@ -110,11 +110,15 @@ def apply_pricing_rule(args):
item_list = args.get("items") item_list = args.get("items")
args.pop("items") args.pop("items")
set_serial_nos_based_on_fifo = frappe.db.get_single_value("Stock Settings",
"automatically_set_serial_nos_based_on_fifo")
for item in item_list: for item in item_list:
args_copy = copy.deepcopy(args) args_copy = copy.deepcopy(args)
args_copy.update(item) args_copy.update(item)
out.append(get_pricing_rule_for_item(args_copy)) out.append(get_pricing_rule_for_item(args_copy))
out.append(get_serial_no_for_item(args_copy)) if set_serial_nos_based_on_fifo:
out.append(get_serial_no_for_item(args_copy))
return out return out
def get_serial_no_for_item(args): def get_serial_no_for_item(args):

View File

@ -217,7 +217,7 @@ class LeaveApplication(Document):
def validate_attendance(self): def validate_attendance(self):
attendance = frappe.db.sql("""select name from `tabAttendance` where employee = %s and (att_date between %s and %s) attendance = frappe.db.sql("""select name from `tabAttendance` where employee = %s and (att_date between %s and %s)
and docstatus = 1""", and status = "Present" and docstatus = 1""",
(self.employee, self.from_date, self.to_date)) (self.employee, self.from_date, self.to_date))
if attendance: if attendance:
frappe.throw(_("Attendance for employee {0} is already marked for this day").format(self.employee), frappe.throw(_("Attendance for employee {0} is already marked for this day").format(self.employee),

View File

@ -77,7 +77,7 @@ def send_via_gateway(arg):
for d in arg.get('receiver_list'): for d in arg.get('receiver_list'):
args[ss.receiver_parameter] = d args[ss.receiver_parameter] = d
status = send_request(ss.sms_gateway_url, args) status = send_request(ss.sms_gateway_url, args)
if status > 200 and status < 300: if status >= 200 and status < 300:
success_list.append(d) success_list.append(d)
if len(success_list) > 0: if len(success_list) > 0:

View File

@ -9,7 +9,8 @@ from frappe.utils.jinja import validate_template
class TermsandConditions(Document): class TermsandConditions(Document):
def validate(self): def validate(self):
validate_template(self.terms) if self.terms:
validate_template(self.terms)
@frappe.whitelist() @frappe.whitelist()
def get_terms_and_conditions(template_name, doc): def get_terms_and_conditions(template_name, doc):