multiple minor fixes

This commit is contained in:
Nabin Hait 2015-05-26 16:32:30 +05:30
parent 1568dc32a2
commit d4c8dc2915
4 changed files with 11 additions and 8 deletions

View File

@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe
from frappe import msgprint, _
from frappe import _
from frappe.utils import flt
def execute(filters=None):
@ -23,7 +23,7 @@ def execute(filters=None):
purchase_receipt = d.purchase_receipt
elif d.po_detail:
purchase_receipt = ", ".join(frappe.db.sql_list("""select distinct parent
from `tabPurchase Receipt Item` where docstatus=1 and po_detail=%s""", d.po_detail))
from `tabPurchase Receipt Item` where docstatus=1 and prevdoc_detail_docname=%s""", d.po_detail))
expense_account = d.expense_account or aii_account_map.get(d.company)
row = [d.item_code, d.item_name, d.item_group, d.parent, d.posting_date, d.supplier,

View File

@ -144,7 +144,7 @@ def get_invoice_tax_map(invoice_list, invoice_expense_map, expense_accounts):
return invoice_expense_map, invoice_tax_map
def get_invoice_po_pr_map(invoice_list):
pi_items = frappe.db.sql("""select parent, purchase_order, purchase_receipt, po_detail
pi_items = frappe.db.sql("""select parent, purchase_order, purchase_receipt, po_detail,
project_name from `tabPurchase Invoice Item` where parent in (%s)
and (ifnull(purchase_order, '') != '' or ifnull(purchase_receipt, '') != '')""" %
', '.join(['%s']*len(invoice_list)), tuple([inv.name for inv in invoice_list]), as_dict=1)
@ -160,7 +160,7 @@ def get_invoice_po_pr_map(invoice_list):
pr_list = [d.purchase_receipt]
elif d.po_detail:
pr_list = frappe.db.sql_list("""select distinct parent from `tabPurchase Receipt Item`
where docstatus=1 and po_detail=%s""", d.pr_detail)
where docstatus=1 and prevdoc_detail_docname=%s""", d.po_detail)
if pr_list:
invoice_po_pr_map.setdefault(d.parent, frappe._dict()).setdefault("purchase_receipt", pr_list)

View File

@ -10,13 +10,15 @@ def execute():
for m in frappe.get_all("Project Milestone", "*"):
if (m.milestone and m.milestone_date
and frappe.db.exists("Project", m.parent)):
frappe.get_doc({
task = frappe.get_doc({
"doctype": "Task",
"subject": m.milestone,
"expected_start_date": m.milestone_date,
"status": "Open" if m.status=="Pending" else "Closed",
"project": m.parent,
}).insert(ignore_permissions=True)
})
task.flags.ignore_mandatory = True
task.insert(ignore_permissions=True)
# remove project milestone
frappe.delete_doc("DocType", "Project Milestone")

View File

@ -4,11 +4,12 @@
</div>
{%- endif %}
<div>
{% if doc.in_format_data("item_code") -%}
{% if doc.in_format_data("item_code") and not doc.is_print_hide("item_code") -%}
<div class="primary">{{ doc.item_code }}</div>
{%- endif %}
{% if (doc.in_format_data("item_name") and
(not doc.in_format_data("item_code") or doc.item_code != doc.item_name)) -%}
(not doc.in_format_data("item_code") or doc.is_print_hide("item_code")
or doc.item_code != doc.item_name)) -%}
<div class="primary">{{ doc.get_formatted("item_name") }}</div>
{%- endif %}
{% if (doc.in_format_data("description") and doc.description and