mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 02:01:21 +00:00
Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
@@ -317,6 +317,6 @@ cur_frm.pformat.sales_order_no= function(doc, cdt, cdn){
|
||||
|
||||
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||
if(cint(wn.boot.notification_settings.delivery_note)) {
|
||||
cur_frm.email_doc(wn.boot.notification_settings.delivery_note);
|
||||
cur_frm.email_doc(wn.boot.notification_settings.delivery_note_message);
|
||||
}
|
||||
}
|
||||
@@ -141,7 +141,7 @@ class DocType:
|
||||
'is_purchase_item' :'Is Purchase Item',
|
||||
'is_pro_applicable' :'Is Pro Applicable'}
|
||||
for d in fl:
|
||||
if cstr(self.doc.fields[d]) != 'Yes':
|
||||
if cstr(self.doc.fields.get(d)) != 'Yes':
|
||||
self.check_for_active_boms(check = fl[d])
|
||||
self.check_ref_rate_detail()
|
||||
self.fill_customer_code()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -32,13 +32,8 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
|
||||
cur_frm.cscript.onload_post_render = function(doc, dt, dn) {
|
||||
var callback = function(doc, dt, dn) {
|
||||
var callback1 = function(doc, dt, dn) {
|
||||
if(doc.__islocal){
|
||||
cur_frm.cscript.get_default_schedule_date(doc);
|
||||
}
|
||||
}
|
||||
// defined in purchase_common.js
|
||||
cur_frm.cscript.update_item_details(doc, dt, dn, callback1);
|
||||
cur_frm.cscript.update_item_details(doc, dt, dn, function(r,rt) { });
|
||||
}
|
||||
cur_frm.cscript.dynamic_label(doc, dt, dn, callback);
|
||||
}
|
||||
@@ -118,13 +113,6 @@ cur_frm.cscript.new_contact = function(){
|
||||
loaddoc('Contact', tn);
|
||||
}
|
||||
|
||||
//======================= posting date =============================
|
||||
cur_frm.cscript.transaction_date = function(doc,cdt,cdn){
|
||||
if(doc.__islocal){
|
||||
cur_frm.cscript.get_default_schedule_date(doc);
|
||||
}
|
||||
}
|
||||
|
||||
// ***************** Get project name *****************
|
||||
cur_frm.fields_dict['purchase_receipt_details'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) {
|
||||
return 'SELECT `tabProject`.name FROM `tabProject` \
|
||||
@@ -311,6 +299,6 @@ cur_frm.pformat.purchase_order_no = function(doc, cdt, cdn){
|
||||
|
||||
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||
if(cint(wn.boot.notification_settings.purchase_receipt)) {
|
||||
cur_frm.email_doc(wn.boot.notification_settings.purchase_receipt);
|
||||
cur_frm.email_doc(wn.boot.notification_settings.purchase_receipt_message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,19 +43,9 @@ class DocType(TransactionBase):
|
||||
def autoname(self):
|
||||
self.doc.name = make_autoname(self.doc.naming_series+'.#####')
|
||||
|
||||
|
||||
# Client Trigger Functions
|
||||
#----------------------------------------------------------------------------------------------------
|
||||
|
||||
def get_default_schedule_date(self):
|
||||
get_obj(dt = 'Purchase Common').get_default_schedule_date(self)
|
||||
|
||||
#-----------------Validation For Fiscal Year------------------------
|
||||
def validate_fiscal_year(self):
|
||||
get_obj(dt = 'Purchase Common').validate_fiscal_year(self.doc.fiscal_year,self.doc.posting_date,'Transaction Date')
|
||||
|
||||
|
||||
# Get Item Details
|
||||
def get_item_details(self, arg = ''):
|
||||
if arg:
|
||||
return get_obj(dt='Purchase Common').get_item_details(self,arg)
|
||||
|
||||
192
stock/doctype/purchase_receipt/test_purchase_receipt.py
Normal file
192
stock/doctype/purchase_receipt/test_purchase_receipt.py
Normal file
@@ -0,0 +1,192 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import unittest
|
||||
import webnotes
|
||||
import webnotes.model
|
||||
from webnotes.utils import nowdate
|
||||
from accounts.utils import get_fiscal_year
|
||||
|
||||
company = webnotes.conn.get_default("company")
|
||||
abbr = webnotes.conn.get_value("Company", company, "abbr")
|
||||
|
||||
def load_data():
|
||||
insert_accounts()
|
||||
|
||||
# create default warehouse
|
||||
if not webnotes.conn.exists("Warehouse", "Default Warehouse"):
|
||||
webnotes.insert({"doctype": "Warehouse",
|
||||
"warehouse_name": "Default Warehouse",
|
||||
"warehouse_type": "Stores"})
|
||||
|
||||
# create UOM: Nos.
|
||||
if not webnotes.conn.exists("UOM", "Nos"):
|
||||
webnotes.insert({"doctype": "UOM", "uom_name": "Nos"})
|
||||
|
||||
from webnotes.tests import insert_test_data
|
||||
# create item groups and items
|
||||
insert_test_data("Item Group",
|
||||
sort_fn=lambda ig: (ig[0].get('parent_item_group'), ig[0].get('name')))
|
||||
insert_test_data("Item")
|
||||
|
||||
# create supplier type
|
||||
webnotes.insert({"doctype": "Supplier Type", "supplier_type": "Manufacturing"})
|
||||
|
||||
# create supplier
|
||||
webnotes.insert({"doctype": "Supplier", "supplier_name": "East Wind Inc.",
|
||||
"supplier_type": "Manufacturing", "company": company})
|
||||
|
||||
# create default cost center if not exists
|
||||
if not webnotes.conn.exists("Cost Center", "Default Cost Center - %s" % abbr):
|
||||
dl = webnotes.insert({"doctype": "Cost Center", "group_or_ledger": "Ledger",
|
||||
"cost_center_name": "Default Cost Center",
|
||||
"parent_cost_center": "Root - %s" % abbr,
|
||||
"company_name": company, "company_abbr": abbr})
|
||||
|
||||
# create account heads for taxes
|
||||
|
||||
webnotes.insert({"doctype": "Account", "account_name": "Shipping Charges",
|
||||
"parent_account": "Stock Expenses - %s" % abbr, "company": company,
|
||||
"group_or_ledger": "Ledger"})
|
||||
|
||||
webnotes.insert({"doctype": "Account", "account_name": "Customs Duty",
|
||||
"parent_account": "Stock Expenses - %s" % abbr, "company": company,
|
||||
"group_or_ledger": "Ledger"})
|
||||
webnotes.insert({"doctype": "Account", "account_name": "Tax Assets",
|
||||
"parent_account": "Current Assets - %s" % abbr, "company": company,
|
||||
"group_or_ledger": "Group"})
|
||||
webnotes.insert({"doctype": "Account", "account_name": "VAT - Test",
|
||||
"parent_account": "Tax Assets - %s" % abbr, "company": company,
|
||||
"group_or_ledger": "Ledger"})
|
||||
|
||||
# create BOM
|
||||
webnotes.insert([
|
||||
{"doctype": "BOM", "item": "Nebula 7", "quantity": 1,
|
||||
"is_active": "Yes", "is_default": 1, "uom": "Nos"},
|
||||
{"doctype": "BOM Operation", "operation_no": 1, "parentfield": "bom_operations",
|
||||
"opn_description": "Development"},
|
||||
{"doctype": "BOM Item", "item_code": "Android Jack D", "operation_no": 1,
|
||||
"qty": 5, "rate": 20, "amount": 100, "stock_uom": "Nos",
|
||||
"parentfield": "bom_materials"}
|
||||
])
|
||||
|
||||
|
||||
base_purchase_receipt = [
|
||||
{
|
||||
"doctype": "Purchase Receipt", "supplier": "East Wind Inc.",
|
||||
"naming_series": "PR", "posting_date": nowdate(), "posting_time": "12:05",
|
||||
"company": company, "fiscal_year": webnotes.conn.get_default("fiscal_year"),
|
||||
"currency": webnotes.conn.get_default("currency"), "conversion_rate": 1
|
||||
},
|
||||
{
|
||||
"doctype": "Purchase Receipt Item",
|
||||
"item_code": "Home Desktop 100",
|
||||
"qty": 10, "received_qty": 10, "rejected_qty": 0, "purchase_rate": 50,
|
||||
"amount": 500, "warehouse": "Default Warehouse", "valuation_tax_amount": 250,
|
||||
"parentfield": "purchase_receipt_details",
|
||||
"conversion_factor": 1, "uom": "Nos", "stock_uom": "Nos"
|
||||
},
|
||||
{
|
||||
"doctype": "Purchase Taxes and Charges", "charge_type": "Actual",
|
||||
"account_head": "Shipping Charges - %s" % abbr, "purchase_rate": 100, "tax_amount": 100,
|
||||
"category": "Valuation and Total", "parentfield": "purchase_tax_details",
|
||||
"cost_center": "Default Cost Center - %s" % abbr
|
||||
},
|
||||
{
|
||||
"doctype": "Purchase Taxes and Charges", "charge_type": "Actual",
|
||||
"account_head": "VAT - Test - %s" % abbr, "purchase_rate": 120, "tax_amount": 120,
|
||||
"category": "Total", "parentfield": "purchase_tax_details"
|
||||
},
|
||||
{
|
||||
"doctype": "Purchase Taxes and Charges", "charge_type": "Actual",
|
||||
"account_head": "Customs Duty - %s" % abbr, "purchase_rate": 150, "tax_amount": 150,
|
||||
"category": "Valuation", "parentfield": "purchase_tax_details",
|
||||
"cost_center": "Default Cost Center - %s" % abbr
|
||||
}
|
||||
]
|
||||
|
||||
def insert_accounts():
|
||||
for d in webnotes.conn.sql("""select name, abbr from tabCompany""", as_dict=1):
|
||||
acc_list = [
|
||||
make_account_dict('Stock Assets', 'Current Assets', d, 'Group'),
|
||||
make_account_dict('Stock In Hand', 'Stock Assets', d, 'Ledger'),
|
||||
make_account_dict('Stock Delivered But Not Billed', 'Stock Assets',
|
||||
d, 'Ledger'),
|
||||
make_account_dict('Stock Liabilities', 'Current Liabilities', d, 'Group'),
|
||||
make_account_dict('Stock Received But Not Billed', 'Stock Liabilities',
|
||||
d, 'Ledger'),
|
||||
make_account_dict('Stock Expenses', 'Direct Expenses', d, 'Group'),
|
||||
make_account_dict('Stock Variance', 'Stock Expenses', d, 'Ledger'),
|
||||
make_account_dict('Expenses Included In Valuation', 'Stock Expenses',
|
||||
d, 'Ledger'),
|
||||
]
|
||||
for acc in acc_list:
|
||||
acc_name = "%s - %s" % (acc['account_name'], d['abbr'])
|
||||
if not webnotes.conn.exists('Account', acc_name):
|
||||
webnotes.insert(acc)
|
||||
else:
|
||||
print "Account %s already exists" % acc_name
|
||||
|
||||
def make_account_dict(account, parent, company_detail, group_or_ledger):
|
||||
return {
|
||||
"doctype": "Account",
|
||||
"account_name": account,
|
||||
"parent_account": "%s - %s" % (parent, company_detail['abbr']),
|
||||
"company": company_detail['name'],
|
||||
"group_or_ledger": group_or_ledger
|
||||
}
|
||||
|
||||
|
||||
class TestPurchaseReceipt(unittest.TestCase):
|
||||
def setUp(self):
|
||||
webnotes.conn.begin()
|
||||
load_data()
|
||||
webnotes.conn.set_value("Global Defaults", None, "automatic_inventory_accounting", 1)
|
||||
|
||||
|
||||
def test_purchase_receipt(self):
|
||||
# warehouse does not have stock in hand specified
|
||||
self.run_purchase_receipt_test(base_purchase_receipt,
|
||||
"Stock In Hand - %s" % (abbr,),
|
||||
"Stock Received But Not Billed - %s" % (abbr,), 750.0)
|
||||
|
||||
def run_purchase_receipt_test(self, purchase_receipt, debit_account,
|
||||
credit_account, stock_value):
|
||||
from webnotes.model.doclist import DocList
|
||||
dl = webnotes.insert(DocList(purchase_receipt))
|
||||
dl.submit()
|
||||
dl.load_from_db()
|
||||
|
||||
gle = webnotes.conn.sql("""select account, ifnull(debit, 0), ifnull(credit, 0)
|
||||
from `tabGL Entry` where voucher_no = %s""", dl.doclist[0].name)
|
||||
|
||||
gle_map = dict(((entry[0], entry) for entry in gle))
|
||||
|
||||
self.assertEquals(gle_map[debit_account], (debit_account, stock_value, 0.0))
|
||||
self.assertEquals(gle_map[credit_account], (credit_account, 0.0, stock_value))
|
||||
|
||||
def atest_subcontracting(self):
|
||||
pr = base_purchase_receipt.copy()
|
||||
pr[1].update({"item_code": "Nebula 7"})
|
||||
|
||||
self.run_purchase_receipt_test(pr,
|
||||
"Stock In Hand - %s" % (abbr,),
|
||||
"Stock Received But Not Billed - %s" % (abbr,), 1750.0)
|
||||
|
||||
def tearDown(self):
|
||||
webnotes.conn.rollback()
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,314 +1,296 @@
|
||||
# DocType, Warehouse
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-10-10 12:07:10',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-10-25 15:03:49',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all DocType
|
||||
{
|
||||
'_last_update': u'1319016431',
|
||||
'allow_trash': 1,
|
||||
'autoname': u'field:warehouse_name',
|
||||
'colour': u'White:FFF',
|
||||
'default_print_format': u'Standard',
|
||||
'description': u'A logical Warehouse against which stock entries are made.\n\nThere are two main Warehouse Types that are significant in ERPNext.\n\n1. **Stores:** These are where your incoming **Items** are kept before they are consumed or sold. You can have as many \u201cStores\u201d type **Warehouses** as you wish. Stores type warehouses are significant because if you set an Item for automatic re-order, ERPNext will check its quantities in all \u201cStores\u201d type **Warehouses** when deciding whether to re-order or not.\n\n2. **Asset**: **Items** marked as type \u201cFixed Asset\u201d are maintained in Asset Type **Warehouses**. This helps you separate them for the **Items** that are consumed as a part of your regular operations or \u201cCost of Goods Sold\u201d.\n',
|
||||
u'doctype': u'DocType',
|
||||
'document_type': u'Master',
|
||||
'module': u'Stock',
|
||||
u'name': u'__common__',
|
||||
'search_fields': u'warehouse_type',
|
||||
'section_style': u'Tabbed',
|
||||
'server_code_error': u' ',
|
||||
'show_in_menu': 0,
|
||||
'version': 1
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
{
|
||||
u'doctype': u'DocField',
|
||||
u'name': u'__common__',
|
||||
'parent': u'Warehouse',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
|
||||
# These values are common for all DocPerm
|
||||
{
|
||||
u'doctype': u'DocPerm',
|
||||
u'name': u'__common__',
|
||||
'parent': u'Warehouse',
|
||||
'parentfield': u'permissions',
|
||||
'parenttype': u'DocType',
|
||||
'read': 1
|
||||
},
|
||||
|
||||
# DocType, Warehouse
|
||||
{
|
||||
u'doctype': u'DocType',
|
||||
u'name': u'Warehouse'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'warehouse_detail',
|
||||
'fieldtype': u'Section Break',
|
||||
'label': u'Warehouse Detail',
|
||||
'oldfieldtype': u'Section Break',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'warehouse_name',
|
||||
'fieldtype': u'Data',
|
||||
'label': u'Warehouse Name',
|
||||
'oldfieldname': u'warehouse_name',
|
||||
'oldfieldtype': u'Data',
|
||||
'permlevel': 0,
|
||||
'reqd': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'warehouse_type',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Warehouse Type',
|
||||
'oldfieldname': u'warehouse_type',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Warehouse Type',
|
||||
'permlevel': 0,
|
||||
'reqd': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'company',
|
||||
'fieldtype': u'Link',
|
||||
'in_filter': 1,
|
||||
'label': u'Company',
|
||||
'oldfieldname': u'company',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Company',
|
||||
'permlevel': 0,
|
||||
'search_index': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'For Reference Only.',
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'warehouse_contact_info',
|
||||
'fieldtype': u'Section Break',
|
||||
'label': u'Warehouse Contact Info',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'email_id',
|
||||
'fieldtype': u'Data',
|
||||
'hidden': 1,
|
||||
'label': u'Email Id',
|
||||
'oldfieldname': u'email_id',
|
||||
'oldfieldtype': u'Data',
|
||||
'permlevel': 0,
|
||||
'print_hide': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'phone_no',
|
||||
'fieldtype': u'Data',
|
||||
'label': u'Phone No',
|
||||
'oldfieldname': u'phone_no',
|
||||
'oldfieldtype': u'Int',
|
||||
'options': u'Phone',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'mobile_no',
|
||||
'fieldtype': u'Data',
|
||||
'label': u'Mobile No',
|
||||
'oldfieldname': u'mobile_no',
|
||||
'oldfieldtype': u'Int',
|
||||
'options': u'Phone',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'column_break0',
|
||||
'fieldtype': u'Column Break',
|
||||
'oldfieldtype': u'Column Break',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'address_line_1',
|
||||
'fieldtype': u'Data',
|
||||
'label': u'Address Line 1',
|
||||
'oldfieldname': u'address_line_1',
|
||||
'oldfieldtype': u'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'address_line_2',
|
||||
'fieldtype': u'Data',
|
||||
'label': u'Address Line 2',
|
||||
'oldfieldname': u'address_line_2',
|
||||
'oldfieldtype': u'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'city',
|
||||
'fieldtype': u'Data',
|
||||
'label': u'City',
|
||||
'oldfieldname': u'city',
|
||||
'oldfieldtype': u'Data',
|
||||
'permlevel': 0,
|
||||
'reqd': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'state',
|
||||
'fieldtype': u'Data',
|
||||
'label': u'State',
|
||||
'oldfieldname': u'state',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'Suggest',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'pin',
|
||||
'fieldtype': u'Int',
|
||||
'label': u'PIN',
|
||||
'oldfieldname': u'pin',
|
||||
'oldfieldtype': u'Int',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'This feature is for merging duplicate warehouses. It will replace all the links of this warehouse by "Merge With" warehouse. After merging you can delete this warehouse, as stock level for this warehouse will be zero.',
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'merge_warehouses_section',
|
||||
'fieldtype': u'Section Break',
|
||||
'label': u'Merge Warehouses',
|
||||
'permlevel': 2
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'merge_with',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Merge With',
|
||||
'options': u'Warehouse',
|
||||
'permlevel': 2
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'merge',
|
||||
'fieldtype': u'Button',
|
||||
'label': u'Merge',
|
||||
'permlevel': 2
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 1,
|
||||
'create': 1,
|
||||
u'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Material Master Manager',
|
||||
'submit': 0,
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 1,
|
||||
'create': 1,
|
||||
u'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'System Manager',
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
u'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Material Manager',
|
||||
'submit': 0,
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
u'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Material User',
|
||||
'submit': 0,
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
u'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'All'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'create': 0,
|
||||
u'doctype': u'DocPerm',
|
||||
'permlevel': 2,
|
||||
'role': u'System Manager',
|
||||
'write': 1
|
||||
}
|
||||
{
|
||||
"owner": "Administrator",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-10-26 14:47:52",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-12-03 11:24:31"
|
||||
},
|
||||
{
|
||||
"autoname": "field:warehouse_name",
|
||||
"description": "A logical Warehouse against which stock entries are made.",
|
||||
"default_print_format": "Standard",
|
||||
"allow_rename": 1,
|
||||
"search_fields": "warehouse_type",
|
||||
"module": "Stock",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Master",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
"parent": "Warehouse",
|
||||
"doctype": "DocField",
|
||||
"parenttype": "DocType",
|
||||
"parentfield": "fields"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
"parent": "Warehouse",
|
||||
"read": 1,
|
||||
"doctype": "DocPerm",
|
||||
"parenttype": "DocType",
|
||||
"parentfield": "permissions"
|
||||
},
|
||||
{
|
||||
"name": "Warehouse",
|
||||
"doctype": "DocType"
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Section Break",
|
||||
"doctype": "DocField",
|
||||
"label": "Warehouse Detail",
|
||||
"fieldname": "warehouse_detail",
|
||||
"fieldtype": "Section Break",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Data",
|
||||
"doctype": "DocField",
|
||||
"label": "Warehouse Name",
|
||||
"oldfieldname": "warehouse_name",
|
||||
"fieldname": "warehouse_name",
|
||||
"fieldtype": "Data",
|
||||
"reqd": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Link",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Warehouse Type",
|
||||
"oldfieldname": "warehouse_type",
|
||||
"options": "Warehouse Type",
|
||||
"fieldname": "warehouse_type",
|
||||
"fieldtype": "Link",
|
||||
"reqd": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Link",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Company",
|
||||
"oldfieldname": "company",
|
||||
"options": "Company",
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Link",
|
||||
"search_index": 1,
|
||||
"permlevel": 0,
|
||||
"in_filter": 1
|
||||
},
|
||||
{
|
||||
"description": "For Reference Only.",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Warehouse Contact Info",
|
||||
"fieldname": "warehouse_contact_info",
|
||||
"fieldtype": "Section Break",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"print_hide": 0,
|
||||
"oldfieldtype": "Data",
|
||||
"doctype": "DocField",
|
||||
"label": "Email Id",
|
||||
"oldfieldname": "email_id",
|
||||
"fieldname": "email_id",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Int",
|
||||
"doctype": "DocField",
|
||||
"label": "Phone No",
|
||||
"oldfieldname": "phone_no",
|
||||
"options": "Phone",
|
||||
"fieldname": "phone_no",
|
||||
"fieldtype": "Data",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Int",
|
||||
"doctype": "DocField",
|
||||
"label": "Mobile No",
|
||||
"oldfieldname": "mobile_no",
|
||||
"options": "Phone",
|
||||
"fieldname": "mobile_no",
|
||||
"fieldtype": "Data",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Column Break",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "column_break0",
|
||||
"fieldtype": "Column Break",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Data",
|
||||
"doctype": "DocField",
|
||||
"label": "Address Line 1",
|
||||
"oldfieldname": "address_line_1",
|
||||
"fieldname": "address_line_1",
|
||||
"fieldtype": "Data",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Data",
|
||||
"doctype": "DocField",
|
||||
"label": "Address Line 2",
|
||||
"oldfieldname": "address_line_2",
|
||||
"fieldname": "address_line_2",
|
||||
"fieldtype": "Data",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Data",
|
||||
"doctype": "DocField",
|
||||
"label": "City",
|
||||
"oldfieldname": "city",
|
||||
"fieldname": "city",
|
||||
"fieldtype": "Data",
|
||||
"reqd": 0,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Select",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "State",
|
||||
"oldfieldname": "state",
|
||||
"options": "Suggest",
|
||||
"fieldname": "state",
|
||||
"fieldtype": "Data",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Int",
|
||||
"doctype": "DocField",
|
||||
"label": "PIN",
|
||||
"oldfieldname": "pin",
|
||||
"fieldname": "pin",
|
||||
"fieldtype": "Int",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "This feature is for merging duplicate warehouses. It will replace all the links of this warehouse by \"Merge With\" warehouse. After merging you can delete this warehouse, as stock level for this warehouse will be zero.",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Merge Warehouses",
|
||||
"fieldname": "merge_warehouses_section",
|
||||
"fieldtype": "Section Break",
|
||||
"permlevel": 2
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"label": "Merge With",
|
||||
"options": "Warehouse",
|
||||
"fieldname": "merge_with",
|
||||
"fieldtype": "Link",
|
||||
"permlevel": 2
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"label": "Merge",
|
||||
"fieldname": "merge",
|
||||
"fieldtype": "Button",
|
||||
"permlevel": 2
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Material User",
|
||||
"permlevel": 2
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Material User",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Material User",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Material Manager",
|
||||
"permlevel": 2
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Material Manager",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Material Manager",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"role": "All",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 1,
|
||||
"cancel": 1,
|
||||
"role": "Material Master Manager",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"role": "Material Master Manager",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"write": 1,
|
||||
"role": "System Manager",
|
||||
"cancel": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"write": 1,
|
||||
"role": "System Manager",
|
||||
"permlevel": 2
|
||||
}
|
||||
]
|
||||
@@ -1,27 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import unittest
|
||||
|
||||
import sys
|
||||
sys.path.append('/Users/rushabh/Workbench/www/wnframework/cgi-bin/')
|
||||
sys.path.append('/Users/rushabh/Workbench/www/erpnext/')
|
||||
|
||||
from material_management.doctype.delivery_note.tests import *
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user