Merge pull request #6763 from rohitwaghchaure/documentation
[Fix] Documentation
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index fc52f5a..d018c4f 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -2,7 +2,7 @@
from __future__ import unicode_literals
import frappe
-__version__ = '7.1.1'
+__version__ = '7.1.2'
def get_default_company(user=None):
'''Get default company for user'''
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
index 1c9bcbc..22de07f 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -305,25 +305,8 @@
if not self.grand_total:
return
- self.auto_accounting_for_stock = \
- cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))
-
- self.stock_received_but_not_billed = self.get_company_default("stock_received_but_not_billed")
- self.expenses_included_in_valuation = self.get_company_default("expenses_included_in_valuation")
- self.negative_expense_to_be_booked = 0.0
- gl_entries = []
-
-
- self.make_supplier_gl_entry(gl_entries)
- self.make_item_gl_entries(gl_entries)
- self.make_tax_gl_entries(gl_entries)
-
- gl_entries = merge_similar_entries(gl_entries)
-
- self.make_payment_gl_entries(gl_entries)
-
- self.make_write_off_gl_entry(gl_entries)
-
+ gl_entries = self.get_gl_entries()
+
if gl_entries:
update_outstanding = "No" if (cint(self.is_paid) or self.write_off_account) else "Yes"
@@ -342,6 +325,26 @@
elif self.docstatus == 2 and cint(self.update_stock) and self.auto_accounting_for_stock:
delete_gl_entries(voucher_type=self.doctype, voucher_no=self.name)
+ def get_gl_entries(self, warehouse_account=None):
+ self.auto_accounting_for_stock = \
+ cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))
+
+ self.stock_received_but_not_billed = self.get_company_default("stock_received_but_not_billed")
+ self.expenses_included_in_valuation = self.get_company_default("expenses_included_in_valuation")
+ self.negative_expense_to_be_booked = 0.0
+ gl_entries = []
+
+
+ self.make_supplier_gl_entry(gl_entries)
+ self.make_item_gl_entries(gl_entries)
+ self.make_tax_gl_entries(gl_entries)
+
+ gl_entries = merge_similar_entries(gl_entries)
+
+ self.make_payment_gl_entries(gl_entries)
+ self.make_write_off_gl_entry(gl_entries)
+
+ return gl_entries
def make_supplier_gl_entry(self, gl_entries):
if self.grand_total:
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index e5cdb1a..d694ef4 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -341,4 +341,5 @@
erpnext.patches.v7_0.repost_bin_qty_and_item_projected_qty
erpnext.patches.v7_1.set_prefered_contact_email
execute:frappe.db.sql("update `tabSingles` set value = 1 where field = 'unlink_payment_on_cancellation_of_invoice' and doctype = 'Accounts Settings'")
-execute:frappe.db.sql("update `tabStock Entry` set total_amount = null where purpose in('Repack', 'Manufacture')")
\ No newline at end of file
+execute:frappe.db.sql("update `tabStock Entry` set total_amount = null where purpose in('Repack', 'Manufacture')")
+erpnext.patches.v7_1.repost_gle_for_pi_with_update_stock
\ No newline at end of file
diff --git a/erpnext/patches/v7_1/repost_gle_for_pi_with_update_stock.py b/erpnext/patches/v7_1/repost_gle_for_pi_with_update_stock.py
new file mode 100644
index 0000000..2355d53
--- /dev/null
+++ b/erpnext/patches/v7_1/repost_gle_for_pi_with_update_stock.py
@@ -0,0 +1,16 @@
+# 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
+from frappe.utils import cint
+
+def execute():
+ if not cint(frappe.defaults.get_global_default("auto_accounting_for_stock")):
+ return
+
+ for pi in frappe.db.sql("""select name from `tabPurchase Invoice`
+ where update_stock=1 and docstatus=1 order by posting_date asc""", as_dict=1):
+ pi_doc = frappe.get_doc("Purchase Invoice", pi.name)
+ pi_doc.make_gl_entries()
+ frappe.db.commit()
\ No newline at end of file
diff --git a/erpnext/projects/doctype/timesheet/timesheet.py b/erpnext/projects/doctype/timesheet/timesheet.py
index 60435bc..9e32b52 100644
--- a/erpnext/projects/doctype/timesheet/timesheet.py
+++ b/erpnext/projects/doctype/timesheet/timesheet.py
@@ -369,7 +369,7 @@
conditions = get_conditions(filters)
return frappe.db.sql("""select `tabTimesheet Detail`.name as name,
`tabTimesheet Detail`.docstatus as status, `tabTimesheet Detail`.parent as parent,
- from_time, hours, activity_type, project, to_time
+ from_time as start_date, hours, activity_type, project, to_time as end_date
from `tabTimesheet Detail`, `tabTimesheet`
where `tabTimesheet Detail`.parent = `tabTimesheet`.name
and `tabTimesheet`.docstatus < 2