commit
8c7b4549ed
@ -61,3 +61,4 @@ erpnext.patches.v4_0.update_custom_print_formats_for_renamed_fields
|
|||||||
erpnext.patches.v4_0.update_other_charges_in_custom_purchase_print_formats
|
erpnext.patches.v4_0.update_other_charges_in_custom_purchase_print_formats
|
||||||
erpnext.patches.v4_0.create_price_list_if_missing
|
erpnext.patches.v4_0.create_price_list_if_missing
|
||||||
execute:frappe.db.sql("update `tabItem` set end_of_life=null where end_of_life='0000-00-00'") #2014-06-16
|
execute:frappe.db.sql("update `tabItem` set end_of_life=null where end_of_life='0000-00-00'") #2014-06-16
|
||||||
|
erpnext.patches.v4_0.update_users_report_view_settings
|
||||||
|
|||||||
12
erpnext/patches/v4_0/update_users_report_view_settings.py
Normal file
12
erpnext/patches/v4_0/update_users_report_view_settings.py
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||||
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from frappe.model import update_users_report_view_settings
|
||||||
|
from erpnext.patches.v4_0.fields_to_be_renamed import rename_map
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
for dt, field_list in rename_map.items():
|
||||||
|
for field in field_list:
|
||||||
|
update_users_report_view_settings(dt, field[0], field[1])
|
||||||
@ -102,7 +102,6 @@ class SalesOrder(SellingController):
|
|||||||
self.validate_warehouse()
|
self.validate_warehouse()
|
||||||
|
|
||||||
from erpnext.stock.doctype.packed_item.packed_item import make_packing_list
|
from erpnext.stock.doctype.packed_item.packed_item import make_packing_list
|
||||||
|
|
||||||
make_packing_list(self,'sales_order_details')
|
make_packing_list(self,'sales_order_details')
|
||||||
|
|
||||||
self.validate_with_previous_doc()
|
self.validate_with_previous_doc()
|
||||||
|
|||||||
@ -3,15 +3,15 @@
|
|||||||
|
|
||||||
$.extend(cur_frm.cscript, {
|
$.extend(cur_frm.cscript, {
|
||||||
message: function () {
|
message: function () {
|
||||||
var total_words = this.frm.doc.message.length;
|
var total_characters = this.frm.doc.message.length;
|
||||||
var total_msg = 1;
|
var total_msg = 1;
|
||||||
|
|
||||||
if (total_words > 160) {
|
if (total_characters > 160) {
|
||||||
total_msg = cint(total_words / 160);
|
total_msg = cint(total_characters / 160);
|
||||||
total_msg = (total_words % 160 == 0 ? total_msg : total_msg + 1);
|
total_msg = (total_characters % 160 == 0 ? total_msg : total_msg + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.frm.set_value("total_words", total_words);
|
this.frm.set_value("total_characters", total_characters);
|
||||||
this.frm.set_value("total_messages", this.frm.doc.message ? total_msg : 0);
|
this.frm.set_value("total_messages", this.frm.doc.message ? total_msg : 0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,135 +1,135 @@
|
|||||||
{
|
{
|
||||||
"allow_attach": 0,
|
"allow_attach": 0,
|
||||||
"allow_copy": 1,
|
"allow_copy": 1,
|
||||||
"creation": "2013-01-10 16:34:22",
|
"creation": "2013-01-10 16:34:22",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"fieldname": "column_break1",
|
"fieldname": "column_break1",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"width": "50%"
|
"width": "50%"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "send_to",
|
"fieldname": "send_to",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Send To",
|
"label": "Send To",
|
||||||
"options": "\nAll Contact\nAll Customer Contact\nAll Supplier Contact\nAll Sales Partner Contact\nAll Lead (Open)\nAll Employee (Active)\nAll Sales Person",
|
"options": "\nAll Contact\nAll Customer Contact\nAll Supplier Contact\nAll Sales Partner Contact\nAll Lead (Open)\nAll Employee (Active)\nAll Sales Person",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"depends_on": "eval:doc.send_to=='All Customer Contact'",
|
"depends_on": "eval:doc.send_to=='All Customer Contact'",
|
||||||
"fieldname": "customer",
|
"fieldname": "customer",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Customer",
|
"label": "Customer",
|
||||||
"options": "Customer",
|
"options": "Customer",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"depends_on": "eval:doc.send_to=='All Supplier Contact'",
|
"depends_on": "eval:doc.send_to=='All Supplier Contact'",
|
||||||
"fieldname": "supplier",
|
"fieldname": "supplier",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Supplier",
|
"label": "Supplier",
|
||||||
"options": "Supplier",
|
"options": "Supplier",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"depends_on": "eval:doc.send_to=='All Employee (Active)'",
|
"depends_on": "eval:doc.send_to=='All Employee (Active)'",
|
||||||
"fieldname": "department",
|
"fieldname": "department",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Department",
|
"label": "Department",
|
||||||
"options": "Department",
|
"options": "Department",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"depends_on": "eval:doc.send_to=='All Employee (Active)'",
|
"depends_on": "eval:doc.send_to=='All Employee (Active)'",
|
||||||
"fieldname": "branch",
|
"fieldname": "branch",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Branch",
|
"label": "Branch",
|
||||||
"options": "Branch",
|
"options": "Branch",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "create_receiver_list",
|
"fieldname": "create_receiver_list",
|
||||||
"fieldtype": "Button",
|
"fieldtype": "Button",
|
||||||
"label": "Create Receiver List",
|
"label": "Create Receiver List",
|
||||||
"options": "create_receiver_list",
|
"options": "create_receiver_list",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "receiver_list",
|
"fieldname": "receiver_list",
|
||||||
"fieldtype": "Code",
|
"fieldtype": "Code",
|
||||||
"label": "Receiver List",
|
"label": "Receiver List",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "column_break9",
|
"fieldname": "column_break9",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"width": "50%"
|
"width": "50%"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "Messages greater than 160 characters will be split into multiple messages",
|
"description": "Messages greater than 160 characters will be split into multiple messages",
|
||||||
"fieldname": "message",
|
"fieldname": "message",
|
||||||
"fieldtype": "Text",
|
"fieldtype": "Text",
|
||||||
"label": "Message",
|
"label": "Message",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "total_words",
|
"fieldname": "total_characters",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"label": "Total Characters",
|
"label": "Total Characters",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "total_messages",
|
"fieldname": "total_messages",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"label": "Total Message(s)",
|
"label": "Total Message(s)",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "send_sms",
|
"fieldname": "send_sms",
|
||||||
"fieldtype": "Button",
|
"fieldtype": "Button",
|
||||||
"label": "Send SMS",
|
"label": "Send SMS",
|
||||||
"options": "send_sms",
|
"options": "send_sms",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"hide_heading": 0,
|
"hide_heading": 0,
|
||||||
"hide_toolbar": 0,
|
"hide_toolbar": 0,
|
||||||
"icon": "icon-mobile-phone",
|
"icon": "icon-mobile-phone",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"modified": "2014-05-09 02:17:41.375945",
|
"modified": "2014-06-18 08:59:51.755566",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "Selling",
|
||||||
"name": "SMS Center",
|
"name": "SMS Center",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
"cancel": 0,
|
"cancel": 0,
|
||||||
"create": 1,
|
"create": 1,
|
||||||
"delete": 0,
|
"delete": 0,
|
||||||
"export": 0,
|
"export": 0,
|
||||||
"import": 0,
|
"import": 0,
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 0,
|
"report": 0,
|
||||||
"role": "System Manager",
|
"role": "System Manager",
|
||||||
"submit": 0,
|
"submit": 0,
|
||||||
"write": 1
|
"write": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC"
|
"sort_order": "DESC"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,18 +12,18 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
class PackedItem(Document):
|
class PackedItem(Document):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def get_sales_bom_items(item_code):
|
def get_sales_bom_items(item_code):
|
||||||
return frappe.db.sql("""select t1.item_code, t1.qty, t1.uom
|
return frappe.db.sql("""select t1.item_code, t1.qty, t1.uom
|
||||||
from `tabSales BOM Item` t1, `tabSales BOM` t2
|
from `tabSales BOM Item` t1, `tabSales BOM` t2
|
||||||
where t2.new_item_code=%s and t1.parent = t2.name""", item_code, as_dict=1)
|
where t2.new_item_code=%s and t1.parent = t2.name""", item_code, as_dict=1)
|
||||||
|
|
||||||
def get_packing_item_details(item):
|
def get_packing_item_details(item):
|
||||||
return frappe.db.sql("""select item_name, description, stock_uom from `tabItem`
|
return frappe.db.sql("""select item_name, description, stock_uom from `tabItem`
|
||||||
where name = %s""", item, as_dict = 1)[0]
|
where name = %s""", item, as_dict = 1)[0]
|
||||||
|
|
||||||
def get_bin_qty(item, warehouse):
|
def get_bin_qty(item, warehouse):
|
||||||
det = frappe.db.sql("""select actual_qty, projected_qty from `tabBin`
|
det = frappe.db.sql("""select actual_qty, projected_qty from `tabBin`
|
||||||
where item_code = %s and warehouse = %s""", (item, warehouse), as_dict = 1)
|
where item_code = %s and warehouse = %s""", (item, warehouse), as_dict = 1)
|
||||||
return det and det[0] or ''
|
return det and det[0] or ''
|
||||||
|
|
||||||
@ -55,12 +55,15 @@ def update_packing_list_item(obj, packing_item_code, qty, warehouse, line, packi
|
|||||||
if not pi.batch_no:
|
if not pi.batch_no:
|
||||||
pi.batch_no = cstr(line.get("batch_no"))
|
pi.batch_no = cstr(line.get("batch_no"))
|
||||||
pi.idx = packing_list_idx
|
pi.idx = packing_list_idx
|
||||||
|
|
||||||
packing_list_idx += 1
|
packing_list_idx += 1
|
||||||
|
|
||||||
|
|
||||||
def make_packing_list(obj, item_table_fieldname):
|
def make_packing_list(obj, item_table_fieldname):
|
||||||
"""make packing list for sales bom item"""
|
"""make packing list for sales bom item"""
|
||||||
|
|
||||||
|
if obj._action == "update_after_submit": return
|
||||||
|
|
||||||
packing_list_idx = 0
|
packing_list_idx = 0
|
||||||
parent_items = []
|
parent_items = []
|
||||||
for d in obj.get(item_table_fieldname):
|
for d in obj.get(item_table_fieldname):
|
||||||
@ -68,14 +71,14 @@ def make_packing_list(obj, item_table_fieldname):
|
|||||||
and d.warehouse or d.warehouse
|
and d.warehouse or d.warehouse
|
||||||
if frappe.db.get_value("Sales BOM", {"new_item_code": d.item_code}):
|
if frappe.db.get_value("Sales BOM", {"new_item_code": d.item_code}):
|
||||||
for i in get_sales_bom_items(d.item_code):
|
for i in get_sales_bom_items(d.item_code):
|
||||||
update_packing_list_item(obj, i['item_code'], flt(i['qty'])*flt(d.qty),
|
update_packing_list_item(obj, i['item_code'], flt(i['qty'])*flt(d.qty),
|
||||||
warehouse, d, packing_list_idx)
|
warehouse, d, packing_list_idx)
|
||||||
|
|
||||||
if [d.item_code, d.name] not in parent_items:
|
if [d.item_code, d.name] not in parent_items:
|
||||||
parent_items.append([d.item_code, d.name])
|
parent_items.append([d.item_code, d.name])
|
||||||
|
|
||||||
cleanup_packing_list(obj, parent_items)
|
cleanup_packing_list(obj, parent_items)
|
||||||
|
|
||||||
def cleanup_packing_list(obj, parent_items):
|
def cleanup_packing_list(obj, parent_items):
|
||||||
"""Remove all those child items which are no longer present in main item table"""
|
"""Remove all those child items which are no longer present in main item table"""
|
||||||
delete_list = []
|
delete_list = []
|
||||||
@ -86,10 +89,9 @@ def cleanup_packing_list(obj, parent_items):
|
|||||||
|
|
||||||
if not delete_list:
|
if not delete_list:
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
packing_details = obj.get("packing_details")
|
packing_details = obj.get("packing_details")
|
||||||
obj.set("packing_details", [])
|
obj.set("packing_details", [])
|
||||||
for d in packing_details:
|
for d in packing_details:
|
||||||
if d not in delete_list:
|
if d not in delete_list:
|
||||||
obj.append("packing_details", d)
|
obj.append("packing_details", d)
|
||||||
|
|
||||||
@ -221,7 +221,7 @@ class StockEntry(StockController):
|
|||||||
if not d.bom_no:
|
if not d.bom_no:
|
||||||
if not flt(d.incoming_rate) or d.s_warehouse or self.purpose == "Sales Return":
|
if not flt(d.incoming_rate) or d.s_warehouse or self.purpose == "Sales Return":
|
||||||
incoming_rate = self.get_incoming_rate(args)
|
incoming_rate = self.get_incoming_rate(args)
|
||||||
if incoming_rate:
|
if flt(incoming_rate) > 0:
|
||||||
d.incoming_rate = incoming_rate
|
d.incoming_rate = incoming_rate
|
||||||
|
|
||||||
d.amount = flt(d.transfer_qty) * flt(d.incoming_rate)
|
d.amount = flt(d.transfer_qty) * flt(d.incoming_rate)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user