Merge branch 'develop'

This commit is contained in:
Rushabh Mehta 2016-02-11 12:41:22 +05:30
commit 4bef7a3a52
6 changed files with 177 additions and 204 deletions

View File

@ -1,2 +1,2 @@
from __future__ import unicode_literals
__version__ = '6.21.3'
__version__ = '6.21.4'

View File

@ -7,7 +7,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd."
app_description = """ERP made simple"""
app_icon = "icon-th"
app_color = "#e74c3c"
app_version = "6.21.3"
app_version = "6.21.4"
app_email = "info@erpnext.com"
app_license = "GNU General Public License (v3)"
source_link = "https://github.com/frappe/erpnext"

View File

@ -84,8 +84,15 @@ class PackingSlip(Document):
* No. of Cases of this packing slip
"""
# also pick custom fields from delivery note
rows = [d.item_code for d in self.get("items")]
custom_fields = ', '.join(['dni.`{0}`'.format(d.fieldname) for d in \
frappe.get_meta("Delivery Note Item").get_custom_fields()])
if custom_fields:
custom_fields = ', ' + custom_fields
condition = ""
if rows:
condition = " and item_code in (%s)" % (", ".join(["%s"]*len(rows)))
@ -96,10 +103,10 @@ class PackingSlip(Document):
from `tabPacking Slip` ps, `tabPacking Slip Item` psi
where ps.name = psi.parent and ps.docstatus = 1
and ps.delivery_note = dni.parent and psi.item_code=dni.item_code) as packed_qty,
stock_uom, item_name, description, dni.batch_no
stock_uom, item_name, description, dni.batch_no {custom_fields}
from `tabDelivery Note Item` dni
where parent=%s %s
group by item_code""" % ("%s", condition),
where parent=%s {condition}
group by item_code""".format(condition=condition, custom_fields=custom_fields),
tuple([self.delivery_note] + rows), as_dict=1)
ps_item_qty = dict([[d.item_code, d.qty] for d in self.get("items")])
@ -146,6 +153,8 @@ class PackingSlip(Document):
def get_items(self):
self.set("items", [])
custom_fields = frappe.get_meta("Delivery Note Item").get_custom_fields()
dn_details = self.get_details_for_packing()[0]
for item in dn_details:
if flt(item.qty) > flt(item.packed_qty):
@ -156,6 +165,12 @@ class PackingSlip(Document):
ch.description = item.description
ch.batch_no = item.batch_no
ch.qty = flt(item.qty) - flt(item.packed_qty)
# copy custom fields
for d in custom_fields:
if item.get(d.fieldname):
ch.set(d.fieldname, item.get(d.fieldname))
self.update_item_details()
def item_details(doctype, txt, searchfield, start, page_len, filters):

View File

@ -4,12 +4,17 @@
frappe.provide("erpnext.support");
frappe.require("assets/erpnext/js/utils.js");
frappe.ui.form.on_change("Warranty Claim", "customer", function(frm) {
erpnext.utils.get_party_details(frm) });
frappe.ui.form.on_change("Warranty Claim", "customer_address",
erpnext.utils.get_address_display);
frappe.ui.form.on_change("Warranty Claim", "contact_person",
erpnext.utils.get_contact_details);
frappe.ui.form.on("Warranty Claim", {
customer: function(frm) {
erpnext.utils.get_party_details(frm);
},
customer_address: function(frm) {
erpnext.utils.get_address_display(frm);
},
contact_person: function(frm) {
erpnext.utils.get_contact_details(frm);
}
});
erpnext.support.WarrantyClaim = frappe.ui.form.Controller.extend({
refresh: function() {

View File

@ -9,30 +9,6 @@
"doctype": "DocType",
"document_type": "Setup",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "customer_section",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
"length": 0,
"no_copy": 0,
"options": "icon-user",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@ -191,66 +167,16 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "customer_address",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Customer Address",
"length": 0,
"no_copy": 0,
"options": "Address",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "contact_person",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Contact Person",
"length": 0,
"no_copy": 0,
"options": "Contact",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "issue_details",
"fieldname": "section_break_7",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
"length": 0,
"no_copy": 0,
"oldfieldtype": "Section Break",
"options": "icon-ticket",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@ -265,7 +191,7 @@
"bold": 0,
"collapsible": 0,
"fieldname": "complaint",
"fieldtype": "Small Text",
"fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
@ -285,6 +211,31 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "issue_details",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Item and Warranty Details",
"length": 0,
"no_copy": 0,
"oldfieldtype": "Section Break",
"options": "icon-ticket",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@ -311,30 +262,6 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break1",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"oldfieldtype": "Column Break",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
"width": "50%"
},
{
"allow_on_submit": 0,
"bold": 0,
@ -388,6 +315,30 @@
"unique": 0,
"width": "300px"
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break1",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"oldfieldtype": "Column Break",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
"width": "50%"
},
{
"allow_on_submit": 0,
"bold": 0,
@ -462,7 +413,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "To assign this issue, use the \"Assign\" button in the sidebar.",
"description": "",
"fieldname": "resolution_section",
"fieldtype": "Section Break",
"hidden": 0,
@ -563,7 +514,7 @@
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"collapsible": 1,
"depends_on": "customer",
"fieldname": "contact_info",
"fieldtype": "Section Break",
@ -571,7 +522,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Contact Info",
"label": "Customer Details",
"length": 0,
"no_copy": 0,
"options": "icon-bullhorn",
@ -585,29 +536,6 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "col_break3",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
"width": "50%"
},
{
"allow_on_submit": 0,
"bold": 0,
@ -636,18 +564,16 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "customer",
"description": "",
"fieldname": "customer_group",
"fieldname": "contact_person",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Customer Group",
"label": "Contact Person",
"length": 0,
"no_copy": 0,
"options": "Customer Group",
"options": "Contact",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
@ -658,34 +584,6 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "customer",
"description": "",
"fieldname": "territory",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Territory",
"length": 0,
"no_copy": 0,
"oldfieldname": "territory",
"oldfieldtype": "Link",
"options": "Territory",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@ -758,6 +656,60 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "customer",
"description": "",
"fieldname": "territory",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Territory",
"length": 0,
"no_copy": 0,
"oldfieldname": "territory",
"oldfieldtype": "Link",
"options": "Territory",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "customer",
"description": "",
"fieldname": "customer_group",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Customer Group",
"length": 0,
"no_copy": 0,
"options": "Customer Group",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@ -785,21 +737,18 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "customer",
"description": "If different than customer address",
"fieldname": "service_address",
"fieldtype": "Small Text",
"fieldname": "customer_address",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Service Address",
"label": "Customer Address",
"length": 0,
"no_copy": 0,
"oldfieldname": "service_address",
"oldfieldtype": "Small Text",
"options": "Address",
"permlevel": 0,
"print_hide": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
@ -836,6 +785,33 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "customer",
"description": "If different than customer address",
"fieldname": "service_address",
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Service Address",
"length": 0,
"no_copy": 0,
"oldfieldname": "service_address",
"oldfieldtype": "Small Text",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"fieldname": "more_info",
"fieldtype": "Section Break",
"hidden": 0,
@ -856,29 +832,6 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "col_break5",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
"width": "50%"
},
{
"allow_on_submit": 0,
"bold": 0,
@ -1042,7 +995,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-02-03 01:13:47.773777",
"modified": "2016-02-11 00:34:18.588402",
"modified_by": "Administrator",
"module": "Support",
"name": "Warranty Claim",

View File

@ -1,7 +1,7 @@
from setuptools import setup, find_packages
from pip.req import parse_requirements
version = "6.21.3"
version = "6.21.4"
requirements = parse_requirements("requirements.txt", session="")
setup(