[redesign] replace document flow with dashboard, sorry @saurabh6790, fixes #5792

This commit is contained in:
Rushabh Mehta 2016-07-20 22:53:23 +05:30
parent 39077d4210
commit 5a39d41a0c
14 changed files with 194 additions and 171 deletions

View File

@ -36,25 +36,6 @@ class PurchaseInvoice(BuyingController):
'overflow_type': 'billing'
}]
self.prev_link_mapper = {
"Purchase Order": {
"fieldname": "purchase_order",
"doctype": "Purchase Invoice Item",
"filters": [
["Purchase Invoice Item", "parent", "=", self.name],
["Purchase Invoice Item", "purchase_order", "!=", ""]
]
},
"Purchase Receipt": {
"fieldname": "purchase_receipt",
"doctype": "Purchase Invoice Item",
"filters": [
["Purchase Invoice Item", "parent", "=", self.name],
["Purchase Invoice Item", "purchase_receipt", "!=", ""]
]
}
}
def validate(self):
if not self.is_opening:
self.is_opening = 'No'
@ -666,4 +647,3 @@ def get_fixed_asset_account(asset, account=None):
filters={"parent": asset_category, "company_name": company}, fieldname="fixed_asset_account")
return account

View File

@ -0,0 +1,31 @@
from frappe import _
data = {
'fieldname': 'purchase_invoice',
'non_standard_fieldnames': {
'Delivery Note': 'against_sales_invoice',
'Journal Entry': 'reference_name',
'Payment Entry': 'reference_name',
'Payment Request': 'reference_name',
'Landed Cost Voucher': 'receipt_document',
'Purchase Invoice': 'return_against'
},
'internal_links': {
'Purchase Order': ['items', 'sales_order'],
'Purchase Receipt': ['items', 'delivery_note'],
},
'transactions': [
{
'label': _('Payment'),
'items': ['Payment Entry', 'Payment Request', 'Journal Entry']
},
{
'label': _('Reference'),
'items': ['Purchase Order', 'Purchase Receipt', 'Asset', 'Landed Cost Voucher']
},
{
'label': _('Returns'),
'items': ['Purchase Invoice']
},
]
}

View File

@ -40,25 +40,6 @@ class SalesInvoice(SellingController):
'overflow_type': 'billing'
}]
self.prev_link_mapper = {
"Sales Order": {
"fieldname": "sales_order",
"doctype": "Sales Invoice Item",
"filters": [
["Sales Invoice Item", "parent", "=", self.name],
["Sales Invoice Item", "sales_order", "!=", ""]
]
},
"Delivery Note": {
"fieldname": "delivery_note",
"doctype": "Sales Invoice Item",
"filters": [
["Sales Invoice Item", "parent", "=", self.name],
["Sales Invoice Item", "delivery_note", "!=", ""]
]
}
}
def set_indicator(self):
"""Set indicator for portal"""
if self.outstanding_amount > 0:

View File

@ -0,0 +1,30 @@
from frappe import _
data = {
'fieldname': 'sales_invoice',
'non_standard_fieldnames': {
'Delivery Note': 'against_sales_invoice',
'Journal Entry': 'reference_name',
'Payment Entry': 'reference_name',
'Payment Request': 'reference_name',
'Sales Invoice': 'return_against'
},
'internal_links': {
'Sales Order': ['items', 'sales_order'],
'Delivery Note': ['items', 'delivery_note'],
},
'transactions': [
{
'label': _('Payment'),
'items': ['Payment Entry', 'Payment Request', 'Journal Entry']
},
{
'label': _('Reference'),
'items': ['Timesheet', 'Delivery Note', 'Sales Order']
},
{
'label': _('Returns'),
'items': ['Sales Invoice']
},
]
}

View File

@ -33,17 +33,6 @@ class PurchaseOrder(BuyingController):
'overflow_type': 'order'
}]
self.prev_link_mapper = {
"Supplier Quotation": {
"fieldname": "supplier_quotation",
"doctype": "Purchase Order Item",
"filters": [
["Purchase Order Item", "parent", "=", self.name],
["Purchase Order Item", "supplier_quotation", "!=", ""]
]
}
}
def validate(self):
super(PurchaseOrder, self).validate()

View File

@ -0,0 +1,20 @@
from frappe import _
data = {
'fieldname': 'supplier_quotation',
'internal_links': {
'Material Request': ['items', 'material_request'],
'Request for Quotation': ['items', 'request_for_quotation'],
'Project': ['items', 'project'],
},
'transactions': [
{
'label': _('Related'),
'items': ['Purchase Order']
},
{
'label': _('Reference'),
'items': ['Material Request', 'Request for Quotation', 'Project']
},
]
}

View File

@ -26,8 +26,7 @@
"public/js/payment/pos_payment.html",
"public/js/payment/payment_details.html",
"public/js/templates/item_selector.html",
"public/js/utils/item_selector.js",
"public/js/utils/document_flow.js"
"public/js/utils/item_selector.js"
],
"js/item-dashboard.min.js": [
"stock/dashboard/item_dashboard.html",

View File

@ -33,7 +33,7 @@ $.extend(erpnext, {
setup_serial_no: function() {
var grid_row = cur_frm.open_grid_row();
if(!grid_row.fields_dict.serial_no ||
if(!grid_row || !grid_row.fields_dict.serial_no ||
grid_row.fields_dict.serial_no.get_status()!=="Write") return;
var $btn = $('<button class="btn btn-sm btn-default">'+__("Add Serial No")+'</button>')

View File

@ -1,27 +0,0 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// MIT License. See license.txt
// for module flow
$.extend(frappe.document_flow, {
"Selling": {
// "Sales Order": ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice", "Payment Entry"],
// "Quotation": ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice", "Payment Entry"]
},
"Accounts": {
"Sales Invoice": ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice", "Payment Entry"],
"Purchase Invoice": ["Supplier Quotation", "Purchase Order", "Purchase Receipt",
"Purchase Invoice", "Payment Entry"]
},
"Buying": {
// "Purchase Order": ["Supplier Quotation", "Purchase Order", "Purchase Receipt",
// "Purchase Invoice", "Payment Entry"],
"Supplier Quotation": ["Supplier Quotation", "Purchase Order", "Purchase Receipt",
"Purchase Invoice", "Payment Entry"]
},
"Stock": {
"Delivery Note": ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice", "Payment Entry"],
"Purchase Receipt": ["Supplier Quotation", "Purchase Order", "Purchase Receipt",
"Purchase Invoice", "Payment Entry"]
}
});

View File

@ -24,17 +24,6 @@ class SalesOrder(SellingController):
def __init__(self, arg1, arg2=None):
super(SalesOrder, self).__init__(arg1, arg2)
self.prev_link_mapper = {
"Quotation": {
"fieldname": "prevdoc_docname",
"doctype": "Sales Order Item",
"filters": [
["Sales Order Item", "parent", "=", self.name],
["Sales Order Item", "prevdoc_docname", "!=", ""]
]
}
}
def validate(self):
super(SalesOrder, self).validate()

View File

@ -61,18 +61,6 @@ class DeliveryNote(SellingController):
'extra_cond': """ and exists (select name from `tabDelivery Note` where name=`tabDelivery Note Item`.parent and is_return=1)"""
}]
self.prev_link_mapper = {
"Sales Order": {
"fieldname": "against_sales_order",
"doctype": "Delivery Note Item",
"filters": [
["Delivery Note Item", "parent", "=", self.name],
["Delivery Note Item", "against_sales_order", "!=", ""]
]
}
}
def before_print(self):
def toggle_print_hide(meta, fieldname):
df = meta.get_field(fieldname)

View File

@ -0,0 +1,26 @@
from frappe import _
data = {
'fieldname': 'delivery_note_no',
'non_standard_fieldnames': {
'Sales Invoice': 'delivery_note',
'Packing Slip': 'delivery_note',
},
'internal_links': {
'Sales Order': ['items', 'against_sales_order'],
},
'transactions': [
{
'label': _('Related'),
'items': ['Sales Invoice', 'Packing Slip']
},
{
'label': _('Reference'),
'items': ['Sales Order', 'Quality Inspection']
},
{
'label': _('Returns'),
'items': ['Stock Entry']
},
]
}

View File

@ -45,17 +45,6 @@ class PurchaseReceipt(BuyingController):
'extra_cond': """ and exists (select name from `tabPurchase Receipt` where name=`tabPurchase Receipt Item`.parent and is_return=1)"""
}]
self.prev_link_mapper = {
"Purchase Order": {
"fieldname": "purchase_order",
"doctype": "Purchase Receipt Item",
"filters": [
["Purchase Receipt Item", "parent", "=", self.name],
["Purchase Receipt Item", "purchase_order", "!=", ""]
]
}
}
def validate(self):
super(PurchaseReceipt, self).validate()

View File

@ -0,0 +1,28 @@
from frappe import _
data = {
'fieldname': 'purchase_receipt_no',
'non_standard_fieldnames': {
'Purchase Invoice': 'purchase_receipt',
'Landed Cost Voucher': 'receipt_document'
},
'internal_links': {
'Purchase Order': ['items', 'purchase_order'],
'Project': ['items', 'project'],
'Quality Inspection': ['items', 'qa_no'],
},
'transactions': [
{
'label': _('Related'),
'items': ['Purchase Invoice', 'Landed Cost Voucher']
},
{
'label': _('Reference'),
'items': ['Purchase Order', 'Quality Inspection', 'Project']
},
{
'label': _('Returns'),
'items': ['Stock Entry']
},
]
}