Merge branch 'develop'

This commit is contained in:
Anand Doshi 2015-10-02 16:35:36 +05:30
commit 5bcf8315de
6 changed files with 59 additions and 5 deletions

View File

@ -1,2 +1,2 @@
from __future__ import unicode_literals
__version__ = '6.4.3'
__version__ = '6.4.4'

View File

@ -29,7 +29,7 @@ blogs.
"""
app_icon = "icon-th"
app_color = "#e74c3c"
app_version = "6.4.3"
app_version = "6.4.4"
github_link = "https://github.com/frappe/erpnext"
error_report_email = "support@erpnext.com"

View File

@ -212,4 +212,5 @@ erpnext.patches.v6_2.fix_missing_default_taxes_and_lead
erpnext.patches.v5_8.tax_rule
erpnext.patches.v6_3.convert_applicable_territory
erpnext.patches.v6_4.round_status_updater_percentages
erpnext.patches.v6_4.repost_gle_for_journal_entries_where_reference_name_missing
erpnext.patches.v6_4.repost_gle_for_journal_entries_where_reference_name_missing
erpnext.patches.v6_4.fix_journal_entries_due_to_reconciliation

View File

@ -0,0 +1,50 @@
# 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
def execute():
je_rows = frappe.db.sql("""
select name, parent, reference_type, reference_name, debit, credit
from `tabJournal Entry Account`
where docstatus=1 and date(modified) >= '2015-09-17'
and ((ifnull(debit_in_account_currency, 0)*exchange_rate != ifnull(debit, 0))
or (ifnull(credit_in_account_currency, 0)*exchange_rate != ifnull(credit, 0)))
order by parent
""", as_dict=True)
journal_entries = []
for d in je_rows:
if d.parent not in journal_entries:
journal_entries.append(d.parent)
is_advance_entry=None
if d.reference_type in ("Sales Invoice", "Purchase Invoice") and d.reference_name:
is_advance_entry = frappe.db.sql("""select name from `tab{0}`
where journal_entry=%s and jv_detail_no=%s
and ifnull(allocated_amount, 0) > 0 and docstatus=1"""
.format(d.reference_type + " Advance"), (d.parent, d.name))
if is_advance_entry or not (d.debit or d.credit):
frappe.db.sql("""
update `tabJournal Entry Account`
set debit=debit_in_account_currency*exchange_rate,
credit=credit_in_account_currency*exchange_rate
where name=%s""", d.name)
else:
frappe.db.sql("""
update `tabJournal Entry Account`
set debit_in_account_currency=debit/exchange_rate,
credit_in_account_currency=credit/exchange_rate
where name=%s""", d.name)
for d in journal_entries:
print d
# delete existing gle
frappe.db.sql("delete from `tabGL Entry` where voucher_type='Journal Entry' and voucher_no=%s", d)
# repost gl entries
je = frappe.get_doc("Journal Entry", d)
je.make_gl_entries()

View File

@ -181,6 +181,9 @@ def get_default_naming_series(doctype):
naming_series = frappe.get_meta(doctype).get_field("naming_series").options or ""
naming_series = naming_series.split("\n")
out = naming_series[0] or (naming_series[1] if len(naming_series) > 1 else None)
if out:
if not out:
frappe.throw(_("Please set Naming Series for {0} via Setup > Settings > Naming Series").format(doctype),
NamingSeriesNotSetError)
else:
return out

View File

@ -1,6 +1,6 @@
from setuptools import setup, find_packages
version = "6.4.3"
version = "6.4.4"
with open("requirements.txt", "r") as f:
install_requires = f.readlines()