fix: Rename Pick TIcket -> Pick List

This commit is contained in:
Suraj Shetty 2019-08-01 12:05:20 +05:30
parent fa9111ebe2
commit fbcc56536b
15 changed files with 118 additions and 118 deletions

View File

@ -110,7 +110,7 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
let allow_delivery = false;
if (doc.docstatus==1) {
this.frm.add_custom_button(__('Pick Ticket'), () => this.make_pick_ticket(), __('Create'));
this.frm.add_custom_button(__('Pick List'), () => this.make_pick_ticket(), __('Create'));
if(this.frm.has_perm("submit")) {
if(doc.status === 'On Hold') {

View File

@ -1001,13 +1001,13 @@ def make_inter_company_purchase_order(source_name, target_doc=None):
def make_pick_ticket(source_name, target_doc=None):
doc = get_mapped_doc("Sales Order", source_name, {
"Sales Order": {
"doctype": "Pick Ticket",
"doctype": "Pick List",
"validation": {
"docstatus": ["=", 1]
}
},
"Sales Order Item": {
"doctype": "Pick Ticket Reference Item",
"doctype": "Pick List Reference Item",
"field_map": {
"item_code": "item",
"parenttype": "reference_doctype",

View File

@ -1,7 +1,7 @@
// Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Pick Ticket', {
frappe.ui.form.on('Pick List', {
setup: (frm) => {
frm.set_query('parent_warehouse', () => {
return {
@ -16,7 +16,7 @@ frappe.ui.form.on('Pick Ticket', {
frm.add_custom_button(__('Delivery Note'), () => frm.trigger('make_delivery_note'), __('Create'));
frm.add_custom_button(__('Sales Order'), function() {
erpnext.utils.map_current_doc({
method: "erpnext.selling.doctype.sales_order.sales_order.make_pick_ticket",
method: "erpnext.selling.doctype.sales_order.sales_order.make_pick_list",
source_doctype: "Sales Order",
target: frm,
setters: {
@ -36,7 +36,7 @@ frappe.ui.form.on('Pick Ticket', {
},
make_delivery_note(frm) {
frappe.model.open_mapped_doc({
method: "erpnext.stock.doctype.pick_ticket.pick_ticket.make_delivery_note",
method: "erpnext.stock.doctype.pick_list.pick_list.make_delivery_note",
frm: frm
});
},

View File

@ -43,19 +43,19 @@
"fieldname": "item_locations",
"fieldtype": "Table",
"label": "Item Locations",
"options": "Pick Ticket Item"
"options": "Pick List Item"
},
{
"fieldname": "reference_items",
"fieldtype": "Table",
"label": "Items To Be Picked",
"options": "Pick Ticket Reference Item"
"options": "Pick List Reference Item"
}
],
"modified": "2019-08-01 10:50:17.055509",
"modified_by": "Administrator",
"module": "Stock",
"name": "Pick Ticket",
"name": "Pick List",
"owner": "Administrator",
"permissions": [
{

View File

@ -7,7 +7,7 @@ import frappe
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
class PickTicket(Document):
class PickList(Document):
def set_item_locations(self):
reference_items = self.reference_items
@ -131,14 +131,14 @@ def set_batch_no(item_doc, parent_doc):
@frappe.whitelist()
def make_delivery_note(source_name, target_doc=None):
target_doc = get_mapped_doc("Pick Ticket", source_name, {
"Pick Ticket": {
target_doc = get_mapped_doc("Pick List", source_name, {
"Pick List": {
"doctype": "Delivery Note",
# "validation": {
# "docstatus": ["=", 1]
# }
},
"Pick Ticket Item": {
"Pick List Item": {
"doctype": "Delivery Note Item",
"field_map": {
"item": "item_code",

View File

@ -0,0 +1,100 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_dependencies = ['Item', 'Sales Invoice', 'Stock Entry', 'Batch']
from erpnext.selling.doctype.sales_order.sales_order import make_pick_list
class TestPickList(unittest.TestCase):
def test_pick_list_picks_warehouse_for_each_item(self):
pick_list = frappe.get_doc({
'doctype': 'Pick List',
'company': '_Test Company',
'reference_items': [{
'item': '_Test Item Home Desktop 100',
'reference_doctype': 'Sales Order',
'qty': 5,
'reference_name': '_T-Sales Order-1',
}],
})
pick_list.set_item_locations()
self.assertEqual(pick_list.items_locations[0].item, '_Test Item Home Desktop 100')
self.assertEqual(pick_list.items_locations[0].warehouse, '_Test Warehouse - _TC')
self.assertEqual(pick_list.items_locations[0].qty, 5)
def test_pick_list_skips_out_of_stock_item(self):
pick_list = frappe.get_doc({
'doctype': 'Pick List',
'company': '_Test Company',
'reference_items': [{
'item': '_Test Item Warehouse Group Wise Reorder',
'reference_doctype': 'Sales Order',
'qty': 1000,
'reference_name': '_T-Sales Order-1',
}],
})
pick_list.set_item_locations()
self.assertEqual(pick_list.items_locations[0].item, '_Test Item Warehouse Group Wise Reorder')
self.assertEqual(pick_list.items_locations[0].warehouse, '_Test Warehouse Group-C1 - _TC')
self.assertEqual(pick_list.items_locations[0].qty, 30)
def test_pick_list_skips_items_in_expired_batch(self):
pass
def test_pick_list_shows_serial_no_for_serialized_item(self):
stock_reconciliation = frappe.get_doc({
'doctype': 'Stock Reconciliation',
'company': '_Test Company',
'items': [{
'item_code': '_Test Serialized Item',
'warehouse': '_Test Warehouse - _TC',
'qty': 5,
'serial_no': '123450\n123451\n123452\n123453\n123454'
}]
})
stock_reconciliation.submit()
pick_list = frappe.get_doc({
'doctype': 'Pick List',
'company': '_Test Company',
'reference_items': [{
'item': '_Test Serialized Item',
'reference_doctype': 'Sales Order',
'qty': 1000,
'reference_name': '_T-Sales Order-1',
}],
})
pick_list.set_item_locations()
self.assertEqual(pick_list.items_locations[0].item, '_Test Serialized Item')
self.assertEqual(pick_list.items_locations[0].warehouse, '_Test Warehouse Group-C1 - _TC')
self.assertEqual(pick_list.items_locations[0].qty, 30)
self.assertEqual(pick_list.items_locations[0].serial_no, 30)
def test_pick_list_for_multiple_reference_doctypes(self):
pass
## records required
'''
batch no
items
sales invoice
stock entries
bin
stock ledger entry
warehouses
'''

View File

@ -132,7 +132,7 @@
"modified": "2019-07-30 23:47:53.566473",
"modified_by": "Administrator",
"module": "Stock",
"name": "Pick Ticket Item",
"name": "Pick List Item",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,

View File

@ -6,5 +6,5 @@ from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class PickTicketItem(Document):
class PickListItem(Document):
pass

View File

@ -1,7 +1,7 @@
// Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Pick Ticket Reference Item', {
frappe.ui.form.on('Pick List Reference Item', {
// refresh: function(frm) {
// }

View File

@ -46,7 +46,7 @@
"modified": "2019-07-30 23:43:30.901151",
"modified_by": "Administrator",
"module": "Stock",
"name": "Pick Ticket Reference Item",
"name": "Pick List Reference Item",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",

View File

@ -6,5 +6,5 @@ from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class PickTicketReferenceItem(Document):
class PickListReferenceItem(Document):
pass

View File

@ -1,100 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_dependencies = ['Item', 'Sales Invoice', 'Stock Entry', 'Batch']
from erpnext.selling.doctype.sales_order.sales_order import make_pick_ticket
class TestPickTicket(unittest.TestCase):
def test_pick_ticket_picks_warehouse_for_each_item(self):
pick_ticket = frappe.get_doc({
'doctype': 'Pick Ticket',
'company': '_Test Company',
'reference_items': [{
'item': '_Test Item Home Desktop 100',
'reference_doctype': 'Sales Order',
'qty': 5,
'reference_name': '_T-Sales Order-1',
}],
})
pick_ticket.set_item_locations()
self.assertEqual(pick_ticket.items_locations[0].item, '_Test Item Home Desktop 100')
self.assertEqual(pick_ticket.items_locations[0].warehouse, '_Test Warehouse - _TC')
self.assertEqual(pick_ticket.items_locations[0].qty, 5)
def test_pick_ticket_skips_out_of_stock_item(self):
pick_ticket = frappe.get_doc({
'doctype': 'Pick Ticket',
'company': '_Test Company',
'reference_items': [{
'item': '_Test Item Warehouse Group Wise Reorder',
'reference_doctype': 'Sales Order',
'qty': 1000,
'reference_name': '_T-Sales Order-1',
}],
})
pick_ticket.set_item_locations()
self.assertEqual(pick_ticket.items_locations[0].item, '_Test Item Warehouse Group Wise Reorder')
self.assertEqual(pick_ticket.items_locations[0].warehouse, '_Test Warehouse Group-C1 - _TC')
self.assertEqual(pick_ticket.items_locations[0].qty, 30)
def test_pick_ticket_skips_items_in_expired_batch(self):
pass
def test_pick_ticket_shows_serial_no_for_serialized_item(self):
stock_reconciliation = frappe.get_doc({
'doctype': 'Stock Reconciliation',
'company': '_Test Company',
'items': [{
'item_code': '_Test Serialized Item',
'warehouse': '_Test Warehouse - _TC',
'qty': 5,
'serial_no': '123450\n123451\n123452\n123453\n123454'
}]
})
stock_reconciliation.submit()
pick_ticket = frappe.get_doc({
'doctype': 'Pick Ticket',
'company': '_Test Company',
'reference_items': [{
'item': '_Test Serialized Item',
'reference_doctype': 'Sales Order',
'qty': 1000,
'reference_name': '_T-Sales Order-1',
}],
})
pick_ticket.set_item_locations()
self.assertEqual(pick_ticket.items_locations[0].item, '_Test Serialized Item')
self.assertEqual(pick_ticket.items_locations[0].warehouse, '_Test Warehouse Group-C1 - _TC')
self.assertEqual(pick_ticket.items_locations[0].qty, 30)
self.assertEqual(pick_ticket.items_locations[0].serial_no, 30)
def test_pick_ticket_for_multiple_reference_doctypes(self):
pass
## records required
'''
batch no
items
sales invoice
stock entries
bin
stock ledger entry
warehouses
'''