Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
commit
4c70cd974a
@ -23,6 +23,11 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
// Refresh
|
||||
// -----------------------------------------
|
||||
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
if(doc.__islocal) {
|
||||
msgprint("Please create new account from Chart of Accounts.");
|
||||
throw "cannot create";
|
||||
}
|
||||
|
||||
cur_frm.toggle_display('account_name', doc.__islocal);
|
||||
|
||||
// hide fields if group
|
||||
@ -34,7 +39,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
'is_pl_account', 'company'], false);
|
||||
|
||||
// read-only for root accounts
|
||||
root_acc = ['Application of Funds (Assets)','Expenses','Income','Source of Funds (Liabilities)'];
|
||||
root_acc = doc.parent ? false : true;
|
||||
if(in_list(root_acc, doc.account_name)) {
|
||||
cur_frm.perm = [[1,0,0], [1,0,0]];
|
||||
cur_frm.set_intro("This is a root account and cannot be edited.");
|
||||
@ -48,7 +53,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
cur_frm.cscript.account_type(doc, cdt, cdn);
|
||||
|
||||
// show / hide convert buttons
|
||||
cur_frm.cscript.hide_unhide_group_ledger(doc);
|
||||
cur_frm.cscript.add_toolbar_buttons(doc);
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,7 +81,10 @@ cur_frm.cscript.account_type = function(doc, cdt, cdn) {
|
||||
|
||||
// Hide/unhide group or ledger
|
||||
// -----------------------------------------
|
||||
cur_frm.cscript.hide_unhide_group_ledger = function(doc) {
|
||||
cur_frm.cscript.add_toolbar_buttons = function(doc) {
|
||||
cur_frm.add_custom_button('Chart of Accounts',
|
||||
function() { wn.set_route("Accounts Browser", "Account"); }, 'icon-list')
|
||||
|
||||
if (cstr(doc.group_or_ledger) == 'Group') {
|
||||
cur_frm.add_custom_button('Convert to Ledger',
|
||||
function() { cur_frm.cscript.convert_to_ledger(); }, 'icon-retweet')
|
||||
|
@ -61,10 +61,13 @@ class DocType:
|
||||
elif par and not self.doc.is_pl_account:
|
||||
self.doc.is_pl_account = par[0][2]
|
||||
self.doc.debit_or_credit = par[0][3]
|
||||
elif self.doc.account_name not in ['Income','Source of Funds (Liabilities)',\
|
||||
'Expenses','Application of Funds (Assets)']:
|
||||
msgprint("Parent Account is mandatory", raise_exception=1)
|
||||
|
||||
def validate_max_root_accounts(self):
|
||||
if webnotes.conn.sql("""select count(*) from tabAccount where
|
||||
company=%s and ifnull(parent_account,'')='' and docstatus != 2""",
|
||||
self.doc.company)[0][0] > 4:
|
||||
webnotes.msgprint("One company cannot have more than 4 root Accounts",
|
||||
raise_exception=1)
|
||||
|
||||
# Account name must be unique
|
||||
def validate_duplicate_account(self):
|
||||
@ -74,21 +77,10 @@ class DocType:
|
||||
|
||||
def validate_root_details(self):
|
||||
#does not exists parent
|
||||
if self.doc.account_name in ['Income','Source of Funds', 'Expenses','Application of Funds'] and self.doc.parent_account:
|
||||
msgprint("You can not assign parent for root account", raise_exception=1)
|
||||
|
||||
# Debit / Credit
|
||||
if self.doc.account_name in ['Income','Source of Funds']:
|
||||
self.doc.debit_or_credit = 'Credit'
|
||||
elif self.doc.account_name in ['Expenses','Application of Funds']:
|
||||
self.doc.debit_or_credit = 'Debit'
|
||||
|
||||
# Is PL Account
|
||||
if self.doc.account_name in ['Income','Expenses']:
|
||||
self.doc.is_pl_account = 'Yes'
|
||||
elif self.doc.account_name in ['Source of Funds','Application of Funds']:
|
||||
self.doc.is_pl_account = 'No'
|
||||
|
||||
if webnotes.conn.exists("Account", self.doc.name):
|
||||
if not webnotes.conn.get_value("Account", self.doc.name, "parent_account"):
|
||||
webnotes.msgprint("Root cannot be edited.", raise_exception=1)
|
||||
|
||||
def convert_group_to_ledger(self):
|
||||
if self.check_if_child_exists():
|
||||
msgprint("Account: %s has existing child. You can not convert this account to ledger" % (self.doc.name), raise_exception=1)
|
||||
@ -144,6 +136,7 @@ class DocType:
|
||||
|
||||
def on_update(self):
|
||||
# update nsm
|
||||
self.validate_max_root_accounts()
|
||||
self.update_nsm_model()
|
||||
|
||||
# Check user role for approval process
|
||||
@ -189,10 +182,13 @@ class DocType:
|
||||
def on_rename(self,newdn,olddn):
|
||||
company_abbr = sql("select tc.abbr from `tabAccount` ta, `tabCompany` tc where ta.company = tc.name and ta.name=%s", olddn)[0][0]
|
||||
|
||||
newdnchk = newdn.split(" - ")
|
||||
parts = newdn.split(" - ")
|
||||
|
||||
if newdnchk[-1].lower() != company_abbr.lower():
|
||||
msgprint("Please add company abbreviation <b>%s</b>" %(company_abbr), raise_exception=1)
|
||||
else:
|
||||
account_name = " - ".join(newdnchk[:-1])
|
||||
sql("update `tabAccount` set account_name = '%s' where name = '%s'" %(account_name,olddn))
|
||||
if parts[-1].lower() != company_abbr.lower():
|
||||
parts.append(company_abbr)
|
||||
|
||||
account_name = " - ".join(parts[:-1])
|
||||
sql("update `tabAccount` set account_name = '%s' where name = '%s'" % \
|
||||
(account_name,olddn))
|
||||
|
||||
return " - ".join(parts)
|
||||
|
@ -1,396 +1,324 @@
|
||||
# DocType, Account
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2012-07-03 13:30:50',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-07-11 13:58:44',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all DocType
|
||||
{
|
||||
'_last_update': u'1325570645',
|
||||
'allow_copy': 1,
|
||||
'allow_trash': 1,
|
||||
'colour': u'White:FFF',
|
||||
'default_print_format': u'Standard',
|
||||
'description': u'An **Account** is heading under which financial and business transactions are carried on. For example, \u201cTravel Expense\u201d is an account, \u201cCustomer Zoe\u201d, \u201cSupplier Mae\u201d are accounts. \n\n**Note:** ERPNext creates accounts for Customers and Suppliers automatically.\n\n### Groups and Ledgers\n\nThere are two main kinds of Accounts in ERPNext - Group and Ledger. Groups can have sub-groups and ledgers within them, whereas ledgers are the leaf nodes of your chart and cannot be further classified.\n\nAccounting Transactions can only be made against Ledger Accounts (not Groups)\n',
|
||||
'doctype': 'DocType',
|
||||
'document_type': u'Master',
|
||||
'in_create': 1,
|
||||
'module': u'Accounts',
|
||||
'name': '__common__',
|
||||
'search_fields': u'debit_or_credit, group_or_ledger',
|
||||
'section_style': u'Tray',
|
||||
'server_code_error': u' ',
|
||||
'show_in_menu': 0,
|
||||
'version': 1
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Account',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
|
||||
# These values are common for all DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'name': '__common__',
|
||||
'parent': u'Account',
|
||||
'parentfield': u'permissions',
|
||||
'parenttype': u'DocType',
|
||||
'read': 1,
|
||||
'submit': 0
|
||||
},
|
||||
|
||||
# DocType, Account
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Account'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Auditor',
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Auditor',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 2,
|
||||
'role': u'Auditor',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Sales User',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Purchase User',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Accounts User',
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 1,
|
||||
'create': 1,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Accounts Manager',
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Accounts User',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Accounts Manager',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 2,
|
||||
'role': u'Accounts Manager',
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 2,
|
||||
'role': u'Accounts User',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'properties',
|
||||
'fieldtype': u'Section Break',
|
||||
'label': u'Account Details',
|
||||
'oldfieldtype': u'Section Break',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'column_break0',
|
||||
'fieldtype': u'Column Break',
|
||||
'permlevel': 0,
|
||||
'width': u'50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'account_name',
|
||||
'fieldtype': u'Data',
|
||||
'in_filter': 1,
|
||||
'label': u'Account Name',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': u'account_name',
|
||||
'oldfieldtype': u'Data',
|
||||
'permlevel': 1,
|
||||
'reqd': 1,
|
||||
'search_index': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'level',
|
||||
'fieldtype': u'Int',
|
||||
'hidden': 1,
|
||||
'label': u'Level',
|
||||
'oldfieldname': u'level',
|
||||
'oldfieldtype': u'Int',
|
||||
'permlevel': 1,
|
||||
'print_hide': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'default': u'Ledger',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'group_or_ledger',
|
||||
'fieldtype': u'Select',
|
||||
'in_filter': 1,
|
||||
'label': u'Group or Ledger',
|
||||
'oldfieldname': u'group_or_ledger',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'\nLedger\nGroup',
|
||||
'permlevel': 1,
|
||||
'reqd': 1,
|
||||
'search_index': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'debit_or_credit',
|
||||
'fieldtype': u'Data',
|
||||
'in_filter': 1,
|
||||
'label': u'Debit or Credit',
|
||||
'oldfieldname': u'debit_or_credit',
|
||||
'oldfieldtype': u'Data',
|
||||
'permlevel': 1,
|
||||
'search_index': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'is_pl_account',
|
||||
'fieldtype': u'Select',
|
||||
'in_filter': 1,
|
||||
'label': u'Is PL Account',
|
||||
'oldfieldname': u'is_pl_account',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'Yes\nNo',
|
||||
'permlevel': 1,
|
||||
'search_index': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'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': 1,
|
||||
'reqd': 1,
|
||||
'search_index': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'column_break1',
|
||||
'fieldtype': u'Column Break',
|
||||
'permlevel': 0,
|
||||
'width': u'50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'parent_account',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Parent Account',
|
||||
'oldfieldname': u'parent_account',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Account',
|
||||
'permlevel': 0,
|
||||
'search_index': 1,
|
||||
'trigger': u'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'Setting Account Type helps in selecting this Account in transactions.',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'account_type',
|
||||
'fieldtype': u'Select',
|
||||
'in_filter': 1,
|
||||
'label': u'Account Type',
|
||||
'oldfieldname': u'account_type',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'\nFixed Asset Account\nBank or Cash\nExpense Account\nTax\nIncome Account\nChargeable',
|
||||
'permlevel': 0,
|
||||
'search_index': 0,
|
||||
'trigger': u'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'Rate at which this tax is applied',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'tax_rate',
|
||||
'fieldtype': u'Currency',
|
||||
'hidden': 0,
|
||||
'label': u'Rate',
|
||||
'oldfieldname': u'tax_rate',
|
||||
'oldfieldtype': u'Currency',
|
||||
'permlevel': 0,
|
||||
'reqd': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'If the account is frozen, entries are allowed for the "Account Manager" only.',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'freeze_account',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Frozen',
|
||||
'oldfieldname': u'freeze_account',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'No\nYes',
|
||||
'permlevel': 2
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'credit_days',
|
||||
'fieldtype': u'Int',
|
||||
'hidden': 1,
|
||||
'label': u'Credit Days',
|
||||
'oldfieldname': u'credit_days',
|
||||
'oldfieldtype': u'Int',
|
||||
'permlevel': 0,
|
||||
'print_hide': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'credit_limit',
|
||||
'fieldtype': u'Currency',
|
||||
'hidden': 1,
|
||||
'label': u'Credit Limit',
|
||||
'oldfieldname': u'credit_limit',
|
||||
'oldfieldtype': u'Currency',
|
||||
'permlevel': 0,
|
||||
'print_hide': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'If this Account represents a Customer, Supplier or Employee, set it here.',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'master_type',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Master Type',
|
||||
'oldfieldname': u'master_type',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'\nSupplier\nCustomer\nEmployee',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'master_name',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Master Name',
|
||||
'oldfieldname': u'master_name',
|
||||
'oldfieldtype': u'Link',
|
||||
'permlevel': 0,
|
||||
'trigger': u'Client'
|
||||
}
|
||||
{
|
||||
"owner": "Administrator",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-11-16 10:32:50",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-12-03 11:26:49"
|
||||
},
|
||||
{
|
||||
"in_create": 1,
|
||||
"search_fields": "debit_or_credit, group_or_ledger",
|
||||
"module": "Accounts",
|
||||
"document_type": "Master",
|
||||
"description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.",
|
||||
"name": "__common__",
|
||||
"default_print_format": "Standard",
|
||||
"allow_rename": 1,
|
||||
"doctype": "DocType",
|
||||
"allow_copy": 1
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
"parent": "Account",
|
||||
"doctype": "DocField",
|
||||
"parenttype": "DocType",
|
||||
"parentfield": "fields"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
"parent": "Account",
|
||||
"amend": 0,
|
||||
"submit": 0,
|
||||
"doctype": "DocPerm",
|
||||
"read": 1,
|
||||
"parenttype": "DocType",
|
||||
"parentfield": "permissions"
|
||||
},
|
||||
{
|
||||
"name": "Account",
|
||||
"doctype": "DocType"
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Section Break",
|
||||
"doctype": "DocField",
|
||||
"label": "Account Details",
|
||||
"fieldname": "properties",
|
||||
"fieldtype": "Section Break",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"width": "50%",
|
||||
"fieldname": "column_break0",
|
||||
"fieldtype": "Column Break",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"no_copy": 1,
|
||||
"oldfieldtype": "Data",
|
||||
"doctype": "DocField",
|
||||
"label": "Account Name",
|
||||
"oldfieldname": "account_name",
|
||||
"fieldname": "account_name",
|
||||
"fieldtype": "Data",
|
||||
"search_index": 1,
|
||||
"reqd": 1,
|
||||
"permlevel": 1,
|
||||
"in_filter": 1
|
||||
},
|
||||
{
|
||||
"print_hide": 1,
|
||||
"oldfieldtype": "Int",
|
||||
"doctype": "DocField",
|
||||
"label": "Level",
|
||||
"oldfieldname": "level",
|
||||
"fieldname": "level",
|
||||
"fieldtype": "Int",
|
||||
"hidden": 1,
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"default": "Ledger",
|
||||
"oldfieldtype": "Select",
|
||||
"doctype": "DocField",
|
||||
"label": "Group or Ledger",
|
||||
"oldfieldname": "group_or_ledger",
|
||||
"permlevel": 1,
|
||||
"fieldname": "group_or_ledger",
|
||||
"fieldtype": "Select",
|
||||
"search_index": 1,
|
||||
"reqd": 1,
|
||||
"options": "\nLedger\nGroup",
|
||||
"in_filter": 1
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Data",
|
||||
"doctype": "DocField",
|
||||
"label": "Debit or Credit",
|
||||
"oldfieldname": "debit_or_credit",
|
||||
"fieldname": "debit_or_credit",
|
||||
"fieldtype": "Data",
|
||||
"search_index": 1,
|
||||
"permlevel": 1,
|
||||
"in_filter": 1
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Select",
|
||||
"doctype": "DocField",
|
||||
"label": "Is PL Account",
|
||||
"oldfieldname": "is_pl_account",
|
||||
"options": "Yes\nNo",
|
||||
"fieldname": "is_pl_account",
|
||||
"fieldtype": "Select",
|
||||
"search_index": 1,
|
||||
"permlevel": 1,
|
||||
"in_filter": 1
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Link",
|
||||
"doctype": "DocField",
|
||||
"label": "Company",
|
||||
"oldfieldname": "company",
|
||||
"options": "Company",
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Link",
|
||||
"search_index": 1,
|
||||
"reqd": 1,
|
||||
"permlevel": 1,
|
||||
"in_filter": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"width": "50%",
|
||||
"fieldname": "column_break1",
|
||||
"fieldtype": "Column Break",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Link",
|
||||
"doctype": "DocField",
|
||||
"label": "Parent Account",
|
||||
"oldfieldname": "parent_account",
|
||||
"trigger": "Client",
|
||||
"fieldname": "parent_account",
|
||||
"fieldtype": "Link",
|
||||
"search_index": 1,
|
||||
"options": "Account",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "Setting Account Type helps in selecting this Account in transactions.",
|
||||
"oldfieldtype": "Select",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Account Type",
|
||||
"oldfieldname": "account_type",
|
||||
"permlevel": 0,
|
||||
"trigger": "Client",
|
||||
"fieldname": "account_type",
|
||||
"fieldtype": "Select",
|
||||
"search_index": 0,
|
||||
"in_filter": 1,
|
||||
"options": "\nFixed Asset Account\nBank or Cash\nExpense Account\nTax\nIncome Account\nChargeable"
|
||||
},
|
||||
{
|
||||
"description": "Rate at which this tax is applied",
|
||||
"oldfieldtype": "Currency",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Rate",
|
||||
"oldfieldname": "tax_rate",
|
||||
"fieldname": "tax_rate",
|
||||
"fieldtype": "Currency",
|
||||
"reqd": 0,
|
||||
"hidden": 0,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "If the account is frozen, entries are allowed for the \"Account Manager\" only.",
|
||||
"oldfieldtype": "Select",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Frozen",
|
||||
"oldfieldname": "freeze_account",
|
||||
"options": "No\nYes",
|
||||
"fieldname": "freeze_account",
|
||||
"fieldtype": "Select",
|
||||
"permlevel": 2
|
||||
},
|
||||
{
|
||||
"print_hide": 1,
|
||||
"oldfieldtype": "Int",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Credit Days",
|
||||
"oldfieldname": "credit_days",
|
||||
"fieldname": "credit_days",
|
||||
"fieldtype": "Int",
|
||||
"hidden": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"print_hide": 1,
|
||||
"oldfieldtype": "Currency",
|
||||
"doctype": "DocField",
|
||||
"label": "Credit Limit",
|
||||
"oldfieldname": "credit_limit",
|
||||
"fieldname": "credit_limit",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "If this Account represents a Customer, Supplier or Employee, set it here.",
|
||||
"oldfieldtype": "Select",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Master Type",
|
||||
"oldfieldname": "master_type",
|
||||
"options": "\nSupplier\nCustomer\nEmployee",
|
||||
"fieldname": "master_type",
|
||||
"fieldtype": "Select",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Link",
|
||||
"doctype": "DocField",
|
||||
"label": "Master Name",
|
||||
"oldfieldname": "master_name",
|
||||
"trigger": "Client",
|
||||
"fieldname": "master_name",
|
||||
"fieldtype": "Link",
|
||||
"options": "[Select]",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"write": 1,
|
||||
"cancel": 0,
|
||||
"role": "Auditor",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Auditor",
|
||||
"permlevel": 2
|
||||
},
|
||||
{
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Auditor",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Sales User",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Purchase User",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"write": 1,
|
||||
"cancel": 0,
|
||||
"role": "Accounts User",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"write": 1,
|
||||
"cancel": 1,
|
||||
"role": "Accounts Manager",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Accounts User",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Accounts Manager",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"write": 1,
|
||||
"cancel": 0,
|
||||
"role": "Accounts Manager",
|
||||
"permlevel": 2
|
||||
},
|
||||
{
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Accounts User",
|
||||
"permlevel": 2
|
||||
}
|
||||
]
|
@ -142,7 +142,7 @@ class DocType:
|
||||
def save_entries(self, cancel, adv_adj, update_outstanding):
|
||||
for le in self.entries:
|
||||
# round off upto 2 decimal
|
||||
le.debit, le.credit = round(le.debit, 2), round(le.credit, 2)
|
||||
le.debit, le.credit = round(flt(le.debit), 2), round(flt(le.credit), 2)
|
||||
|
||||
#toggle debit, credit if negative entry
|
||||
if flt(le.debit) < 0 or flt(le.credit) < 0:
|
||||
|
@ -498,7 +498,7 @@ cur_frm.cscript.view_ledger_entry = function(){
|
||||
|
||||
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||
if(cint(wn.boot.notification_settings.sales_invoice)) {
|
||||
cur_frm.email_doc(wn.boot.notification_settings.sales_invoice);
|
||||
cur_frm.email_doc(wn.boot.notification_settings.sales_invoice_message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,12 +1,18 @@
|
||||
<div class="layout-wrapper layout-wrapper-background">
|
||||
<div class="appframe-area"></div>
|
||||
<div class="layout-main-section">
|
||||
<div class="layout-main">
|
||||
<div class="tree-area"></div>
|
||||
</div>
|
||||
<div class="layout-side-section">
|
||||
<div class="help">1. To add child nodes, explore tree and click on the node under which you want to add more nodes.<br><br>
|
||||
2. Please do NOT create accounts (ledgers) for Customers and Suppliers. They are created directly from the Customer / Supplier masters.<br>
|
||||
<hr>
|
||||
<div class="well">
|
||||
<h4>Quick Help</h4>
|
||||
<ol>
|
||||
<li>To add child nodes, explore tree and click on the node under which you want to add more nodes.
|
||||
<li>Accounting Entries can be made against leaf nodes, called <b>Ledgers</b>. Entries against <b>Groups</b> are not allowed.
|
||||
<li>Please do NOT create Account (Ledgers) for Customers and Suppliers. They are created directly from the Customer / Supplier masters.
|
||||
<li><b>To create a Bank Account:</b> Go to the appropriate group (usually Application of Funds > Current Assets > Bank Accounts) and create a new Account Ledger (by clicking on Add Child) of type "Bank or Cash"
|
||||
<li><b>To create a Tax Account:</b> Go to the appropriate group (usually Source of Funds > Current Liabilities > Taxes and Duties) and create a new Account Ledger (by clicking on Add Child) of type "Tax" and do mention the Tax rate.
|
||||
</ol>
|
||||
<p>Please setup your chart of accounts before you start Accounting Entries</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
@ -38,6 +38,7 @@ pscript['onload_Accounts Browser'] = function(wrapper){
|
||||
.change(function() {
|
||||
var ctype = wn.get_route()[1] || 'Account';
|
||||
erpnext.account_chart = new erpnext.AccountsChart(ctype, $(this).val(), wrapper);
|
||||
pscript.set_title(wrapper, ctype, $(this).val());
|
||||
})
|
||||
.appendTo(wrapper.appframe.$w.find('.appframe-toolbar'));
|
||||
|
||||
@ -52,18 +53,31 @@ pscript['onload_Accounts Browser'] = function(wrapper){
|
||||
wrapper.$company_select.val(sys_defaults.company || r[0]).change();
|
||||
}
|
||||
});
|
||||
|
||||
// refresh on rename
|
||||
$(document).bind('rename', function(event, dt, old_name, new_name) {
|
||||
if(erpnext.account_chart.ctype==dt)
|
||||
wrapper.$company_select.change();
|
||||
});
|
||||
}
|
||||
|
||||
pscript.set_title = function(wrapper, ctype, val) {
|
||||
if(val) {
|
||||
wrapper.appframe.set_title('Chart of '+ctype+'s' + " - " + cstr(val));
|
||||
} else {
|
||||
wrapper.appframe.set_title('Chart of '+ctype+'s');
|
||||
}
|
||||
}
|
||||
|
||||
pscript['onshow_Accounts Browser'] = function(wrapper){
|
||||
// set route
|
||||
var ctype = wn.get_route()[1] || 'Account';
|
||||
|
||||
wrapper.appframe.set_title('Chart of '+ctype+'s');
|
||||
|
||||
if(erpnext.account_chart && erpnext.account_chart.ctype != ctype) {
|
||||
wrapper.$company_select.change();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
pscript.set_title(wrapper, ctype);
|
||||
}
|
||||
|
||||
erpnext.AccountsChart = Class.extend({
|
||||
@ -71,6 +85,11 @@ erpnext.AccountsChart = Class.extend({
|
||||
$(wrapper).find('.tree-area').empty();
|
||||
var me = this;
|
||||
me.ctype = ctype;
|
||||
me.can_create = wn.boot.profile.can_create.indexOf(this.ctype);
|
||||
me.can_delete = wn.model.can_delete(this.ctype);
|
||||
me.can_write = wn.boot.profile.can_write.indexOf(this.ctype);
|
||||
|
||||
|
||||
me.company = company;
|
||||
this.tree = new wn.ui.Tree({
|
||||
parent: $(wrapper).find('.tree-area'),
|
||||
@ -116,17 +135,24 @@ erpnext.AccountsChart = Class.extend({
|
||||
var node_links = [];
|
||||
// edit
|
||||
if (wn.boot.profile.can_read.indexOf(this.ctype) !== -1) {
|
||||
node_links.push('<a href="#!Form/'+encodeURIComponent(this.ctype)+'/'
|
||||
node_links.push('<a href="#Form/'+encodeURIComponent(this.ctype)+'/'
|
||||
+encodeURIComponent(data.value)+'">Edit</a>');
|
||||
}
|
||||
if (data.expandable) {
|
||||
if((wn.boot.profile.can_create.indexOf(this.ctype) !== -1) ||
|
||||
(wn.boot.profile.in_create.indexOf(this.ctype) !== -1)) {
|
||||
if(this.can_create) {
|
||||
node_links.push('<a onclick="erpnext.account_chart.new_node();">Add Child</a>');
|
||||
}
|
||||
} else if (this.ctype === 'Account' && wn.boot.profile.can_read.indexOf("GL Entry") !== -1) {
|
||||
node_links.push('<a onclick="erpnext.account_chart.show_ledger();">View Ledger</a>');
|
||||
}
|
||||
|
||||
if (this.can_write !== -1) {
|
||||
node_links.push('<a onclick="erpnext.account_chart.rename()">Rename</a>');
|
||||
};
|
||||
|
||||
if (this.can_delete !== -1) {
|
||||
node_links.push('<a onclick="erpnext.account_chart.delete()">Delete</a>');
|
||||
};
|
||||
|
||||
link.toolbar.append(node_links.join(" | "));
|
||||
},
|
||||
@ -135,6 +161,18 @@ erpnext.AccountsChart = Class.extend({
|
||||
var node = me.selected_node();
|
||||
wn.set_route("general-ledger", "account=" + node.data('label'));
|
||||
},
|
||||
rename: function() {
|
||||
var me = this;
|
||||
var node = me.selected_node();
|
||||
wn.model.rename_doc("Account", node.data('label'));
|
||||
},
|
||||
delete: function() {
|
||||
var me = this;
|
||||
var node = me.selected_node();
|
||||
wn.model.delete_doc("Account", node.data('label'), function() {
|
||||
node.parent().remove();
|
||||
});
|
||||
},
|
||||
new_node: function() {
|
||||
if(this.ctype=='Account') {
|
||||
this.new_account();
|
||||
@ -216,6 +254,8 @@ erpnext.AccountsChart = Class.extend({
|
||||
$(fd.group_or_ledger.input).change();
|
||||
$(fd.account_type.input).change();
|
||||
}
|
||||
|
||||
$(fd.group_or_ledger.input).val("Ledger").change();
|
||||
d.show();
|
||||
},
|
||||
|
||||
|
@ -220,6 +220,6 @@ cur_frm.pformat.indent_no = function(doc, cdt, cdn){
|
||||
|
||||
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||
if(cint(wn.boot.notification_settings.purchase_order)) {
|
||||
cur_frm.email_doc(wn.boot.notification_settings.purchase_order);
|
||||
cur_frm.email_doc(wn.boot.notification_settings.purchase_order_message);
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
"docstatus": 0,
|
||||
"creation": "2012-08-06 20:00:37",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-08-06 17:14:19"
|
||||
"modified": "2012-08-06 17:14:18"
|
||||
},
|
||||
{
|
||||
"is_submittable": 1,
|
||||
|
@ -107,8 +107,7 @@ class DocType(TransactionBase):
|
||||
#validation for Naming Series mandatory field...
|
||||
if get_defaults()['supp_master_name'] == 'Naming Series':
|
||||
if not self.doc.naming_series:
|
||||
msgprint("Series is Mandatory.")
|
||||
raise Exception
|
||||
msgprint("Series is Mandatory.", raise_exception=1)
|
||||
|
||||
def create_account_head(self):
|
||||
if self.doc.company :
|
||||
@ -174,5 +173,11 @@ class DocType(TransactionBase):
|
||||
for rec in update_fields:
|
||||
sql("update `tab%s` set supplier_name = '%s' where %s = '%s'" %(rec[0],newdn,rec[1],olddn))
|
||||
|
||||
old_account = webnotes.conn.get_value("Account", {"master_type": "Supplier",
|
||||
"master_name": olddn})
|
||||
|
||||
#update master_name in doctype account
|
||||
sql("update `tabAccount` set master_name = '%s', master_type = 'Supplier' where master_name = '%s'" %(newdn,olddn))
|
||||
|
||||
from webnotes.model.rename_doc import rename_doc
|
||||
rename_doc("Account", old_account, newdn)
|
||||
|
@ -2,17 +2,19 @@
|
||||
{
|
||||
"owner": "Administrator",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-11-02 17:17:04",
|
||||
"creation": "2012-12-03 10:31:02",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-11-30 10:53:32"
|
||||
"modified": "2012-12-03 11:25:12"
|
||||
},
|
||||
{
|
||||
"autoname": "naming_series:",
|
||||
"name": "__common__",
|
||||
"description": "Supplier of Goods or Services.",
|
||||
"allow_rename": 1,
|
||||
"search_fields": "supplier_name,supplier_type",
|
||||
"module": "Buying",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Master"
|
||||
"document_type": "Master",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
@ -243,6 +245,26 @@
|
||||
"fieldtype": "Small Text",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Purchase Manager",
|
||||
"cancel": 0,
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Purchase Manager",
|
||||
"cancel": 0,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"role": "Purchase Master Manager",
|
||||
@ -257,25 +279,5 @@
|
||||
"role": "Purchase Master Manager",
|
||||
"cancel": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Purchase Manager",
|
||||
"cancel": 0,
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Purchase Manager",
|
||||
"cancel": 0,
|
||||
"permlevel": 0
|
||||
}
|
||||
]
|
@ -1,4 +1,8 @@
|
||||
erpnext.updates = [
|
||||
["3rd December 2012", [
|
||||
"Rename Tool: Documents that can be renamed will have a 'Rename' option in the sidebar (wherever applicable).",
|
||||
"Chart of Accounts: Ability to rename / delete from Chart of Accouns.",
|
||||
]],
|
||||
["30th November 2012", [
|
||||
"Auto Notifications: System will prompt user with pre-set message for auto-notification.",
|
||||
"Employee: Users with role Employee will only be able to see their Employee Records.",
|
||||
|
@ -247,7 +247,7 @@ cur_frm.cscript.update_voucher = function(doc){
|
||||
|
||||
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||
if(cint(wn.boot.notification_settings.expense_claim)) {
|
||||
cur_frm.email_doc(wn.boot.notification_settings.expense_claim);
|
||||
cur_frm.email_doc(wn.boot.notification_settings.expense_claim_message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -237,14 +237,12 @@ class DocType:
|
||||
# add operation in op list
|
||||
self.op.append(cstr(d.operation_no))
|
||||
|
||||
|
||||
|
||||
def validate_materials(self):
|
||||
""" Validate raw material entries """
|
||||
check_list = []
|
||||
for m in getlist(self.doclist, 'bom_materials'):
|
||||
# check if operation no not in op table
|
||||
if m.operation_no not in self.op:
|
||||
if cstr(m.operation_no) not in self.op:
|
||||
msgprint("""Operation no: %s against item: %s at row no: %s is not present
|
||||
at Operations table"""% (m.operation_no, m.item_code, m.idx), raise_exception = 1)
|
||||
|
||||
|
@ -1,160 +1,129 @@
|
||||
# DocType, Timesheet Detail
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2012-03-27 14:36:07',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-03-27 14:36:07',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all DocType
|
||||
{
|
||||
'autoname': u'TSD.#####',
|
||||
'colour': u'White:FFF',
|
||||
'doctype': 'DocType',
|
||||
'module': u'Projects',
|
||||
'name': '__common__',
|
||||
'section_style': u'Simple',
|
||||
'server_code_error': u' ',
|
||||
'version': 15
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Timesheet Detail',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
|
||||
# DocType, Timesheet Detail
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Timesheet Detail'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'act_start_time',
|
||||
'fieldtype': u'Time',
|
||||
'label': u'Actual Start Time',
|
||||
'oldfieldname': u'act_start_time',
|
||||
'oldfieldtype': u'Time',
|
||||
'permlevel': 0,
|
||||
'reqd': 1,
|
||||
'width': u'160px'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'act_end_time',
|
||||
'fieldtype': u'Time',
|
||||
'label': u'Actual End Time',
|
||||
'oldfieldname': u'act_end_time',
|
||||
'oldfieldtype': u'Time',
|
||||
'permlevel': 0,
|
||||
'reqd': 1,
|
||||
'width': u'160px'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'activity_type',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Activity Type',
|
||||
'options': u'Activity Type',
|
||||
'permlevel': 0,
|
||||
'reqd': 1,
|
||||
'search_index': 0,
|
||||
'width': u'200px'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'other_details',
|
||||
'fieldtype': u'Text',
|
||||
'label': u'Additional Info',
|
||||
'oldfieldname': u'other_details',
|
||||
'oldfieldtype': u'Text',
|
||||
'permlevel': 0,
|
||||
'width': u'200px'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'act_total_hrs',
|
||||
'fieldtype': u'Data',
|
||||
'label': u'Total Hours (Actual)',
|
||||
'oldfieldname': u'act_total_hrs',
|
||||
'oldfieldtype': u'Data',
|
||||
'permlevel': 1,
|
||||
'width': u'100px'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'customer_name',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Customer Name',
|
||||
'oldfieldname': u'customer_name',
|
||||
'oldfieldtype': u'Data',
|
||||
'options': u'Customer',
|
||||
'permlevel': 0,
|
||||
'width': u'150px'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'project_name',
|
||||
'fieldtype': u'Link',
|
||||
'in_filter': 1,
|
||||
'label': u'Project',
|
||||
'oldfieldname': u'project_name',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Project',
|
||||
'permlevel': 0,
|
||||
'reqd': 0,
|
||||
'search_index': 1,
|
||||
'width': u'150px'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'task_id',
|
||||
'fieldtype': u'Link',
|
||||
'in_filter': 1,
|
||||
'label': u'Task Id',
|
||||
'oldfieldname': u'task_id',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Task',
|
||||
'permlevel': 0,
|
||||
'search_index': 1,
|
||||
'width': u'150px'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'task_name',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Task Name',
|
||||
'oldfieldname': u'task_name',
|
||||
'oldfieldtype': u'Link',
|
||||
'permlevel': 0,
|
||||
'reqd': 0,
|
||||
'search_index': 0,
|
||||
'width': u'250px'
|
||||
}
|
||||
{
|
||||
"owner": "Administrator",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-11-30 18:13:54",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-12-03 09:33:28"
|
||||
},
|
||||
{
|
||||
"autoname": "TSD.#####",
|
||||
"name": "__common__",
|
||||
"doctype": "DocType",
|
||||
"module": "Projects"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
"parent": "Timesheet Detail",
|
||||
"doctype": "DocField",
|
||||
"parenttype": "DocType",
|
||||
"parentfield": "fields"
|
||||
},
|
||||
{
|
||||
"name": "Timesheet Detail",
|
||||
"doctype": "DocType"
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Time",
|
||||
"doctype": "DocField",
|
||||
"label": "Actual Start Time",
|
||||
"oldfieldname": "act_start_time",
|
||||
"width": "160px",
|
||||
"fieldname": "act_start_time",
|
||||
"fieldtype": "Time",
|
||||
"reqd": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Time",
|
||||
"doctype": "DocField",
|
||||
"label": "Actual End Time",
|
||||
"oldfieldname": "act_end_time",
|
||||
"width": "160px",
|
||||
"fieldname": "act_end_time",
|
||||
"fieldtype": "Time",
|
||||
"reqd": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"search_index": 0,
|
||||
"doctype": "DocField",
|
||||
"label": "Activity Type",
|
||||
"width": "200px",
|
||||
"options": "Activity Type",
|
||||
"fieldname": "activity_type",
|
||||
"fieldtype": "Link",
|
||||
"reqd": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Text",
|
||||
"doctype": "DocField",
|
||||
"label": "Additional Info",
|
||||
"oldfieldname": "other_details",
|
||||
"width": "200px",
|
||||
"fieldname": "other_details",
|
||||
"fieldtype": "Text",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Data",
|
||||
"doctype": "DocField",
|
||||
"label": "Total Hours (Actual)",
|
||||
"oldfieldname": "act_total_hrs",
|
||||
"width": "100px",
|
||||
"fieldname": "act_total_hrs",
|
||||
"fieldtype": "Data",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Data",
|
||||
"doctype": "DocField",
|
||||
"label": "Customer Name",
|
||||
"oldfieldname": "customer_name",
|
||||
"width": "150px",
|
||||
"options": "Customer",
|
||||
"fieldname": "customer_name",
|
||||
"fieldtype": "Link",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"permlevel": 0,
|
||||
"oldfieldtype": "Link",
|
||||
"doctype": "DocField",
|
||||
"label": "Project",
|
||||
"oldfieldname": "project_name",
|
||||
"width": "150px",
|
||||
"fieldname": "project_name",
|
||||
"fieldtype": "Link",
|
||||
"search_index": 1,
|
||||
"reqd": 0,
|
||||
"options": "Project",
|
||||
"in_filter": 1
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Link",
|
||||
"doctype": "DocField",
|
||||
"label": "Task Id",
|
||||
"oldfieldname": "task_id",
|
||||
"width": "150px",
|
||||
"options": "Task",
|
||||
"fieldname": "task_id",
|
||||
"fieldtype": "Link",
|
||||
"search_index": 1,
|
||||
"permlevel": 0,
|
||||
"in_filter": 1
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Link",
|
||||
"doctype": "DocField",
|
||||
"label": "Task Name",
|
||||
"oldfieldname": "task_name",
|
||||
"width": "250px",
|
||||
"fieldname": "task_name",
|
||||
"fieldtype": "Data",
|
||||
"search_index": 0,
|
||||
"reqd": 0,
|
||||
"permlevel": 0
|
||||
}
|
||||
]
|
@ -125,6 +125,7 @@ class DocType(TransactionBase):
|
||||
parent_account = self.get_receivables_group()
|
||||
arg = {'account_name':self.doc.name,'parent_account': parent_account, 'group_or_ledger':'Ledger', 'company':self.doc.company,'account_type':'','tax_rate':'0','master_type':'Customer','master_name':self.doc.name,'address':self.doc.address}
|
||||
# create
|
||||
|
||||
ac = get_obj('GL Control').add_ac(cstr(arg))
|
||||
msgprint("Account Head created for "+ac)
|
||||
else :
|
||||
@ -236,5 +237,11 @@ class DocType(TransactionBase):
|
||||
for rec in update_fields:
|
||||
sql("update `tab%s` set customer_name = '%s' where %s = '%s'" %(rec[0],newdn,rec[1],olddn))
|
||||
|
||||
old_account = webnotes.conn.get_value("Account", {"master_type": "Customer",
|
||||
"master_name": olddn})
|
||||
|
||||
#update master_name in doctype account
|
||||
sql("update `tabAccount` set master_name = '%s', master_type = 'Customer' where master_name = '%s'" %(newdn,olddn))
|
||||
|
||||
from webnotes.model.rename_doc import rename_doc
|
||||
rename_doc("Account", old_account, newdn)
|
||||
|
@ -2,19 +2,21 @@
|
||||
{
|
||||
"owner": "Administrator",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-11-02 17:16:46",
|
||||
"creation": "2012-12-03 10:31:05",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-11-30 10:54:38"
|
||||
"modified": "2012-12-03 11:25:29"
|
||||
},
|
||||
{
|
||||
"autoname": "naming_series:",
|
||||
"name": "__common__",
|
||||
"default_print_format": "Standard",
|
||||
"description": "Buyer of Goods and Services.",
|
||||
"allow_print": 0,
|
||||
"search_fields": "customer_name,customer_group,country,territory",
|
||||
"module": "Selling",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Master"
|
||||
"document_type": "Master",
|
||||
"autoname": "naming_series:",
|
||||
"name": "__common__",
|
||||
"default_print_format": "Standard",
|
||||
"allow_rename": 1,
|
||||
"doctype": "DocType"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
@ -364,44 +366,54 @@
|
||||
"fieldtype": "Small Text",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Sales Manager",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Sales Manager",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Sales User",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Sales User",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 1,
|
||||
"role": "Sales Master Manager",
|
||||
"cancel": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales Master Manager",
|
||||
"cancel": 0,
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales Manager",
|
||||
"cancel": 0,
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales Manager",
|
||||
"cancel": 0,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
@ -410,18 +422,18 @@
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales User",
|
||||
"cancel": 0,
|
||||
"role": "Sales Master Manager",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales User",
|
||||
"write": 1,
|
||||
"cancel": 0,
|
||||
"role": "Purchase User",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
|
@ -94,8 +94,21 @@ cur_frm.cscript.lead_cust_show = function(doc,cdt,cdn){
|
||||
|
||||
// customer
|
||||
cur_frm.cscript.customer = function(doc,dt,dn) {
|
||||
if(doc.customer) get_server_fields('get_default_customer_address', JSON.stringify({customer: doc.customer}),'', doc, dt, dn, 1);
|
||||
if(doc.customer) unhide_field(['customer_name','customer_address','contact_person','address_display','contact_display','contact_mobile','contact_email','territory','customer_group']);
|
||||
if(doc.customer) {
|
||||
cur_frm.call({
|
||||
method: "get_default_customer_address",
|
||||
args: { customer: doc.customer },
|
||||
callback: function(r) {
|
||||
if(!r.exc) {
|
||||
cur_frm.refresh();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
unhide_field(["customer_name", "customer_address", "contact_person",
|
||||
"address_display", "contact_display", "contact_mobile", "contact_email",
|
||||
"territory", "customer_group"]);
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.cscript.customer_address = cur_frm.cscript.contact_person = function(doc,dt,dn) {
|
||||
|
@ -2,19 +2,20 @@
|
||||
{
|
||||
"owner": "Administrator",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-11-24 17:21:44",
|
||||
"creation": "2012-12-03 10:31:06",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-11-30 10:54:00"
|
||||
"modified": "2012-12-03 13:57:32"
|
||||
},
|
||||
{
|
||||
"is_submittable": 1,
|
||||
"autoname": "naming_series:",
|
||||
"name": "__common__",
|
||||
"description": "Potential Sales Deal",
|
||||
"default_print_format": "Standard",
|
||||
"search_fields": "status,transaction_date,customer,lead,enquiry_type,territory,company",
|
||||
"module": "Selling",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Transaction"
|
||||
"document_type": "Transaction",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
@ -35,16 +36,6 @@
|
||||
"name": "Opportunity",
|
||||
"doctype": "DocType"
|
||||
},
|
||||
{
|
||||
"description": "Enter customer enquiry for which you might raise a quotation in future",
|
||||
"oldfieldtype": "Section Break",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Basic Info",
|
||||
"fieldname": "basic_info",
|
||||
"fieldtype": "Section Break",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "To manage multiple series please go to Setup > Manage Series",
|
||||
"no_copy": 1,
|
||||
@ -474,14 +465,24 @@
|
||||
"fieldtype": "Date",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Sales Manager",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 1,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 1,
|
||||
"write": 1,
|
||||
"role": "System Manager",
|
||||
"cancel": 1,
|
||||
"role": "System Manager",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
@ -495,8 +496,8 @@
|
||||
"doctype": "DocPerm",
|
||||
"submit": 1,
|
||||
"write": 1,
|
||||
"role": "Sales User",
|
||||
"cancel": 1,
|
||||
"role": "Sales User",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
@ -505,8 +506,8 @@
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales User",
|
||||
"cancel": 0,
|
||||
"role": "Sales User",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
@ -515,18 +516,8 @@
|
||||
"doctype": "DocPerm",
|
||||
"submit": 1,
|
||||
"write": 1,
|
||||
"role": "Sales Manager",
|
||||
"cancel": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales Manager",
|
||||
"cancel": 0,
|
||||
"permlevel": 1
|
||||
"permlevel": 0
|
||||
}
|
||||
]
|
@ -369,6 +369,6 @@ cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
||||
|
||||
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||
if(cint(wn.boot.notification_settings.sales_order)) {
|
||||
cur_frm.email_doc(wn.boot.notification_settings.sales_order);
|
||||
cur_frm.email_doc(wn.boot.notification_settings.sales_order_message);
|
||||
}
|
||||
}
|
||||
|
@ -1,377 +1,307 @@
|
||||
# DocType, Company
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2012-05-15 12:15:00',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-08-10 12:15:45',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all DocType
|
||||
{
|
||||
'_last_update': u'1323855292',
|
||||
'allow_trash': 1,
|
||||
'autoname': u'field:company_name',
|
||||
'colour': u'White:FFF',
|
||||
'doctype': 'DocType',
|
||||
'document_type': u'Master',
|
||||
'module': u'Setup',
|
||||
'name': '__common__',
|
||||
'section_style': u'Tabbed',
|
||||
'server_code_error': u' ',
|
||||
'show_in_menu': 0,
|
||||
'version': 1
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Company',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
|
||||
# These values are common for all DocPerm
|
||||
{
|
||||
'doctype': u'DocPerm',
|
||||
'name': '__common__',
|
||||
'parent': u'Company',
|
||||
'parentfield': u'permissions',
|
||||
'parenttype': u'DocType',
|
||||
'read': 1
|
||||
},
|
||||
|
||||
# DocType, Company
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Company'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 1,
|
||||
'create': 1,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'System Manager',
|
||||
'submit': 0,
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 1,
|
||||
'create': 1,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'System Manager',
|
||||
'submit': 0,
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'All'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'details',
|
||||
'fieldtype': u'Section Break',
|
||||
'label': u'Company Details',
|
||||
'oldfieldtype': u'Section Break',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'company_name',
|
||||
'fieldtype': u'Data',
|
||||
'label': u'Company',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': u'company_name',
|
||||
'oldfieldtype': u'Data',
|
||||
'permlevel': 0,
|
||||
'reqd': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'cb0',
|
||||
'fieldtype': u'Column Break',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'Please Enter Abbreviation or Short Name properly as it will be added as Suffix to all Account Heads.',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'abbr',
|
||||
'fieldtype': u'Data',
|
||||
'label': u'Abbr',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': u'abbr',
|
||||
'oldfieldtype': u'Data',
|
||||
'permlevel': 0,
|
||||
'reqd': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'default_settings',
|
||||
'fieldtype': u'Section Break',
|
||||
'label': u'Default Settings',
|
||||
'oldfieldtype': u'Section Break',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'default_currency',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Default Currency',
|
||||
'options': u'link:Currency',
|
||||
'permlevel': 0,
|
||||
'reqd': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'depends_on': u'eval:!doc.__islocal',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'default_bank_account',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Default Bank Account',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': u'default_bank_account',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Account',
|
||||
'permlevel': 0,
|
||||
'trigger': u'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'depends_on': u'eval:!doc.__islocal',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'receivables_group',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Receivables Group',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': u'receivables_group',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Account',
|
||||
'permlevel': 0,
|
||||
'trigger': u'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'depends_on': u'eval:!doc.__islocal',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'payables_group',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Payables Group',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': u'payables_group',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Account',
|
||||
'permlevel': 0,
|
||||
'trigger': u'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'column_break0',
|
||||
'fieldtype': u'Column Break',
|
||||
'oldfieldtype': u'Column Break',
|
||||
'permlevel': 0,
|
||||
'width': u'50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'depends_on': u'eval:!doc.__islocal',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'credit_days',
|
||||
'fieldtype': u'Int',
|
||||
'label': u'Credit Days',
|
||||
'oldfieldname': u'credit_days',
|
||||
'oldfieldtype': u'Int',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'depends_on': u'eval:!doc.__islocal',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'credit_limit',
|
||||
'fieldtype': u'Currency',
|
||||
'label': u'Credit Limit',
|
||||
'oldfieldname': u'credit_limit',
|
||||
'oldfieldtype': u'Currency',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'depends_on': u'eval:!doc.__islocal',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'yearly_bgt_flag',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'If Yearly Budget Exceeded',
|
||||
'oldfieldname': u'yearly_bgt_flag',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'\nWarn\nIgnore\nStop',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'depends_on': u'eval:!doc.__islocal',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'monthly_bgt_flag',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'If Monthly Budget Exceeded',
|
||||
'oldfieldname': u'monthly_bgt_flag',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'\nWarn\nIgnore\nStop',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'For reference only.',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'company_info',
|
||||
'fieldtype': u'Section Break',
|
||||
'label': u'Company Info',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'address',
|
||||
'fieldtype': u'Small Text',
|
||||
'label': u'Address',
|
||||
'oldfieldname': u'address',
|
||||
'oldfieldtype': u'Small Text',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'column_break1',
|
||||
'fieldtype': u'Column Break',
|
||||
'oldfieldtype': u'Column Break',
|
||||
'permlevel': 0,
|
||||
'width': u'50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'phone_no',
|
||||
'fieldtype': u'Data',
|
||||
'label': u'Phone No',
|
||||
'oldfieldname': u'phone_no',
|
||||
'oldfieldtype': u'Data',
|
||||
'options': u'Phone',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'fax',
|
||||
'fieldtype': u'Data',
|
||||
'label': u'Fax',
|
||||
'oldfieldname': u'fax',
|
||||
'oldfieldtype': u'Data',
|
||||
'options': u'Phone',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'email',
|
||||
'fieldtype': u'Data',
|
||||
'label': u'Email',
|
||||
'oldfieldname': u'email',
|
||||
'oldfieldtype': u'Data',
|
||||
'options': u'Email',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'website',
|
||||
'fieldtype': u'Data',
|
||||
'label': u'Website',
|
||||
'oldfieldname': u'website',
|
||||
'oldfieldtype': u'Data',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'Company registration numbers for your reference. Example: VAT Registration Numbers etc.',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'registration_info',
|
||||
'fieldtype': u'Section Break',
|
||||
'label': u'Registration Info',
|
||||
'oldfieldtype': u'Section Break',
|
||||
'permlevel': 0,
|
||||
'width': u'50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'Company registration numbers for your reference. Tax numbers etc.',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'registration_details',
|
||||
'fieldtype': u'Code',
|
||||
'label': u'Registration Details',
|
||||
'oldfieldname': u'registration_details',
|
||||
'oldfieldtype': u'Code',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'trash_reason',
|
||||
'fieldtype': u'Small Text',
|
||||
'label': u'Trash Reason',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': u'trash_reason',
|
||||
'oldfieldtype': u'Small Text',
|
||||
'permlevel': 1
|
||||
}
|
||||
{
|
||||
"owner": "Administrator",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-08-10 13:00:45",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-12-03 11:26:05"
|
||||
},
|
||||
{
|
||||
"autoname": "field:company_name",
|
||||
"description": "Legal Entity / Subsidiary with a separate Chart of Accounts belonging to the Organization.",
|
||||
"allow_rename": 1,
|
||||
"doctype": "DocType",
|
||||
"module": "Setup",
|
||||
"document_type": "Master",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
"parent": "Company",
|
||||
"doctype": "DocField",
|
||||
"parenttype": "DocType",
|
||||
"parentfield": "fields"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
"parent": "Company",
|
||||
"read": 1,
|
||||
"doctype": "DocPerm",
|
||||
"parenttype": "DocType",
|
||||
"parentfield": "permissions"
|
||||
},
|
||||
{
|
||||
"name": "Company",
|
||||
"doctype": "DocType"
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Section Break",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Company Details",
|
||||
"fieldname": "details",
|
||||
"fieldtype": "Section Break",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"no_copy": 0,
|
||||
"oldfieldtype": "Data",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Company",
|
||||
"oldfieldname": "company_name",
|
||||
"fieldname": "company_name",
|
||||
"fieldtype": "Data",
|
||||
"reqd": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "cb0",
|
||||
"fieldtype": "Column Break",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "Please Enter Abbreviation or Short Name properly as it will be added as Suffix to all Account Heads.",
|
||||
"no_copy": 0,
|
||||
"oldfieldtype": "Data",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Abbr",
|
||||
"oldfieldname": "abbr",
|
||||
"fieldname": "abbr",
|
||||
"fieldtype": "Data",
|
||||
"reqd": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Section Break",
|
||||
"doctype": "DocField",
|
||||
"label": "Default Settings",
|
||||
"fieldname": "default_settings",
|
||||
"fieldtype": "Section Break",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"label": "Default Currency",
|
||||
"options": "link:Currency",
|
||||
"fieldname": "default_currency",
|
||||
"fieldtype": "Select",
|
||||
"reqd": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"no_copy": 1,
|
||||
"oldfieldtype": "Link",
|
||||
"doctype": "DocField",
|
||||
"label": "Default Bank Account",
|
||||
"oldfieldname": "default_bank_account",
|
||||
"trigger": "Client",
|
||||
"fieldname": "default_bank_account",
|
||||
"fieldtype": "Link",
|
||||
"depends_on": "eval:!doc.__islocal",
|
||||
"options": "Account",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"no_copy": 1,
|
||||
"oldfieldtype": "Link",
|
||||
"doctype": "DocField",
|
||||
"label": "Receivables Group",
|
||||
"oldfieldname": "receivables_group",
|
||||
"trigger": "Client",
|
||||
"fieldname": "receivables_group",
|
||||
"fieldtype": "Link",
|
||||
"depends_on": "eval:!doc.__islocal",
|
||||
"options": "Account",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"no_copy": 1,
|
||||
"oldfieldtype": "Link",
|
||||
"doctype": "DocField",
|
||||
"label": "Payables Group",
|
||||
"oldfieldname": "payables_group",
|
||||
"trigger": "Client",
|
||||
"fieldname": "payables_group",
|
||||
"fieldtype": "Link",
|
||||
"depends_on": "eval:!doc.__islocal",
|
||||
"options": "Account",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Column Break",
|
||||
"doctype": "DocField",
|
||||
"width": "50%",
|
||||
"fieldname": "column_break0",
|
||||
"fieldtype": "Column Break",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Int",
|
||||
"doctype": "DocField",
|
||||
"label": "Credit Days",
|
||||
"oldfieldname": "credit_days",
|
||||
"fieldname": "credit_days",
|
||||
"fieldtype": "Int",
|
||||
"depends_on": "eval:!doc.__islocal",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Currency",
|
||||
"doctype": "DocField",
|
||||
"label": "Credit Limit",
|
||||
"oldfieldname": "credit_limit",
|
||||
"fieldname": "credit_limit",
|
||||
"fieldtype": "Currency",
|
||||
"depends_on": "eval:!doc.__islocal",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Select",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "If Yearly Budget Exceeded",
|
||||
"oldfieldname": "yearly_bgt_flag",
|
||||
"options": "\nWarn\nIgnore\nStop",
|
||||
"fieldname": "yearly_bgt_flag",
|
||||
"fieldtype": "Select",
|
||||
"depends_on": "eval:!doc.__islocal",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Select",
|
||||
"doctype": "DocField",
|
||||
"label": "If Monthly Budget Exceeded",
|
||||
"oldfieldname": "monthly_bgt_flag",
|
||||
"options": "\nWarn\nIgnore\nStop",
|
||||
"fieldname": "monthly_bgt_flag",
|
||||
"fieldtype": "Select",
|
||||
"depends_on": "eval:!doc.__islocal",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "For reference only.",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Company Info",
|
||||
"fieldname": "company_info",
|
||||
"fieldtype": "Section Break",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Small Text",
|
||||
"doctype": "DocField",
|
||||
"label": "Address",
|
||||
"oldfieldname": "address",
|
||||
"fieldname": "address",
|
||||
"fieldtype": "Small Text",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Column Break",
|
||||
"doctype": "DocField",
|
||||
"width": "50%",
|
||||
"fieldname": "column_break1",
|
||||
"fieldtype": "Column Break",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Data",
|
||||
"doctype": "DocField",
|
||||
"label": "Phone No",
|
||||
"oldfieldname": "phone_no",
|
||||
"options": "Phone",
|
||||
"fieldname": "phone_no",
|
||||
"fieldtype": "Data",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Data",
|
||||
"doctype": "DocField",
|
||||
"label": "Fax",
|
||||
"oldfieldname": "fax",
|
||||
"options": "Phone",
|
||||
"fieldname": "fax",
|
||||
"fieldtype": "Data",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Data",
|
||||
"doctype": "DocField",
|
||||
"label": "Email",
|
||||
"oldfieldname": "email",
|
||||
"options": "Email",
|
||||
"fieldname": "email",
|
||||
"fieldtype": "Data",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Data",
|
||||
"doctype": "DocField",
|
||||
"label": "Website",
|
||||
"oldfieldname": "website",
|
||||
"fieldname": "website",
|
||||
"fieldtype": "Data",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "Company registration numbers for your reference. Example: VAT Registration Numbers etc.",
|
||||
"oldfieldtype": "Section Break",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Registration Info",
|
||||
"width": "50%",
|
||||
"fieldname": "registration_info",
|
||||
"fieldtype": "Section Break",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "Company registration numbers for your reference. Tax numbers etc.",
|
||||
"oldfieldtype": "Code",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Registration Details",
|
||||
"oldfieldname": "registration_details",
|
||||
"fieldname": "registration_details",
|
||||
"fieldtype": "Code",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"no_copy": 1,
|
||||
"oldfieldtype": "Small Text",
|
||||
"doctype": "DocField",
|
||||
"label": "Trash Reason",
|
||||
"oldfieldname": "trash_reason",
|
||||
"fieldname": "trash_reason",
|
||||
"fieldtype": "Small Text",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 1,
|
||||
"role": "System Manager",
|
||||
"cancel": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 1,
|
||||
"role": "System Manager",
|
||||
"cancel": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"role": "All",
|
||||
"cancel": 0,
|
||||
"permlevel": 1
|
||||
}
|
||||
]
|
@ -214,3 +214,30 @@ cur_frm.cscript.delete_doc = function(doctype, name) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Render List
|
||||
cur_frm.cscript.render_list = function(doc, doctype, wrapper, ListView, make_new_doc) {
|
||||
wn.model.with_doctype(doctype, function(r) {
|
||||
if((r && r['403']) || wn.boot.profile.all_read.indexOf(doctype)===-1) {
|
||||
return;
|
||||
}
|
||||
var RecordListView = wn.views.RecordListView.extend({
|
||||
default_docstatus: ['0', '1', '2'],
|
||||
default_filters: [
|
||||
[doctype, doc.doctype.toLowerCase().replace(" ", "_"), '=', doc.name],
|
||||
],
|
||||
});
|
||||
|
||||
if (make_new_doc) {
|
||||
RecordListView = RecordListView.extend({
|
||||
make_new_doc: make_new_doc,
|
||||
});
|
||||
}
|
||||
|
||||
var record_list_view = new RecordListView(doctype, wrapper, ListView);
|
||||
if (!cur_frm[doctype.toLowerCase().replace(" ", "_") + "_list"]) {
|
||||
cur_frm[doctype.toLowerCase().replace(" ", "_") + "_list"] = record_list_view;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -46,8 +46,8 @@
|
||||
<span class="help">Un-trash items</span>
|
||||
</p>
|
||||
<p>
|
||||
<b><a href="#!Form/Rename Tool/Rename Tool">Rename Master</a></b><br>
|
||||
<span class="help">Rename a single master record</span>
|
||||
<b>Rename Master</b><br>
|
||||
<span class="help">Click on "Rename" on the sidebar of an item for renaming.</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="setup-column">
|
||||
|
@ -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()
|
37
tests/data/item/android_jack_d.txt
Normal file
37
tests/data/item/android_jack_d.txt
Normal file
@ -0,0 +1,37 @@
|
||||
# Item, Android Jack D
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-26 11:30:44',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-26 11:30:44',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item
|
||||
{
|
||||
'description': u'Android Jack D',
|
||||
'doctype': 'Item',
|
||||
'has_batch_no': u'No',
|
||||
'has_serial_no': u'No',
|
||||
'inspection_required': u'No',
|
||||
'is_purchase_item': u'Yes',
|
||||
'is_sales_item': u'Yes',
|
||||
'is_service_item': u'No',
|
||||
'is_stock_item': u'Yes',
|
||||
'item_code': u'Android Jack D',
|
||||
'item_group': u'Android',
|
||||
'item_name': u'Android Jack D',
|
||||
u'name': u'__common__',
|
||||
'stock_uom': u'Nos',
|
||||
'default_warehouse': u'Default Warehouse'
|
||||
},
|
||||
|
||||
# Item, Android Jack D
|
||||
{
|
||||
u'doctype': 'Item',
|
||||
'name': u'Android Jack D'
|
||||
}
|
||||
]
|
37
tests/data/item/android_jack_s.txt
Normal file
37
tests/data/item/android_jack_s.txt
Normal file
@ -0,0 +1,37 @@
|
||||
# Item, Android Jack S
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-26 11:29:22',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-26 11:29:22',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item
|
||||
{
|
||||
'description': u'Android Jack S',
|
||||
'doctype': 'Item',
|
||||
'has_batch_no': u'No',
|
||||
'has_serial_no': u'No',
|
||||
'inspection_required': u'No',
|
||||
'is_purchase_item': u'Yes',
|
||||
'is_sales_item': u'Yes',
|
||||
'is_service_item': u'No',
|
||||
'is_stock_item': u'Yes',
|
||||
'item_code': u'Android Jack S',
|
||||
'item_group': u'Android',
|
||||
'item_name': u'Android Jack S',
|
||||
u'name': u'__common__',
|
||||
'stock_uom': u'Nos',
|
||||
'default_warehouse': u'Default Warehouse'
|
||||
},
|
||||
|
||||
# Item, Android Jack S
|
||||
{
|
||||
u'doctype': 'Item',
|
||||
'name': u'Android Jack S'
|
||||
}
|
||||
]
|
37
tests/data/item/home_desktop_100.txt
Normal file
37
tests/data/item/home_desktop_100.txt
Normal file
@ -0,0 +1,37 @@
|
||||
# Item, Home Desktop 100
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-26 11:25:28',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-26 11:25:28',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item
|
||||
{
|
||||
'description': u'Home Desktop 100',
|
||||
'doctype': 'Item',
|
||||
'has_batch_no': u'No',
|
||||
'has_serial_no': u'No',
|
||||
'inspection_required': u'No',
|
||||
'is_purchase_item': u'Yes',
|
||||
'is_sales_item': u'Yes',
|
||||
'is_service_item': u'No',
|
||||
'is_stock_item': u'Yes',
|
||||
'item_code': u'Home Desktop 100',
|
||||
'item_group': u'Home Series',
|
||||
'item_name': u'Home Desktop 100',
|
||||
u'name': u'__common__',
|
||||
'stock_uom': u'Nos',
|
||||
'default_warehouse': u'Default Warehouse'
|
||||
},
|
||||
|
||||
# Item, Home Desktop 100
|
||||
{
|
||||
u'doctype': 'Item',
|
||||
'name': u'Home Desktop 100'
|
||||
}
|
||||
]
|
37
tests/data/item/home_desktop_200.txt
Normal file
37
tests/data/item/home_desktop_200.txt
Normal file
@ -0,0 +1,37 @@
|
||||
# Item, Home Desktop 200
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-26 11:25:54',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-26 11:25:54',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item
|
||||
{
|
||||
'description': u'Home Desktop 200',
|
||||
'doctype': 'Item',
|
||||
'has_batch_no': u'No',
|
||||
'has_serial_no': u'No',
|
||||
'inspection_required': u'No',
|
||||
'is_purchase_item': u'Yes',
|
||||
'is_sales_item': u'Yes',
|
||||
'is_service_item': u'No',
|
||||
'is_stock_item': u'Yes',
|
||||
'item_code': u'Home Desktop 200',
|
||||
'item_group': u'Home Series',
|
||||
'item_name': u'Home Desktop 200',
|
||||
u'name': u'__common__',
|
||||
'stock_uom': u'Nos',
|
||||
'default_warehouse': u'Default Warehouse'
|
||||
},
|
||||
|
||||
# Item, Home Desktop 200
|
||||
{
|
||||
u'doctype': 'Item',
|
||||
'name': u'Home Desktop 200'
|
||||
}
|
||||
]
|
37
tests/data/item/home_desktop_300.txt
Normal file
37
tests/data/item/home_desktop_300.txt
Normal file
@ -0,0 +1,37 @@
|
||||
# Item, Home Desktop 300
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-26 11:26:37',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-26 11:26:37',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item
|
||||
{
|
||||
'description': u'Home Desktop 300',
|
||||
'doctype': 'Item',
|
||||
'has_batch_no': u'No',
|
||||
'has_serial_no': u'No',
|
||||
'inspection_required': u'No',
|
||||
'is_purchase_item': u'Yes',
|
||||
'is_sales_item': u'Yes',
|
||||
'is_service_item': u'No',
|
||||
'is_stock_item': u'Yes',
|
||||
'item_code': u'Home Desktop 300',
|
||||
'item_group': u'Home Series',
|
||||
'item_name': u'Home Desktop 300',
|
||||
u'name': u'__common__',
|
||||
'stock_uom': u'Nos',
|
||||
'default_warehouse': u'Default Warehouse'
|
||||
},
|
||||
|
||||
# Item, Home Desktop 300
|
||||
{
|
||||
u'doctype': 'Item',
|
||||
'name': u'Home Desktop 300'
|
||||
}
|
||||
]
|
38
tests/data/item/nebula_7.txt
Normal file
38
tests/data/item/nebula_7.txt
Normal file
@ -0,0 +1,38 @@
|
||||
# Item, Nebula 7
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-26 11:32:02',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-26 11:32:02',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item
|
||||
{
|
||||
'description': u'Nebula 7',
|
||||
'doctype': 'Item',
|
||||
'has_batch_no': u'No',
|
||||
'has_serial_no': u'No',
|
||||
'inspection_required': u'No',
|
||||
'is_sub_contracted_item': 'Yes',
|
||||
'is_purchase_item': u'No',
|
||||
'is_sales_item': u'Yes',
|
||||
'is_service_item': u'No',
|
||||
'is_stock_item': u'Yes',
|
||||
'item_code': u'Nebula 7',
|
||||
'item_group': u'Small Tablets',
|
||||
'item_name': u'Nebula 7',
|
||||
u'name': u'__common__',
|
||||
'stock_uom': u'Nos',
|
||||
'default_warehouse': u'Default Warehouse'
|
||||
},
|
||||
|
||||
# Item, Nebula 7
|
||||
{
|
||||
u'doctype': 'Item',
|
||||
'name': u'Nebula 7'
|
||||
}
|
||||
]
|
27
tests/data/item_group/accessories.txt
Normal file
27
tests/data/item_group/accessories.txt
Normal file
@ -0,0 +1,27 @@
|
||||
# Item Group, Accessories
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-07 09:55:59',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-07 09:55:59',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item Group
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
'is_group': u'Yes',
|
||||
'item_group_name': u'Accessories',
|
||||
u'name': u'__common__',
|
||||
'parent_item_group': u'All Item Groups'
|
||||
},
|
||||
|
||||
# Item Group, Accessories
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
u'name': u'Accessories'
|
||||
}
|
||||
]
|
27
tests/data/item_group/android.txt
Normal file
27
tests/data/item_group/android.txt
Normal file
@ -0,0 +1,27 @@
|
||||
# Item Group, Android
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-07 09:57:11',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-07 09:57:11',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item Group
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
'is_group': u'No',
|
||||
'item_group_name': u'Android',
|
||||
u'name': u'__common__',
|
||||
'parent_item_group': u'Smartphones'
|
||||
},
|
||||
|
||||
# Item Group, Android
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
u'name': u'Android'
|
||||
}
|
||||
]
|
27
tests/data/item_group/desktops.txt
Normal file
27
tests/data/item_group/desktops.txt
Normal file
@ -0,0 +1,27 @@
|
||||
# Item Group, Desktops
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-07 09:55:28',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-07 09:55:28',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item Group
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
'is_group': u'Yes',
|
||||
'item_group_name': u'Desktops',
|
||||
u'name': u'__common__',
|
||||
'parent_item_group': u'All Item Groups'
|
||||
},
|
||||
|
||||
# Item Group, Desktops
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
u'name': u'Desktops'
|
||||
}
|
||||
]
|
27
tests/data/item_group/full_size_tablets.txt
Normal file
27
tests/data/item_group/full_size_tablets.txt
Normal file
@ -0,0 +1,27 @@
|
||||
# Item Group, Full Size Tablets
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-07 09:58:20',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-07 09:58:20',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item Group
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
'is_group': u'No',
|
||||
'item_group_name': u'Full Size Tablets',
|
||||
u'name': u'__common__',
|
||||
'parent_item_group': u'Tablets'
|
||||
},
|
||||
|
||||
# Item Group, Full Size Tablets
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
u'name': u'Full Size Tablets'
|
||||
}
|
||||
]
|
27
tests/data/item_group/gamer.txt
Normal file
27
tests/data/item_group/gamer.txt
Normal file
@ -0,0 +1,27 @@
|
||||
# Item Group, Gamer
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-07 09:56:27',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-07 09:56:27',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item Group
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
'is_group': u'No',
|
||||
'item_group_name': u'Gamer',
|
||||
u'name': u'__common__',
|
||||
'parent_item_group': u'Desktops'
|
||||
},
|
||||
|
||||
# Item Group, Gamer
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
u'name': u'Gamer'
|
||||
}
|
||||
]
|
27
tests/data/item_group/home_series.txt
Normal file
27
tests/data/item_group/home_series.txt
Normal file
@ -0,0 +1,27 @@
|
||||
# Item Group, Home Series
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-07 09:56:15',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-07 09:56:15',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item Group
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
'is_group': u'No',
|
||||
'item_group_name': u'Home Series',
|
||||
u'name': u'__common__',
|
||||
'parent_item_group': u'Desktops'
|
||||
},
|
||||
|
||||
# Item Group, Home Series
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
u'name': u'Home Series'
|
||||
}
|
||||
]
|
27
tests/data/item_group/laptops.txt
Normal file
27
tests/data/item_group/laptops.txt
Normal file
@ -0,0 +1,27 @@
|
||||
# Item Group, Laptops
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-07 09:55:36',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-07 09:55:36',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item Group
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
'is_group': u'Yes',
|
||||
'item_group_name': u'Laptops',
|
||||
u'name': u'__common__',
|
||||
'parent_item_group': u'All Item Groups'
|
||||
},
|
||||
|
||||
# Item Group, Laptops
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
u'name': u'Laptops'
|
||||
}
|
||||
]
|
27
tests/data/item_group/lightweight.txt
Normal file
27
tests/data/item_group/lightweight.txt
Normal file
@ -0,0 +1,27 @@
|
||||
# Item Group, Lightweight
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-07 09:56:57',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-07 09:56:58',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item Group
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
'is_group': u'No',
|
||||
'item_group_name': u'Lightweight',
|
||||
u'name': u'__common__',
|
||||
'parent_item_group': u'Laptops'
|
||||
},
|
||||
|
||||
# Item Group, Lightweight
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
u'name': u'Lightweight'
|
||||
}
|
||||
]
|
27
tests/data/item_group/medium_tablets.txt
Normal file
27
tests/data/item_group/medium_tablets.txt
Normal file
@ -0,0 +1,27 @@
|
||||
# Item Group, Medium Tablets
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-07 09:57:51',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-07 09:57:51',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item Group
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
'is_group': u'No',
|
||||
'item_group_name': u'Medium Tablets',
|
||||
u'name': u'__common__',
|
||||
'parent_item_group': u'Tablets'
|
||||
},
|
||||
|
||||
# Item Group, Medium Tablets
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
u'name': u'Medium Tablets'
|
||||
}
|
||||
]
|
27
tests/data/item_group/pro_series.txt
Normal file
27
tests/data/item_group/pro_series.txt
Normal file
@ -0,0 +1,27 @@
|
||||
# Item Group, Pro Series
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-07 09:56:20',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-07 09:56:20',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item Group
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
'is_group': u'No',
|
||||
'item_group_name': u'Pro Series',
|
||||
u'name': u'__common__',
|
||||
'parent_item_group': u'Desktops'
|
||||
},
|
||||
|
||||
# Item Group, Pro Series
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
u'name': u'Pro Series'
|
||||
}
|
||||
]
|
27
tests/data/item_group/small_tablets.txt
Normal file
27
tests/data/item_group/small_tablets.txt
Normal file
@ -0,0 +1,27 @@
|
||||
# Item Group, Small Tablets
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-07 09:57:44',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-07 09:57:44',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item Group
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
'is_group': u'No',
|
||||
'item_group_name': u'Small Tablets',
|
||||
u'name': u'__common__',
|
||||
'parent_item_group': u'Tablets'
|
||||
},
|
||||
|
||||
# Item Group, Small Tablets
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
u'name': u'Small Tablets'
|
||||
}
|
||||
]
|
27
tests/data/item_group/smartphones.txt
Normal file
27
tests/data/item_group/smartphones.txt
Normal file
@ -0,0 +1,27 @@
|
||||
# Item Group, Smartphones
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-07 09:55:49',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-07 09:55:49',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item Group
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
'is_group': u'Yes',
|
||||
'item_group_name': u'Smartphones',
|
||||
u'name': u'__common__',
|
||||
'parent_item_group': u'All Item Groups'
|
||||
},
|
||||
|
||||
# Item Group, Smartphones
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
u'name': u'Smartphones'
|
||||
}
|
||||
]
|
27
tests/data/item_group/tablets.txt
Normal file
27
tests/data/item_group/tablets.txt
Normal file
@ -0,0 +1,27 @@
|
||||
# Item Group, Tablets
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-07 09:55:42',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-07 09:55:42',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item Group
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
'is_group': u'Yes',
|
||||
'item_group_name': u'Tablets',
|
||||
u'name': u'__common__',
|
||||
'parent_item_group': u'All Item Groups'
|
||||
},
|
||||
|
||||
# Item Group, Tablets
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
u'name': u'Tablets'
|
||||
}
|
||||
]
|
27
tests/data/item_group/tough.txt
Normal file
27
tests/data/item_group/tough.txt
Normal file
@ -0,0 +1,27 @@
|
||||
# Item Group, Tough
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-07 09:56:41',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-07 09:56:41',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item Group
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
'is_group': u'No',
|
||||
'item_group_name': u'Tough',
|
||||
u'name': u'__common__',
|
||||
'parent_item_group': u'Laptops'
|
||||
},
|
||||
|
||||
# Item Group, Tough
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
u'name': u'Tough'
|
||||
}
|
||||
]
|
27
tests/data/item_group/ultrabook.txt
Normal file
27
tests/data/item_group/ultrabook.txt
Normal file
@ -0,0 +1,27 @@
|
||||
# Item Group, Ultrabook
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-08-07 09:56:50',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-08-07 09:56:50',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Item Group
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
'is_group': u'No',
|
||||
'item_group_name': u'Ultrabook',
|
||||
u'name': u'__common__',
|
||||
'parent_item_group': u'Laptops'
|
||||
},
|
||||
|
||||
# Item Group, Ultrabook
|
||||
{
|
||||
u'doctype': 'Item Group',
|
||||
u'name': u'Ultrabook'
|
||||
}
|
||||
]
|
@ -1 +0,0 @@
|
||||
from __future__ import unicode_literals
|
@ -1,21 +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/>.
|
||||
|
||||
// over-ride the link query to return relevant link names
|
||||
|
||||
cur_frm.fields_dict.document_to_rename.get_query = function(doc, dt, dn) {
|
||||
return "SELECT name FROM `tab"+doc.select_doctype+"` WHERE docstatus<2 AND name LIKE '%s' LIMIT 50";
|
||||
}
|
@ -1,31 +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
|
||||
class DocType:
|
||||
def __init__(self, d, dl=[]):
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
def rename(self):
|
||||
"""
|
||||
Generate update quereies for rename
|
||||
"""
|
||||
import webnotes.model
|
||||
|
||||
# rename the document
|
||||
webnotes.model.rename(self.doc.select_doctype, self.doc.document_to_rename, self.doc.new_name)
|
||||
|
||||
webnotes.msgprint("Successfully renamed "+self.doc.select_doctype+" : '"+self.doc.document_to_rename+"' to <b>"+self.doc.new_name+"</b>")
|
@ -1,99 +0,0 @@
|
||||
# DocType, Rename Tool
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
u'creation': '2012-07-03 13:30:42',
|
||||
u'docstatus': 0,
|
||||
u'modified': '2012-11-16 14:16:09',
|
||||
u'modified_by': u'Administrator',
|
||||
u'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all DocType
|
||||
{
|
||||
'_last_update': u'1308739509',
|
||||
'allow_email': 1,
|
||||
'allow_print': 1,
|
||||
'colour': u'White:FFF',
|
||||
u'doctype': u'DocType',
|
||||
'hide_heading': 0,
|
||||
'hide_toolbar': 0,
|
||||
'issingle': 1,
|
||||
'module': u'Utilities',
|
||||
u'name': u'__common__',
|
||||
'section_style': u'Simple',
|
||||
'show_in_menu': 0,
|
||||
'version': 1
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
{
|
||||
u'doctype': u'DocField',
|
||||
u'name': u'__common__',
|
||||
'parent': u'Rename Tool',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# These values are common for all DocPerm
|
||||
{
|
||||
'create': 1,
|
||||
u'doctype': u'DocPerm',
|
||||
u'name': u'__common__',
|
||||
'parent': u'Rename Tool',
|
||||
'parentfield': u'permissions',
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0,
|
||||
'read': 1,
|
||||
'role': u'System Manager',
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocType, Rename Tool
|
||||
{
|
||||
u'doctype': u'DocType',
|
||||
u'name': u'Rename Tool'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'select_doctype',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Select DocType',
|
||||
'options': u'\nAccount\nCompany\nCustomer\nSupplier\nEmployee\nWarehouse\nItem\nProfile\nSerial No'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'document_to_rename',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Document to rename',
|
||||
'options': u'[Select]'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'new_name',
|
||||
'fieldtype': u'Data',
|
||||
'label': u'New Name'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
u'doctype': u'DocField',
|
||||
'fieldname': u'rename',
|
||||
'fieldtype': u'Button',
|
||||
'label': u'Rename',
|
||||
'options': u'rename'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
u'doctype': u'DocPerm'
|
||||
}
|
||||
]
|
@ -24,13 +24,13 @@ def get_list(arg=None):
|
||||
webnotes.form_dict['limit_page_length'] = int(webnotes.form_dict['limit_page_length'])
|
||||
webnotes.form_dict['user'] = webnotes.session['user']
|
||||
|
||||
# set all messages as read
|
||||
webnotes.conn.sql("""UPDATE `tabComment`
|
||||
set docstatus = 1 where comment_doctype in ('My Company', 'Message')
|
||||
and comment_docname = %s
|
||||
""", webnotes.user.name)
|
||||
|
||||
if webnotes.form_dict['contact'] == webnotes.session['user']:
|
||||
# set all messages as read
|
||||
webnotes.conn.sql("""UPDATE `tabComment`
|
||||
set docstatus = 1 where comment_doctype in ('My Company', 'Message')
|
||||
and comment_docname = %s
|
||||
""", webnotes.user.name)
|
||||
|
||||
# return messages
|
||||
return webnotes.conn.sql("""select * from `tabComment`
|
||||
where (owner=%(contact)s
|
||||
|
Loading…
Reference in New Issue
Block a user