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
|
// Refresh
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
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);
|
cur_frm.toggle_display('account_name', doc.__islocal);
|
||||||
|
|
||||||
// hide fields if group
|
// hide fields if group
|
||||||
@ -34,7 +39,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
|||||||
'is_pl_account', 'company'], false);
|
'is_pl_account', 'company'], false);
|
||||||
|
|
||||||
// read-only for root accounts
|
// 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)) {
|
if(in_list(root_acc, doc.account_name)) {
|
||||||
cur_frm.perm = [[1,0,0], [1,0,0]];
|
cur_frm.perm = [[1,0,0], [1,0,0]];
|
||||||
cur_frm.set_intro("This is a root account and cannot be edited.");
|
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);
|
cur_frm.cscript.account_type(doc, cdt, cdn);
|
||||||
|
|
||||||
// show / hide convert buttons
|
// 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
|
// 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') {
|
if (cstr(doc.group_or_ledger) == 'Group') {
|
||||||
cur_frm.add_custom_button('Convert to Ledger',
|
cur_frm.add_custom_button('Convert to Ledger',
|
||||||
function() { cur_frm.cscript.convert_to_ledger(); }, 'icon-retweet')
|
function() { cur_frm.cscript.convert_to_ledger(); }, 'icon-retweet')
|
||||||
|
|||||||
@ -61,10 +61,13 @@ class DocType:
|
|||||||
elif par and not self.doc.is_pl_account:
|
elif par and not self.doc.is_pl_account:
|
||||||
self.doc.is_pl_account = par[0][2]
|
self.doc.is_pl_account = par[0][2]
|
||||||
self.doc.debit_or_credit = par[0][3]
|
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
|
# Account name must be unique
|
||||||
def validate_duplicate_account(self):
|
def validate_duplicate_account(self):
|
||||||
@ -74,21 +77,10 @@ class DocType:
|
|||||||
|
|
||||||
def validate_root_details(self):
|
def validate_root_details(self):
|
||||||
#does not exists parent
|
#does not exists parent
|
||||||
if self.doc.account_name in ['Income','Source of Funds', 'Expenses','Application of Funds'] and self.doc.parent_account:
|
if webnotes.conn.exists("Account", self.doc.name):
|
||||||
msgprint("You can not assign parent for root account", raise_exception=1)
|
if not webnotes.conn.get_value("Account", self.doc.name, "parent_account"):
|
||||||
|
webnotes.msgprint("Root cannot be edited.", 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'
|
|
||||||
|
|
||||||
def convert_group_to_ledger(self):
|
def convert_group_to_ledger(self):
|
||||||
if self.check_if_child_exists():
|
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)
|
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):
|
def on_update(self):
|
||||||
# update nsm
|
# update nsm
|
||||||
|
self.validate_max_root_accounts()
|
||||||
self.update_nsm_model()
|
self.update_nsm_model()
|
||||||
|
|
||||||
# Check user role for approval process
|
# Check user role for approval process
|
||||||
@ -189,10 +182,13 @@ class DocType:
|
|||||||
def on_rename(self,newdn,olddn):
|
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]
|
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():
|
if parts[-1].lower() != company_abbr.lower():
|
||||||
msgprint("Please add company abbreviation <b>%s</b>" %(company_abbr), raise_exception=1)
|
parts.append(company_abbr)
|
||||||
else:
|
|
||||||
account_name = " - ".join(newdnchk[:-1])
|
account_name = " - ".join(parts[:-1])
|
||||||
sql("update `tabAccount` set account_name = '%s' where name = '%s'" %(account_name,olddn))
|
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
|
"owner": "Administrator",
|
||||||
{
|
"docstatus": 0,
|
||||||
'creation': '2012-07-03 13:30:50',
|
"creation": "2012-11-16 10:32:50",
|
||||||
'docstatus': 0,
|
"modified_by": "Administrator",
|
||||||
'modified': '2012-07-11 13:58:44',
|
"modified": "2012-12-03 11:26:49"
|
||||||
'modified_by': u'Administrator',
|
},
|
||||||
'owner': u'Administrator'
|
{
|
||||||
},
|
"in_create": 1,
|
||||||
|
"search_fields": "debit_or_credit, group_or_ledger",
|
||||||
# These values are common for all DocType
|
"module": "Accounts",
|
||||||
{
|
"document_type": "Master",
|
||||||
'_last_update': u'1325570645',
|
"description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.",
|
||||||
'allow_copy': 1,
|
"name": "__common__",
|
||||||
'allow_trash': 1,
|
"default_print_format": "Standard",
|
||||||
'colour': u'White:FFF',
|
"allow_rename": 1,
|
||||||
'default_print_format': u'Standard',
|
"doctype": "DocType",
|
||||||
'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',
|
"allow_copy": 1
|
||||||
'doctype': 'DocType',
|
},
|
||||||
'document_type': u'Master',
|
{
|
||||||
'in_create': 1,
|
"name": "__common__",
|
||||||
'module': u'Accounts',
|
"parent": "Account",
|
||||||
'name': '__common__',
|
"doctype": "DocField",
|
||||||
'search_fields': u'debit_or_credit, group_or_ledger',
|
"parenttype": "DocType",
|
||||||
'section_style': u'Tray',
|
"parentfield": "fields"
|
||||||
'server_code_error': u' ',
|
},
|
||||||
'show_in_menu': 0,
|
{
|
||||||
'version': 1
|
"name": "__common__",
|
||||||
},
|
"parent": "Account",
|
||||||
|
"amend": 0,
|
||||||
# These values are common for all DocField
|
"submit": 0,
|
||||||
{
|
"doctype": "DocPerm",
|
||||||
'doctype': u'DocField',
|
"read": 1,
|
||||||
'name': '__common__',
|
"parenttype": "DocType",
|
||||||
'parent': u'Account',
|
"parentfield": "permissions"
|
||||||
'parentfield': u'fields',
|
},
|
||||||
'parenttype': u'DocType'
|
{
|
||||||
},
|
"name": "Account",
|
||||||
|
"doctype": "DocType"
|
||||||
# These values are common for all DocPerm
|
},
|
||||||
{
|
{
|
||||||
'amend': 0,
|
"oldfieldtype": "Section Break",
|
||||||
'doctype': u'DocPerm',
|
"doctype": "DocField",
|
||||||
'name': '__common__',
|
"label": "Account Details",
|
||||||
'parent': u'Account',
|
"fieldname": "properties",
|
||||||
'parentfield': u'permissions',
|
"fieldtype": "Section Break",
|
||||||
'parenttype': u'DocType',
|
"permlevel": 0
|
||||||
'read': 1,
|
},
|
||||||
'submit': 0
|
{
|
||||||
},
|
"doctype": "DocField",
|
||||||
|
"width": "50%",
|
||||||
# DocType, Account
|
"fieldname": "column_break0",
|
||||||
{
|
"fieldtype": "Column Break",
|
||||||
'doctype': 'DocType',
|
"permlevel": 0
|
||||||
'name': u'Account'
|
},
|
||||||
},
|
{
|
||||||
|
"no_copy": 1,
|
||||||
# DocPerm
|
"oldfieldtype": "Data",
|
||||||
{
|
"doctype": "DocField",
|
||||||
'cancel': 0,
|
"label": "Account Name",
|
||||||
'create': 0,
|
"oldfieldname": "account_name",
|
||||||
'doctype': u'DocPerm',
|
"fieldname": "account_name",
|
||||||
'permlevel': 0,
|
"fieldtype": "Data",
|
||||||
'role': u'Auditor',
|
"search_index": 1,
|
||||||
'write': 1
|
"reqd": 1,
|
||||||
},
|
"permlevel": 1,
|
||||||
|
"in_filter": 1
|
||||||
# DocPerm
|
},
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
"print_hide": 1,
|
||||||
'create': 0,
|
"oldfieldtype": "Int",
|
||||||
'doctype': u'DocPerm',
|
"doctype": "DocField",
|
||||||
'permlevel': 1,
|
"label": "Level",
|
||||||
'role': u'Auditor',
|
"oldfieldname": "level",
|
||||||
'write': 0
|
"fieldname": "level",
|
||||||
},
|
"fieldtype": "Int",
|
||||||
|
"hidden": 1,
|
||||||
# DocPerm
|
"permlevel": 1
|
||||||
{
|
},
|
||||||
'cancel': 0,
|
{
|
||||||
'create': 0,
|
"default": "Ledger",
|
||||||
'doctype': u'DocPerm',
|
"oldfieldtype": "Select",
|
||||||
'permlevel': 2,
|
"doctype": "DocField",
|
||||||
'role': u'Auditor',
|
"label": "Group or Ledger",
|
||||||
'write': 0
|
"oldfieldname": "group_or_ledger",
|
||||||
},
|
"permlevel": 1,
|
||||||
|
"fieldname": "group_or_ledger",
|
||||||
# DocPerm
|
"fieldtype": "Select",
|
||||||
{
|
"search_index": 1,
|
||||||
'cancel': 0,
|
"reqd": 1,
|
||||||
'create': 0,
|
"options": "\nLedger\nGroup",
|
||||||
'doctype': u'DocPerm',
|
"in_filter": 1
|
||||||
'permlevel': 0,
|
},
|
||||||
'role': u'Sales User',
|
{
|
||||||
'write': 0
|
"oldfieldtype": "Data",
|
||||||
},
|
"doctype": "DocField",
|
||||||
|
"label": "Debit or Credit",
|
||||||
# DocPerm
|
"oldfieldname": "debit_or_credit",
|
||||||
{
|
"fieldname": "debit_or_credit",
|
||||||
'cancel': 0,
|
"fieldtype": "Data",
|
||||||
'create': 0,
|
"search_index": 1,
|
||||||
'doctype': u'DocPerm',
|
"permlevel": 1,
|
||||||
'permlevel': 0,
|
"in_filter": 1
|
||||||
'role': u'Purchase User',
|
},
|
||||||
'write': 0
|
{
|
||||||
},
|
"oldfieldtype": "Select",
|
||||||
|
"doctype": "DocField",
|
||||||
# DocPerm
|
"label": "Is PL Account",
|
||||||
{
|
"oldfieldname": "is_pl_account",
|
||||||
'cancel': 0,
|
"options": "Yes\nNo",
|
||||||
'create': 0,
|
"fieldname": "is_pl_account",
|
||||||
'doctype': u'DocPerm',
|
"fieldtype": "Select",
|
||||||
'permlevel': 0,
|
"search_index": 1,
|
||||||
'role': u'Accounts User',
|
"permlevel": 1,
|
||||||
'write': 1
|
"in_filter": 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
# DocPerm
|
"oldfieldtype": "Link",
|
||||||
{
|
"doctype": "DocField",
|
||||||
'cancel': 1,
|
"label": "Company",
|
||||||
'create': 1,
|
"oldfieldname": "company",
|
||||||
'doctype': u'DocPerm',
|
"options": "Company",
|
||||||
'permlevel': 0,
|
"fieldname": "company",
|
||||||
'role': u'Accounts Manager',
|
"fieldtype": "Link",
|
||||||
'write': 1
|
"search_index": 1,
|
||||||
},
|
"reqd": 1,
|
||||||
|
"permlevel": 1,
|
||||||
# DocPerm
|
"in_filter": 1
|
||||||
{
|
},
|
||||||
'cancel': 0,
|
{
|
||||||
'create': 0,
|
"doctype": "DocField",
|
||||||
'doctype': u'DocPerm',
|
"width": "50%",
|
||||||
'permlevel': 1,
|
"fieldname": "column_break1",
|
||||||
'role': u'Accounts User',
|
"fieldtype": "Column Break",
|
||||||
'write': 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
# DocPerm
|
"oldfieldtype": "Link",
|
||||||
{
|
"doctype": "DocField",
|
||||||
'cancel': 0,
|
"label": "Parent Account",
|
||||||
'create': 0,
|
"oldfieldname": "parent_account",
|
||||||
'doctype': u'DocPerm',
|
"trigger": "Client",
|
||||||
'permlevel': 1,
|
"fieldname": "parent_account",
|
||||||
'role': u'Accounts Manager',
|
"fieldtype": "Link",
|
||||||
'write': 0
|
"search_index": 1,
|
||||||
},
|
"options": "Account",
|
||||||
|
"permlevel": 0
|
||||||
# DocPerm
|
},
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
"description": "Setting Account Type helps in selecting this Account in transactions.",
|
||||||
'create': 0,
|
"oldfieldtype": "Select",
|
||||||
'doctype': u'DocPerm',
|
"colour": "White:FFF",
|
||||||
'permlevel': 2,
|
"doctype": "DocField",
|
||||||
'role': u'Accounts Manager',
|
"label": "Account Type",
|
||||||
'write': 1
|
"oldfieldname": "account_type",
|
||||||
},
|
"permlevel": 0,
|
||||||
|
"trigger": "Client",
|
||||||
# DocPerm
|
"fieldname": "account_type",
|
||||||
{
|
"fieldtype": "Select",
|
||||||
'cancel': 0,
|
"search_index": 0,
|
||||||
'create': 0,
|
"in_filter": 1,
|
||||||
'doctype': u'DocPerm',
|
"options": "\nFixed Asset Account\nBank or Cash\nExpense Account\nTax\nIncome Account\nChargeable"
|
||||||
'permlevel': 2,
|
},
|
||||||
'role': u'Accounts User',
|
{
|
||||||
'write': 0
|
"description": "Rate at which this tax is applied",
|
||||||
},
|
"oldfieldtype": "Currency",
|
||||||
|
"colour": "White:FFF",
|
||||||
# DocField
|
"doctype": "DocField",
|
||||||
{
|
"label": "Rate",
|
||||||
'doctype': u'DocField',
|
"oldfieldname": "tax_rate",
|
||||||
'fieldname': u'properties',
|
"fieldname": "tax_rate",
|
||||||
'fieldtype': u'Section Break',
|
"fieldtype": "Currency",
|
||||||
'label': u'Account Details',
|
"reqd": 0,
|
||||||
'oldfieldtype': u'Section Break',
|
"hidden": 0,
|
||||||
'permlevel': 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
# DocField
|
"description": "If the account is frozen, entries are allowed for the \"Account Manager\" only.",
|
||||||
{
|
"oldfieldtype": "Select",
|
||||||
'doctype': u'DocField',
|
"colour": "White:FFF",
|
||||||
'fieldname': u'column_break0',
|
"doctype": "DocField",
|
||||||
'fieldtype': u'Column Break',
|
"label": "Frozen",
|
||||||
'permlevel': 0,
|
"oldfieldname": "freeze_account",
|
||||||
'width': u'50%'
|
"options": "No\nYes",
|
||||||
},
|
"fieldname": "freeze_account",
|
||||||
|
"fieldtype": "Select",
|
||||||
# DocField
|
"permlevel": 2
|
||||||
{
|
},
|
||||||
'doctype': u'DocField',
|
{
|
||||||
'fieldname': u'account_name',
|
"print_hide": 1,
|
||||||
'fieldtype': u'Data',
|
"oldfieldtype": "Int",
|
||||||
'in_filter': 1,
|
"colour": "White:FFF",
|
||||||
'label': u'Account Name',
|
"doctype": "DocField",
|
||||||
'no_copy': 1,
|
"label": "Credit Days",
|
||||||
'oldfieldname': u'account_name',
|
"oldfieldname": "credit_days",
|
||||||
'oldfieldtype': u'Data',
|
"fieldname": "credit_days",
|
||||||
'permlevel': 1,
|
"fieldtype": "Int",
|
||||||
'reqd': 1,
|
"hidden": 1,
|
||||||
'search_index': 1
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
# DocField
|
"print_hide": 1,
|
||||||
{
|
"oldfieldtype": "Currency",
|
||||||
'doctype': u'DocField',
|
"doctype": "DocField",
|
||||||
'fieldname': u'level',
|
"label": "Credit Limit",
|
||||||
'fieldtype': u'Int',
|
"oldfieldname": "credit_limit",
|
||||||
'hidden': 1,
|
"fieldname": "credit_limit",
|
||||||
'label': u'Level',
|
"fieldtype": "Currency",
|
||||||
'oldfieldname': u'level',
|
"hidden": 1,
|
||||||
'oldfieldtype': u'Int',
|
"permlevel": 0
|
||||||
'permlevel': 1,
|
},
|
||||||
'print_hide': 1
|
{
|
||||||
},
|
"description": "If this Account represents a Customer, Supplier or Employee, set it here.",
|
||||||
|
"oldfieldtype": "Select",
|
||||||
# DocField
|
"colour": "White:FFF",
|
||||||
{
|
"doctype": "DocField",
|
||||||
'default': u'Ledger',
|
"label": "Master Type",
|
||||||
'doctype': u'DocField',
|
"oldfieldname": "master_type",
|
||||||
'fieldname': u'group_or_ledger',
|
"options": "\nSupplier\nCustomer\nEmployee",
|
||||||
'fieldtype': u'Select',
|
"fieldname": "master_type",
|
||||||
'in_filter': 1,
|
"fieldtype": "Select",
|
||||||
'label': u'Group or Ledger',
|
"permlevel": 0
|
||||||
'oldfieldname': u'group_or_ledger',
|
},
|
||||||
'oldfieldtype': u'Select',
|
{
|
||||||
'options': u'\nLedger\nGroup',
|
"oldfieldtype": "Link",
|
||||||
'permlevel': 1,
|
"doctype": "DocField",
|
||||||
'reqd': 1,
|
"label": "Master Name",
|
||||||
'search_index': 1
|
"oldfieldname": "master_name",
|
||||||
},
|
"trigger": "Client",
|
||||||
|
"fieldname": "master_name",
|
||||||
# DocField
|
"fieldtype": "Link",
|
||||||
{
|
"options": "[Select]",
|
||||||
'doctype': u'DocField',
|
"permlevel": 0
|
||||||
'fieldname': u'debit_or_credit',
|
},
|
||||||
'fieldtype': u'Data',
|
{
|
||||||
'in_filter': 1,
|
"create": 0,
|
||||||
'label': u'Debit or Credit',
|
"doctype": "DocPerm",
|
||||||
'oldfieldname': u'debit_or_credit',
|
"write": 1,
|
||||||
'oldfieldtype': u'Data',
|
"cancel": 0,
|
||||||
'permlevel': 1,
|
"role": "Auditor",
|
||||||
'search_index': 1
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
# DocField
|
"create": 0,
|
||||||
{
|
"doctype": "DocPerm",
|
||||||
'doctype': u'DocField',
|
"write": 0,
|
||||||
'fieldname': u'is_pl_account',
|
"cancel": 0,
|
||||||
'fieldtype': u'Select',
|
"role": "Auditor",
|
||||||
'in_filter': 1,
|
"permlevel": 2
|
||||||
'label': u'Is PL Account',
|
},
|
||||||
'oldfieldname': u'is_pl_account',
|
{
|
||||||
'oldfieldtype': u'Select',
|
"create": 0,
|
||||||
'options': u'Yes\nNo',
|
"doctype": "DocPerm",
|
||||||
'permlevel': 1,
|
"write": 0,
|
||||||
'search_index': 1
|
"cancel": 0,
|
||||||
},
|
"role": "Auditor",
|
||||||
|
"permlevel": 1
|
||||||
# DocField
|
},
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"create": 0,
|
||||||
'fieldname': u'company',
|
"doctype": "DocPerm",
|
||||||
'fieldtype': u'Link',
|
"write": 0,
|
||||||
'in_filter': 1,
|
"cancel": 0,
|
||||||
'label': u'Company',
|
"role": "Sales User",
|
||||||
'oldfieldname': u'company',
|
"permlevel": 0
|
||||||
'oldfieldtype': u'Link',
|
},
|
||||||
'options': u'Company',
|
{
|
||||||
'permlevel': 1,
|
"create": 0,
|
||||||
'reqd': 1,
|
"doctype": "DocPerm",
|
||||||
'search_index': 1
|
"write": 0,
|
||||||
},
|
"cancel": 0,
|
||||||
|
"role": "Purchase User",
|
||||||
# DocField
|
"permlevel": 0
|
||||||
{
|
},
|
||||||
'doctype': u'DocField',
|
{
|
||||||
'fieldname': u'column_break1',
|
"create": 0,
|
||||||
'fieldtype': u'Column Break',
|
"doctype": "DocPerm",
|
||||||
'permlevel': 0,
|
"write": 1,
|
||||||
'width': u'50%'
|
"cancel": 0,
|
||||||
},
|
"role": "Accounts User",
|
||||||
|
"permlevel": 0
|
||||||
# DocField
|
},
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"create": 1,
|
||||||
'fieldname': u'parent_account',
|
"doctype": "DocPerm",
|
||||||
'fieldtype': u'Link',
|
"write": 1,
|
||||||
'label': u'Parent Account',
|
"cancel": 1,
|
||||||
'oldfieldname': u'parent_account',
|
"role": "Accounts Manager",
|
||||||
'oldfieldtype': u'Link',
|
"permlevel": 0
|
||||||
'options': u'Account',
|
},
|
||||||
'permlevel': 0,
|
{
|
||||||
'search_index': 1,
|
"create": 0,
|
||||||
'trigger': u'Client'
|
"doctype": "DocPerm",
|
||||||
},
|
"write": 0,
|
||||||
|
"cancel": 0,
|
||||||
# DocField
|
"role": "Accounts User",
|
||||||
{
|
"permlevel": 1
|
||||||
'colour': u'White:FFF',
|
},
|
||||||
'description': u'Setting Account Type helps in selecting this Account in transactions.',
|
{
|
||||||
'doctype': u'DocField',
|
"create": 0,
|
||||||
'fieldname': u'account_type',
|
"doctype": "DocPerm",
|
||||||
'fieldtype': u'Select',
|
"write": 0,
|
||||||
'in_filter': 1,
|
"cancel": 0,
|
||||||
'label': u'Account Type',
|
"role": "Accounts Manager",
|
||||||
'oldfieldname': u'account_type',
|
"permlevel": 1
|
||||||
'oldfieldtype': u'Select',
|
},
|
||||||
'options': u'\nFixed Asset Account\nBank or Cash\nExpense Account\nTax\nIncome Account\nChargeable',
|
{
|
||||||
'permlevel': 0,
|
"create": 0,
|
||||||
'search_index': 0,
|
"doctype": "DocPerm",
|
||||||
'trigger': u'Client'
|
"write": 1,
|
||||||
},
|
"cancel": 0,
|
||||||
|
"role": "Accounts Manager",
|
||||||
# DocField
|
"permlevel": 2
|
||||||
{
|
},
|
||||||
'colour': u'White:FFF',
|
{
|
||||||
'description': u'Rate at which this tax is applied',
|
"create": 0,
|
||||||
'doctype': u'DocField',
|
"doctype": "DocPerm",
|
||||||
'fieldname': u'tax_rate',
|
"write": 0,
|
||||||
'fieldtype': u'Currency',
|
"cancel": 0,
|
||||||
'hidden': 0,
|
"role": "Accounts User",
|
||||||
'label': u'Rate',
|
"permlevel": 2
|
||||||
'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'
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
@ -142,7 +142,7 @@ class DocType:
|
|||||||
def save_entries(self, cancel, adv_adj, update_outstanding):
|
def save_entries(self, cancel, adv_adj, update_outstanding):
|
||||||
for le in self.entries:
|
for le in self.entries:
|
||||||
# round off upto 2 decimal
|
# 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
|
#toggle debit, credit if negative entry
|
||||||
if flt(le.debit) < 0 or flt(le.credit) < 0:
|
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) {
|
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||||
if(cint(wn.boot.notification_settings.sales_invoice)) {
|
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="layout-wrapper layout-wrapper-background">
|
||||||
<div class="appframe-area"></div>
|
<div class="appframe-area"></div>
|
||||||
<div class="layout-main-section">
|
<div class="layout-main">
|
||||||
<div class="tree-area"></div>
|
<div class="tree-area"></div>
|
||||||
</div>
|
<hr>
|
||||||
<div class="layout-side-section">
|
<div class="well">
|
||||||
<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>
|
<h4>Quick Help</h4>
|
||||||
2. Please do NOT create accounts (ledgers) for Customers and Suppliers. They are created directly from the Customer / Supplier masters.<br>
|
<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>
|
</div>
|
||||||
<div class="clear"></div>
|
|
||||||
</div>
|
</div>
|
||||||
@ -38,6 +38,7 @@ pscript['onload_Accounts Browser'] = function(wrapper){
|
|||||||
.change(function() {
|
.change(function() {
|
||||||
var ctype = wn.get_route()[1] || 'Account';
|
var ctype = wn.get_route()[1] || 'Account';
|
||||||
erpnext.account_chart = new erpnext.AccountsChart(ctype, $(this).val(), wrapper);
|
erpnext.account_chart = new erpnext.AccountsChart(ctype, $(this).val(), wrapper);
|
||||||
|
pscript.set_title(wrapper, ctype, $(this).val());
|
||||||
})
|
})
|
||||||
.appendTo(wrapper.appframe.$w.find('.appframe-toolbar'));
|
.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();
|
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){
|
pscript['onshow_Accounts Browser'] = function(wrapper){
|
||||||
// set route
|
// set route
|
||||||
var ctype = wn.get_route()[1] || 'Account';
|
var ctype = wn.get_route()[1] || 'Account';
|
||||||
|
|
||||||
wrapper.appframe.set_title('Chart of '+ctype+'s');
|
|
||||||
|
|
||||||
if(erpnext.account_chart && erpnext.account_chart.ctype != ctype) {
|
if(erpnext.account_chart && erpnext.account_chart.ctype != ctype) {
|
||||||
wrapper.$company_select.change();
|
wrapper.$company_select.change();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pscript.set_title(wrapper, ctype);
|
||||||
}
|
}
|
||||||
|
|
||||||
erpnext.AccountsChart = Class.extend({
|
erpnext.AccountsChart = Class.extend({
|
||||||
@ -71,6 +85,11 @@ erpnext.AccountsChart = Class.extend({
|
|||||||
$(wrapper).find('.tree-area').empty();
|
$(wrapper).find('.tree-area').empty();
|
||||||
var me = this;
|
var me = this;
|
||||||
me.ctype = ctype;
|
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;
|
me.company = company;
|
||||||
this.tree = new wn.ui.Tree({
|
this.tree = new wn.ui.Tree({
|
||||||
parent: $(wrapper).find('.tree-area'),
|
parent: $(wrapper).find('.tree-area'),
|
||||||
@ -116,17 +135,24 @@ erpnext.AccountsChart = Class.extend({
|
|||||||
var node_links = [];
|
var node_links = [];
|
||||||
// edit
|
// edit
|
||||||
if (wn.boot.profile.can_read.indexOf(this.ctype) !== -1) {
|
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>');
|
+encodeURIComponent(data.value)+'">Edit</a>');
|
||||||
}
|
}
|
||||||
if (data.expandable) {
|
if (data.expandable) {
|
||||||
if((wn.boot.profile.can_create.indexOf(this.ctype) !== -1) ||
|
if(this.can_create) {
|
||||||
(wn.boot.profile.in_create.indexOf(this.ctype) !== -1)) {
|
|
||||||
node_links.push('<a onclick="erpnext.account_chart.new_node();">Add Child</a>');
|
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) {
|
} 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>');
|
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(" | "));
|
link.toolbar.append(node_links.join(" | "));
|
||||||
},
|
},
|
||||||
@ -135,6 +161,18 @@ erpnext.AccountsChart = Class.extend({
|
|||||||
var node = me.selected_node();
|
var node = me.selected_node();
|
||||||
wn.set_route("general-ledger", "account=" + node.data('label'));
|
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() {
|
new_node: function() {
|
||||||
if(this.ctype=='Account') {
|
if(this.ctype=='Account') {
|
||||||
this.new_account();
|
this.new_account();
|
||||||
@ -216,6 +254,8 @@ erpnext.AccountsChart = Class.extend({
|
|||||||
$(fd.group_or_ledger.input).change();
|
$(fd.group_or_ledger.input).change();
|
||||||
$(fd.account_type.input).change();
|
$(fd.account_type.input).change();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$(fd.group_or_ledger.input).val("Ledger").change();
|
||||||
d.show();
|
d.show();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -220,6 +220,6 @@ cur_frm.pformat.indent_no = function(doc, cdt, cdn){
|
|||||||
|
|
||||||
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||||
if(cint(wn.boot.notification_settings.purchase_order)) {
|
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,
|
"docstatus": 0,
|
||||||
"creation": "2012-08-06 20:00:37",
|
"creation": "2012-08-06 20:00:37",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"modified": "2012-08-06 17:14:19"
|
"modified": "2012-08-06 17:14:18"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
|
|||||||
@ -107,8 +107,7 @@ class DocType(TransactionBase):
|
|||||||
#validation for Naming Series mandatory field...
|
#validation for Naming Series mandatory field...
|
||||||
if get_defaults()['supp_master_name'] == 'Naming Series':
|
if get_defaults()['supp_master_name'] == 'Naming Series':
|
||||||
if not self.doc.naming_series:
|
if not self.doc.naming_series:
|
||||||
msgprint("Series is Mandatory.")
|
msgprint("Series is Mandatory.", raise_exception=1)
|
||||||
raise Exception
|
|
||||||
|
|
||||||
def create_account_head(self):
|
def create_account_head(self):
|
||||||
if self.doc.company :
|
if self.doc.company :
|
||||||
@ -174,5 +173,11 @@ class DocType(TransactionBase):
|
|||||||
for rec in update_fields:
|
for rec in update_fields:
|
||||||
sql("update `tab%s` set supplier_name = '%s' where %s = '%s'" %(rec[0],newdn,rec[1],olddn))
|
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
|
#update master_name in doctype account
|
||||||
sql("update `tabAccount` set master_name = '%s', master_type = 'Supplier' where master_name = '%s'" %(newdn,olddn))
|
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",
|
"owner": "Administrator",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"creation": "2012-11-02 17:17:04",
|
"creation": "2012-12-03 10:31:02",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"modified": "2012-11-30 10:53:32"
|
"modified": "2012-12-03 11:25:12"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"autoname": "naming_series:",
|
"autoname": "naming_series:",
|
||||||
"name": "__common__",
|
"description": "Supplier of Goods or Services.",
|
||||||
|
"allow_rename": 1,
|
||||||
"search_fields": "supplier_name,supplier_type",
|
"search_fields": "supplier_name,supplier_type",
|
||||||
"module": "Buying",
|
"module": "Buying",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "Master"
|
"document_type": "Master",
|
||||||
|
"name": "__common__"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "__common__",
|
"name": "__common__",
|
||||||
@ -243,6 +245,26 @@
|
|||||||
"fieldtype": "Small Text",
|
"fieldtype": "Small Text",
|
||||||
"permlevel": 1
|
"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",
|
"doctype": "DocPerm",
|
||||||
"role": "Purchase Master Manager",
|
"role": "Purchase Master Manager",
|
||||||
@ -257,25 +279,5 @@
|
|||||||
"role": "Purchase Master Manager",
|
"role": "Purchase Master Manager",
|
||||||
"cancel": 1,
|
"cancel": 1,
|
||||||
"permlevel": 0
|
"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 = [
|
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", [
|
["30th November 2012", [
|
||||||
"Auto Notifications: System will prompt user with pre-set message for auto-notification.",
|
"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.",
|
"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) {
|
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||||
if(cint(wn.boot.notification_settings.expense_claim)) {
|
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
|
# add operation in op list
|
||||||
self.op.append(cstr(d.operation_no))
|
self.op.append(cstr(d.operation_no))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def validate_materials(self):
|
def validate_materials(self):
|
||||||
""" Validate raw material entries """
|
""" Validate raw material entries """
|
||||||
check_list = []
|
check_list = []
|
||||||
for m in getlist(self.doclist, 'bom_materials'):
|
for m in getlist(self.doclist, 'bom_materials'):
|
||||||
# check if operation no not in op table
|
# 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
|
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)
|
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
|
"owner": "Administrator",
|
||||||
{
|
"docstatus": 0,
|
||||||
'creation': '2012-03-27 14:36:07',
|
"creation": "2012-11-30 18:13:54",
|
||||||
'docstatus': 0,
|
"modified_by": "Administrator",
|
||||||
'modified': '2012-03-27 14:36:07',
|
"modified": "2012-12-03 09:33:28"
|
||||||
'modified_by': u'Administrator',
|
},
|
||||||
'owner': u'Administrator'
|
{
|
||||||
},
|
"autoname": "TSD.#####",
|
||||||
|
"name": "__common__",
|
||||||
# These values are common for all DocType
|
"doctype": "DocType",
|
||||||
{
|
"module": "Projects"
|
||||||
'autoname': u'TSD.#####',
|
},
|
||||||
'colour': u'White:FFF',
|
{
|
||||||
'doctype': 'DocType',
|
"name": "__common__",
|
||||||
'module': u'Projects',
|
"parent": "Timesheet Detail",
|
||||||
'name': '__common__',
|
"doctype": "DocField",
|
||||||
'section_style': u'Simple',
|
"parenttype": "DocType",
|
||||||
'server_code_error': u' ',
|
"parentfield": "fields"
|
||||||
'version': 15
|
},
|
||||||
},
|
{
|
||||||
|
"name": "Timesheet Detail",
|
||||||
# These values are common for all DocField
|
"doctype": "DocType"
|
||||||
{
|
},
|
||||||
'doctype': u'DocField',
|
{
|
||||||
'name': '__common__',
|
"oldfieldtype": "Time",
|
||||||
'parent': u'Timesheet Detail',
|
"doctype": "DocField",
|
||||||
'parentfield': u'fields',
|
"label": "Actual Start Time",
|
||||||
'parenttype': u'DocType'
|
"oldfieldname": "act_start_time",
|
||||||
},
|
"width": "160px",
|
||||||
|
"fieldname": "act_start_time",
|
||||||
# DocType, Timesheet Detail
|
"fieldtype": "Time",
|
||||||
{
|
"reqd": 1,
|
||||||
'doctype': 'DocType',
|
"permlevel": 0
|
||||||
'name': u'Timesheet Detail'
|
},
|
||||||
},
|
{
|
||||||
|
"oldfieldtype": "Time",
|
||||||
# DocField
|
"doctype": "DocField",
|
||||||
{
|
"label": "Actual End Time",
|
||||||
'doctype': u'DocField',
|
"oldfieldname": "act_end_time",
|
||||||
'fieldname': u'act_start_time',
|
"width": "160px",
|
||||||
'fieldtype': u'Time',
|
"fieldname": "act_end_time",
|
||||||
'label': u'Actual Start Time',
|
"fieldtype": "Time",
|
||||||
'oldfieldname': u'act_start_time',
|
"reqd": 1,
|
||||||
'oldfieldtype': u'Time',
|
"permlevel": 0
|
||||||
'permlevel': 0,
|
},
|
||||||
'reqd': 1,
|
{
|
||||||
'width': u'160px'
|
"search_index": 0,
|
||||||
},
|
"doctype": "DocField",
|
||||||
|
"label": "Activity Type",
|
||||||
# DocField
|
"width": "200px",
|
||||||
{
|
"options": "Activity Type",
|
||||||
'doctype': u'DocField',
|
"fieldname": "activity_type",
|
||||||
'fieldname': u'act_end_time',
|
"fieldtype": "Link",
|
||||||
'fieldtype': u'Time',
|
"reqd": 1,
|
||||||
'label': u'Actual End Time',
|
"permlevel": 0
|
||||||
'oldfieldname': u'act_end_time',
|
},
|
||||||
'oldfieldtype': u'Time',
|
{
|
||||||
'permlevel': 0,
|
"oldfieldtype": "Text",
|
||||||
'reqd': 1,
|
"doctype": "DocField",
|
||||||
'width': u'160px'
|
"label": "Additional Info",
|
||||||
},
|
"oldfieldname": "other_details",
|
||||||
|
"width": "200px",
|
||||||
# DocField
|
"fieldname": "other_details",
|
||||||
{
|
"fieldtype": "Text",
|
||||||
'doctype': u'DocField',
|
"permlevel": 0
|
||||||
'fieldname': u'activity_type',
|
},
|
||||||
'fieldtype': u'Link',
|
{
|
||||||
'label': u'Activity Type',
|
"oldfieldtype": "Data",
|
||||||
'options': u'Activity Type',
|
"doctype": "DocField",
|
||||||
'permlevel': 0,
|
"label": "Total Hours (Actual)",
|
||||||
'reqd': 1,
|
"oldfieldname": "act_total_hrs",
|
||||||
'search_index': 0,
|
"width": "100px",
|
||||||
'width': u'200px'
|
"fieldname": "act_total_hrs",
|
||||||
},
|
"fieldtype": "Data",
|
||||||
|
"permlevel": 1
|
||||||
# DocField
|
},
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"oldfieldtype": "Data",
|
||||||
'fieldname': u'other_details',
|
"doctype": "DocField",
|
||||||
'fieldtype': u'Text',
|
"label": "Customer Name",
|
||||||
'label': u'Additional Info',
|
"oldfieldname": "customer_name",
|
||||||
'oldfieldname': u'other_details',
|
"width": "150px",
|
||||||
'oldfieldtype': u'Text',
|
"options": "Customer",
|
||||||
'permlevel': 0,
|
"fieldname": "customer_name",
|
||||||
'width': u'200px'
|
"fieldtype": "Link",
|
||||||
},
|
"permlevel": 0
|
||||||
|
},
|
||||||
# DocField
|
{
|
||||||
{
|
"permlevel": 0,
|
||||||
'doctype': u'DocField',
|
"oldfieldtype": "Link",
|
||||||
'fieldname': u'act_total_hrs',
|
"doctype": "DocField",
|
||||||
'fieldtype': u'Data',
|
"label": "Project",
|
||||||
'label': u'Total Hours (Actual)',
|
"oldfieldname": "project_name",
|
||||||
'oldfieldname': u'act_total_hrs',
|
"width": "150px",
|
||||||
'oldfieldtype': u'Data',
|
"fieldname": "project_name",
|
||||||
'permlevel': 1,
|
"fieldtype": "Link",
|
||||||
'width': u'100px'
|
"search_index": 1,
|
||||||
},
|
"reqd": 0,
|
||||||
|
"options": "Project",
|
||||||
# DocField
|
"in_filter": 1
|
||||||
{
|
},
|
||||||
'doctype': u'DocField',
|
{
|
||||||
'fieldname': u'customer_name',
|
"oldfieldtype": "Link",
|
||||||
'fieldtype': u'Link',
|
"doctype": "DocField",
|
||||||
'label': u'Customer Name',
|
"label": "Task Id",
|
||||||
'oldfieldname': u'customer_name',
|
"oldfieldname": "task_id",
|
||||||
'oldfieldtype': u'Data',
|
"width": "150px",
|
||||||
'options': u'Customer',
|
"options": "Task",
|
||||||
'permlevel': 0,
|
"fieldname": "task_id",
|
||||||
'width': u'150px'
|
"fieldtype": "Link",
|
||||||
},
|
"search_index": 1,
|
||||||
|
"permlevel": 0,
|
||||||
# DocField
|
"in_filter": 1
|
||||||
{
|
},
|
||||||
'doctype': u'DocField',
|
{
|
||||||
'fieldname': u'project_name',
|
"oldfieldtype": "Link",
|
||||||
'fieldtype': u'Link',
|
"doctype": "DocField",
|
||||||
'in_filter': 1,
|
"label": "Task Name",
|
||||||
'label': u'Project',
|
"oldfieldname": "task_name",
|
||||||
'oldfieldname': u'project_name',
|
"width": "250px",
|
||||||
'oldfieldtype': u'Link',
|
"fieldname": "task_name",
|
||||||
'options': u'Project',
|
"fieldtype": "Data",
|
||||||
'permlevel': 0,
|
"search_index": 0,
|
||||||
'reqd': 0,
|
"reqd": 0,
|
||||||
'search_index': 1,
|
"permlevel": 0
|
||||||
'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'
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
@ -125,6 +125,7 @@ class DocType(TransactionBase):
|
|||||||
parent_account = self.get_receivables_group()
|
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}
|
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
|
# create
|
||||||
|
|
||||||
ac = get_obj('GL Control').add_ac(cstr(arg))
|
ac = get_obj('GL Control').add_ac(cstr(arg))
|
||||||
msgprint("Account Head created for "+ac)
|
msgprint("Account Head created for "+ac)
|
||||||
else :
|
else :
|
||||||
@ -236,5 +237,11 @@ class DocType(TransactionBase):
|
|||||||
for rec in update_fields:
|
for rec in update_fields:
|
||||||
sql("update `tab%s` set customer_name = '%s' where %s = '%s'" %(rec[0],newdn,rec[1],olddn))
|
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
|
#update master_name in doctype account
|
||||||
sql("update `tabAccount` set master_name = '%s', master_type = 'Customer' where master_name = '%s'" %(newdn,olddn))
|
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",
|
"owner": "Administrator",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"creation": "2012-11-02 17:16:46",
|
"creation": "2012-12-03 10:31:05",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"modified": "2012-11-30 10:54:38"
|
"modified": "2012-12-03 11:25:29"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"autoname": "naming_series:",
|
"description": "Buyer of Goods and Services.",
|
||||||
"name": "__common__",
|
|
||||||
"default_print_format": "Standard",
|
|
||||||
"allow_print": 0,
|
"allow_print": 0,
|
||||||
"search_fields": "customer_name,customer_group,country,territory",
|
"search_fields": "customer_name,customer_group,country,territory",
|
||||||
"module": "Selling",
|
"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__",
|
"name": "__common__",
|
||||||
@ -364,44 +366,54 @@
|
|||||||
"fieldtype": "Small Text",
|
"fieldtype": "Small Text",
|
||||||
"permlevel": 1
|
"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,
|
"amend": 0,
|
||||||
"create": 1,
|
"create": 1,
|
||||||
"doctype": "DocPerm",
|
"doctype": "DocPerm",
|
||||||
"submit": 0,
|
"submit": 0,
|
||||||
"write": 1,
|
"write": 1,
|
||||||
"role": "Sales Master Manager",
|
|
||||||
"cancel": 1,
|
"cancel": 1,
|
||||||
"permlevel": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"amend": 0,
|
|
||||||
"create": 0,
|
|
||||||
"doctype": "DocPerm",
|
|
||||||
"submit": 0,
|
|
||||||
"write": 0,
|
|
||||||
"role": "Sales Master Manager",
|
"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
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -410,18 +422,18 @@
|
|||||||
"doctype": "DocPerm",
|
"doctype": "DocPerm",
|
||||||
"submit": 0,
|
"submit": 0,
|
||||||
"write": 0,
|
"write": 0,
|
||||||
"role": "Sales User",
|
|
||||||
"cancel": 0,
|
"cancel": 0,
|
||||||
|
"role": "Sales Master Manager",
|
||||||
"permlevel": 1
|
"permlevel": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"amend": 0,
|
"amend": 0,
|
||||||
"create": 0,
|
"create": 1,
|
||||||
"doctype": "DocPerm",
|
"doctype": "DocPerm",
|
||||||
"submit": 0,
|
"submit": 0,
|
||||||
"write": 0,
|
"write": 1,
|
||||||
"role": "Sales User",
|
|
||||||
"cancel": 0,
|
"cancel": 0,
|
||||||
|
"role": "Purchase User",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -94,8 +94,21 @@ cur_frm.cscript.lead_cust_show = function(doc,cdt,cdn){
|
|||||||
|
|
||||||
// customer
|
// customer
|
||||||
cur_frm.cscript.customer = function(doc,dt,dn) {
|
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) {
|
||||||
if(doc.customer) unhide_field(['customer_name','customer_address','contact_person','address_display','contact_display','contact_mobile','contact_email','territory','customer_group']);
|
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) {
|
cur_frm.cscript.customer_address = cur_frm.cscript.contact_person = function(doc,dt,dn) {
|
||||||
|
|||||||
@ -2,19 +2,20 @@
|
|||||||
{
|
{
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"creation": "2012-11-24 17:21:44",
|
"creation": "2012-12-03 10:31:06",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"modified": "2012-11-30 10:54:00"
|
"modified": "2012-12-03 13:57:32"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"autoname": "naming_series:",
|
"autoname": "naming_series:",
|
||||||
"name": "__common__",
|
"description": "Potential Sales Deal",
|
||||||
"default_print_format": "Standard",
|
"default_print_format": "Standard",
|
||||||
"search_fields": "status,transaction_date,customer,lead,enquiry_type,territory,company",
|
"search_fields": "status,transaction_date,customer,lead,enquiry_type,territory,company",
|
||||||
"module": "Selling",
|
"module": "Selling",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "Transaction"
|
"document_type": "Transaction",
|
||||||
|
"name": "__common__"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "__common__",
|
"name": "__common__",
|
||||||
@ -35,16 +36,6 @@
|
|||||||
"name": "Opportunity",
|
"name": "Opportunity",
|
||||||
"doctype": "DocType"
|
"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",
|
"description": "To manage multiple series please go to Setup > Manage Series",
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
@ -474,14 +465,24 @@
|
|||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"permlevel": 1
|
"permlevel": 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"amend": 0,
|
||||||
|
"create": 0,
|
||||||
|
"doctype": "DocPerm",
|
||||||
|
"submit": 0,
|
||||||
|
"write": 0,
|
||||||
|
"cancel": 0,
|
||||||
|
"role": "Sales Manager",
|
||||||
|
"permlevel": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"amend": 1,
|
"amend": 1,
|
||||||
"create": 1,
|
"create": 1,
|
||||||
"doctype": "DocPerm",
|
"doctype": "DocPerm",
|
||||||
"submit": 1,
|
"submit": 1,
|
||||||
"write": 1,
|
"write": 1,
|
||||||
"role": "System Manager",
|
|
||||||
"cancel": 1,
|
"cancel": 1,
|
||||||
|
"role": "System Manager",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -495,8 +496,8 @@
|
|||||||
"doctype": "DocPerm",
|
"doctype": "DocPerm",
|
||||||
"submit": 1,
|
"submit": 1,
|
||||||
"write": 1,
|
"write": 1,
|
||||||
"role": "Sales User",
|
|
||||||
"cancel": 1,
|
"cancel": 1,
|
||||||
|
"role": "Sales User",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -505,8 +506,8 @@
|
|||||||
"doctype": "DocPerm",
|
"doctype": "DocPerm",
|
||||||
"submit": 0,
|
"submit": 0,
|
||||||
"write": 0,
|
"write": 0,
|
||||||
"role": "Sales User",
|
|
||||||
"cancel": 0,
|
"cancel": 0,
|
||||||
|
"role": "Sales User",
|
||||||
"permlevel": 1
|
"permlevel": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -515,18 +516,8 @@
|
|||||||
"doctype": "DocPerm",
|
"doctype": "DocPerm",
|
||||||
"submit": 1,
|
"submit": 1,
|
||||||
"write": 1,
|
"write": 1,
|
||||||
"role": "Sales Manager",
|
|
||||||
"cancel": 1,
|
"cancel": 1,
|
||||||
"permlevel": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"amend": 0,
|
|
||||||
"create": 0,
|
|
||||||
"doctype": "DocPerm",
|
|
||||||
"submit": 0,
|
|
||||||
"write": 0,
|
|
||||||
"role": "Sales Manager",
|
"role": "Sales Manager",
|
||||||
"cancel": 0,
|
"permlevel": 0
|
||||||
"permlevel": 1
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -369,6 +369,6 @@ cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
|||||||
|
|
||||||
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||||
if(cint(wn.boot.notification_settings.sales_order)) {
|
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
|
"owner": "Administrator",
|
||||||
{
|
"docstatus": 0,
|
||||||
'creation': '2012-05-15 12:15:00',
|
"creation": "2012-08-10 13:00:45",
|
||||||
'docstatus': 0,
|
"modified_by": "Administrator",
|
||||||
'modified': '2012-08-10 12:15:45',
|
"modified": "2012-12-03 11:26:05"
|
||||||
'modified_by': u'Administrator',
|
},
|
||||||
'owner': u'Administrator'
|
{
|
||||||
},
|
"autoname": "field:company_name",
|
||||||
|
"description": "Legal Entity / Subsidiary with a separate Chart of Accounts belonging to the Organization.",
|
||||||
# These values are common for all DocType
|
"allow_rename": 1,
|
||||||
{
|
"doctype": "DocType",
|
||||||
'_last_update': u'1323855292',
|
"module": "Setup",
|
||||||
'allow_trash': 1,
|
"document_type": "Master",
|
||||||
'autoname': u'field:company_name',
|
"name": "__common__"
|
||||||
'colour': u'White:FFF',
|
},
|
||||||
'doctype': 'DocType',
|
{
|
||||||
'document_type': u'Master',
|
"name": "__common__",
|
||||||
'module': u'Setup',
|
"parent": "Company",
|
||||||
'name': '__common__',
|
"doctype": "DocField",
|
||||||
'section_style': u'Tabbed',
|
"parenttype": "DocType",
|
||||||
'server_code_error': u' ',
|
"parentfield": "fields"
|
||||||
'show_in_menu': 0,
|
},
|
||||||
'version': 1
|
{
|
||||||
},
|
"name": "__common__",
|
||||||
|
"parent": "Company",
|
||||||
# These values are common for all DocField
|
"read": 1,
|
||||||
{
|
"doctype": "DocPerm",
|
||||||
'doctype': u'DocField',
|
"parenttype": "DocType",
|
||||||
'name': '__common__',
|
"parentfield": "permissions"
|
||||||
'parent': u'Company',
|
},
|
||||||
'parentfield': u'fields',
|
{
|
||||||
'parenttype': u'DocType'
|
"name": "Company",
|
||||||
},
|
"doctype": "DocType"
|
||||||
|
},
|
||||||
# These values are common for all DocPerm
|
{
|
||||||
{
|
"oldfieldtype": "Section Break",
|
||||||
'doctype': u'DocPerm',
|
"colour": "White:FFF",
|
||||||
'name': '__common__',
|
"doctype": "DocField",
|
||||||
'parent': u'Company',
|
"label": "Company Details",
|
||||||
'parentfield': u'permissions',
|
"fieldname": "details",
|
||||||
'parenttype': u'DocType',
|
"fieldtype": "Section Break",
|
||||||
'read': 1
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
# DocType, Company
|
"no_copy": 0,
|
||||||
{
|
"oldfieldtype": "Data",
|
||||||
'doctype': 'DocType',
|
"colour": "White:FFF",
|
||||||
'name': u'Company'
|
"doctype": "DocField",
|
||||||
},
|
"label": "Company",
|
||||||
|
"oldfieldname": "company_name",
|
||||||
# DocPerm
|
"fieldname": "company_name",
|
||||||
{
|
"fieldtype": "Data",
|
||||||
'amend': 0,
|
"reqd": 1,
|
||||||
'cancel': 1,
|
"permlevel": 0
|
||||||
'create': 1,
|
},
|
||||||
'doctype': u'DocPerm',
|
{
|
||||||
'permlevel': 0,
|
"doctype": "DocField",
|
||||||
'role': u'System Manager',
|
"fieldname": "cb0",
|
||||||
'submit': 0,
|
"fieldtype": "Column Break",
|
||||||
'write': 1
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
# DocPerm
|
"description": "Please Enter Abbreviation or Short Name properly as it will be added as Suffix to all Account Heads.",
|
||||||
{
|
"no_copy": 0,
|
||||||
'amend': 0,
|
"oldfieldtype": "Data",
|
||||||
'cancel': 1,
|
"colour": "White:FFF",
|
||||||
'create': 1,
|
"doctype": "DocField",
|
||||||
'doctype': u'DocPerm',
|
"label": "Abbr",
|
||||||
'permlevel': 0,
|
"oldfieldname": "abbr",
|
||||||
'role': u'System Manager',
|
"fieldname": "abbr",
|
||||||
'submit': 0,
|
"fieldtype": "Data",
|
||||||
'write': 1
|
"reqd": 1,
|
||||||
},
|
"permlevel": 0
|
||||||
|
},
|
||||||
# DocPerm
|
{
|
||||||
{
|
"oldfieldtype": "Section Break",
|
||||||
'cancel': 0,
|
"doctype": "DocField",
|
||||||
'doctype': u'DocPerm',
|
"label": "Default Settings",
|
||||||
'permlevel': 1,
|
"fieldname": "default_settings",
|
||||||
'role': u'All'
|
"fieldtype": "Section Break",
|
||||||
},
|
"permlevel": 0
|
||||||
|
},
|
||||||
# DocField
|
{
|
||||||
{
|
"doctype": "DocField",
|
||||||
'colour': u'White:FFF',
|
"label": "Default Currency",
|
||||||
'doctype': u'DocField',
|
"options": "link:Currency",
|
||||||
'fieldname': u'details',
|
"fieldname": "default_currency",
|
||||||
'fieldtype': u'Section Break',
|
"fieldtype": "Select",
|
||||||
'label': u'Company Details',
|
"reqd": 1,
|
||||||
'oldfieldtype': u'Section Break',
|
"permlevel": 0
|
||||||
'permlevel': 0
|
},
|
||||||
},
|
{
|
||||||
|
"no_copy": 1,
|
||||||
# DocField
|
"oldfieldtype": "Link",
|
||||||
{
|
"doctype": "DocField",
|
||||||
'colour': u'White:FFF',
|
"label": "Default Bank Account",
|
||||||
'doctype': u'DocField',
|
"oldfieldname": "default_bank_account",
|
||||||
'fieldname': u'company_name',
|
"trigger": "Client",
|
||||||
'fieldtype': u'Data',
|
"fieldname": "default_bank_account",
|
||||||
'label': u'Company',
|
"fieldtype": "Link",
|
||||||
'no_copy': 0,
|
"depends_on": "eval:!doc.__islocal",
|
||||||
'oldfieldname': u'company_name',
|
"options": "Account",
|
||||||
'oldfieldtype': u'Data',
|
"permlevel": 0
|
||||||
'permlevel': 0,
|
},
|
||||||
'reqd': 1
|
{
|
||||||
},
|
"no_copy": 1,
|
||||||
|
"oldfieldtype": "Link",
|
||||||
# DocField
|
"doctype": "DocField",
|
||||||
{
|
"label": "Receivables Group",
|
||||||
'doctype': u'DocField',
|
"oldfieldname": "receivables_group",
|
||||||
'fieldname': u'cb0',
|
"trigger": "Client",
|
||||||
'fieldtype': u'Column Break',
|
"fieldname": "receivables_group",
|
||||||
'permlevel': 0
|
"fieldtype": "Link",
|
||||||
},
|
"depends_on": "eval:!doc.__islocal",
|
||||||
|
"options": "Account",
|
||||||
# DocField
|
"permlevel": 0
|
||||||
{
|
},
|
||||||
'colour': u'White:FFF',
|
{
|
||||||
'description': u'Please Enter Abbreviation or Short Name properly as it will be added as Suffix to all Account Heads.',
|
"no_copy": 1,
|
||||||
'doctype': u'DocField',
|
"oldfieldtype": "Link",
|
||||||
'fieldname': u'abbr',
|
"doctype": "DocField",
|
||||||
'fieldtype': u'Data',
|
"label": "Payables Group",
|
||||||
'label': u'Abbr',
|
"oldfieldname": "payables_group",
|
||||||
'no_copy': 0,
|
"trigger": "Client",
|
||||||
'oldfieldname': u'abbr',
|
"fieldname": "payables_group",
|
||||||
'oldfieldtype': u'Data',
|
"fieldtype": "Link",
|
||||||
'permlevel': 0,
|
"depends_on": "eval:!doc.__islocal",
|
||||||
'reqd': 1
|
"options": "Account",
|
||||||
},
|
"permlevel": 0
|
||||||
|
},
|
||||||
# DocField
|
{
|
||||||
{
|
"oldfieldtype": "Column Break",
|
||||||
'doctype': u'DocField',
|
"doctype": "DocField",
|
||||||
'fieldname': u'default_settings',
|
"width": "50%",
|
||||||
'fieldtype': u'Section Break',
|
"fieldname": "column_break0",
|
||||||
'label': u'Default Settings',
|
"fieldtype": "Column Break",
|
||||||
'oldfieldtype': u'Section Break',
|
"permlevel": 0
|
||||||
'permlevel': 0
|
},
|
||||||
},
|
{
|
||||||
|
"oldfieldtype": "Int",
|
||||||
# DocField
|
"doctype": "DocField",
|
||||||
{
|
"label": "Credit Days",
|
||||||
'doctype': u'DocField',
|
"oldfieldname": "credit_days",
|
||||||
'fieldname': u'default_currency',
|
"fieldname": "credit_days",
|
||||||
'fieldtype': u'Select',
|
"fieldtype": "Int",
|
||||||
'label': u'Default Currency',
|
"depends_on": "eval:!doc.__islocal",
|
||||||
'options': u'link:Currency',
|
"permlevel": 0
|
||||||
'permlevel': 0,
|
},
|
||||||
'reqd': 1
|
{
|
||||||
},
|
"oldfieldtype": "Currency",
|
||||||
|
"doctype": "DocField",
|
||||||
# DocField
|
"label": "Credit Limit",
|
||||||
{
|
"oldfieldname": "credit_limit",
|
||||||
'depends_on': u'eval:!doc.__islocal',
|
"fieldname": "credit_limit",
|
||||||
'doctype': u'DocField',
|
"fieldtype": "Currency",
|
||||||
'fieldname': u'default_bank_account',
|
"depends_on": "eval:!doc.__islocal",
|
||||||
'fieldtype': u'Link',
|
"permlevel": 0
|
||||||
'label': u'Default Bank Account',
|
},
|
||||||
'no_copy': 1,
|
{
|
||||||
'oldfieldname': u'default_bank_account',
|
"oldfieldtype": "Select",
|
||||||
'oldfieldtype': u'Link',
|
"colour": "White:FFF",
|
||||||
'options': u'Account',
|
"doctype": "DocField",
|
||||||
'permlevel': 0,
|
"label": "If Yearly Budget Exceeded",
|
||||||
'trigger': u'Client'
|
"oldfieldname": "yearly_bgt_flag",
|
||||||
},
|
"options": "\nWarn\nIgnore\nStop",
|
||||||
|
"fieldname": "yearly_bgt_flag",
|
||||||
# DocField
|
"fieldtype": "Select",
|
||||||
{
|
"depends_on": "eval:!doc.__islocal",
|
||||||
'depends_on': u'eval:!doc.__islocal',
|
"permlevel": 0
|
||||||
'doctype': u'DocField',
|
},
|
||||||
'fieldname': u'receivables_group',
|
{
|
||||||
'fieldtype': u'Link',
|
"oldfieldtype": "Select",
|
||||||
'label': u'Receivables Group',
|
"doctype": "DocField",
|
||||||
'no_copy': 1,
|
"label": "If Monthly Budget Exceeded",
|
||||||
'oldfieldname': u'receivables_group',
|
"oldfieldname": "monthly_bgt_flag",
|
||||||
'oldfieldtype': u'Link',
|
"options": "\nWarn\nIgnore\nStop",
|
||||||
'options': u'Account',
|
"fieldname": "monthly_bgt_flag",
|
||||||
'permlevel': 0,
|
"fieldtype": "Select",
|
||||||
'trigger': u'Client'
|
"depends_on": "eval:!doc.__islocal",
|
||||||
},
|
"permlevel": 0
|
||||||
|
},
|
||||||
# DocField
|
{
|
||||||
{
|
"description": "For reference only.",
|
||||||
'depends_on': u'eval:!doc.__islocal',
|
"colour": "White:FFF",
|
||||||
'doctype': u'DocField',
|
"doctype": "DocField",
|
||||||
'fieldname': u'payables_group',
|
"label": "Company Info",
|
||||||
'fieldtype': u'Link',
|
"fieldname": "company_info",
|
||||||
'label': u'Payables Group',
|
"fieldtype": "Section Break",
|
||||||
'no_copy': 1,
|
"permlevel": 0
|
||||||
'oldfieldname': u'payables_group',
|
},
|
||||||
'oldfieldtype': u'Link',
|
{
|
||||||
'options': u'Account',
|
"oldfieldtype": "Small Text",
|
||||||
'permlevel': 0,
|
"doctype": "DocField",
|
||||||
'trigger': u'Client'
|
"label": "Address",
|
||||||
},
|
"oldfieldname": "address",
|
||||||
|
"fieldname": "address",
|
||||||
# DocField
|
"fieldtype": "Small Text",
|
||||||
{
|
"permlevel": 0
|
||||||
'doctype': u'DocField',
|
},
|
||||||
'fieldname': u'column_break0',
|
{
|
||||||
'fieldtype': u'Column Break',
|
"oldfieldtype": "Column Break",
|
||||||
'oldfieldtype': u'Column Break',
|
"doctype": "DocField",
|
||||||
'permlevel': 0,
|
"width": "50%",
|
||||||
'width': u'50%'
|
"fieldname": "column_break1",
|
||||||
},
|
"fieldtype": "Column Break",
|
||||||
|
"permlevel": 0
|
||||||
# DocField
|
},
|
||||||
{
|
{
|
||||||
'depends_on': u'eval:!doc.__islocal',
|
"oldfieldtype": "Data",
|
||||||
'doctype': u'DocField',
|
"doctype": "DocField",
|
||||||
'fieldname': u'credit_days',
|
"label": "Phone No",
|
||||||
'fieldtype': u'Int',
|
"oldfieldname": "phone_no",
|
||||||
'label': u'Credit Days',
|
"options": "Phone",
|
||||||
'oldfieldname': u'credit_days',
|
"fieldname": "phone_no",
|
||||||
'oldfieldtype': u'Int',
|
"fieldtype": "Data",
|
||||||
'permlevel': 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
# DocField
|
"oldfieldtype": "Data",
|
||||||
{
|
"doctype": "DocField",
|
||||||
'depends_on': u'eval:!doc.__islocal',
|
"label": "Fax",
|
||||||
'doctype': u'DocField',
|
"oldfieldname": "fax",
|
||||||
'fieldname': u'credit_limit',
|
"options": "Phone",
|
||||||
'fieldtype': u'Currency',
|
"fieldname": "fax",
|
||||||
'label': u'Credit Limit',
|
"fieldtype": "Data",
|
||||||
'oldfieldname': u'credit_limit',
|
"permlevel": 0
|
||||||
'oldfieldtype': u'Currency',
|
},
|
||||||
'permlevel': 0
|
{
|
||||||
},
|
"oldfieldtype": "Data",
|
||||||
|
"doctype": "DocField",
|
||||||
# DocField
|
"label": "Email",
|
||||||
{
|
"oldfieldname": "email",
|
||||||
'colour': u'White:FFF',
|
"options": "Email",
|
||||||
'depends_on': u'eval:!doc.__islocal',
|
"fieldname": "email",
|
||||||
'doctype': u'DocField',
|
"fieldtype": "Data",
|
||||||
'fieldname': u'yearly_bgt_flag',
|
"permlevel": 0
|
||||||
'fieldtype': u'Select',
|
},
|
||||||
'label': u'If Yearly Budget Exceeded',
|
{
|
||||||
'oldfieldname': u'yearly_bgt_flag',
|
"oldfieldtype": "Data",
|
||||||
'oldfieldtype': u'Select',
|
"doctype": "DocField",
|
||||||
'options': u'\nWarn\nIgnore\nStop',
|
"label": "Website",
|
||||||
'permlevel': 0
|
"oldfieldname": "website",
|
||||||
},
|
"fieldname": "website",
|
||||||
|
"fieldtype": "Data",
|
||||||
# DocField
|
"permlevel": 0
|
||||||
{
|
},
|
||||||
'depends_on': u'eval:!doc.__islocal',
|
{
|
||||||
'doctype': u'DocField',
|
"description": "Company registration numbers for your reference. Example: VAT Registration Numbers etc.",
|
||||||
'fieldname': u'monthly_bgt_flag',
|
"oldfieldtype": "Section Break",
|
||||||
'fieldtype': u'Select',
|
"colour": "White:FFF",
|
||||||
'label': u'If Monthly Budget Exceeded',
|
"doctype": "DocField",
|
||||||
'oldfieldname': u'monthly_bgt_flag',
|
"label": "Registration Info",
|
||||||
'oldfieldtype': u'Select',
|
"width": "50%",
|
||||||
'options': u'\nWarn\nIgnore\nStop',
|
"fieldname": "registration_info",
|
||||||
'permlevel': 0
|
"fieldtype": "Section Break",
|
||||||
},
|
"permlevel": 0
|
||||||
|
},
|
||||||
# DocField
|
{
|
||||||
{
|
"description": "Company registration numbers for your reference. Tax numbers etc.",
|
||||||
'colour': u'White:FFF',
|
"oldfieldtype": "Code",
|
||||||
'description': u'For reference only.',
|
"colour": "White:FFF",
|
||||||
'doctype': u'DocField',
|
"doctype": "DocField",
|
||||||
'fieldname': u'company_info',
|
"label": "Registration Details",
|
||||||
'fieldtype': u'Section Break',
|
"oldfieldname": "registration_details",
|
||||||
'label': u'Company Info',
|
"fieldname": "registration_details",
|
||||||
'permlevel': 0
|
"fieldtype": "Code",
|
||||||
},
|
"permlevel": 0
|
||||||
|
},
|
||||||
# DocField
|
{
|
||||||
{
|
"no_copy": 1,
|
||||||
'doctype': u'DocField',
|
"oldfieldtype": "Small Text",
|
||||||
'fieldname': u'address',
|
"doctype": "DocField",
|
||||||
'fieldtype': u'Small Text',
|
"label": "Trash Reason",
|
||||||
'label': u'Address',
|
"oldfieldname": "trash_reason",
|
||||||
'oldfieldname': u'address',
|
"fieldname": "trash_reason",
|
||||||
'oldfieldtype': u'Small Text',
|
"fieldtype": "Small Text",
|
||||||
'permlevel': 0
|
"permlevel": 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
# DocField
|
"amend": 0,
|
||||||
{
|
"create": 1,
|
||||||
'doctype': u'DocField',
|
"doctype": "DocPerm",
|
||||||
'fieldname': u'column_break1',
|
"submit": 0,
|
||||||
'fieldtype': u'Column Break',
|
"write": 1,
|
||||||
'oldfieldtype': u'Column Break',
|
"role": "System Manager",
|
||||||
'permlevel': 0,
|
"cancel": 1,
|
||||||
'width': u'50%'
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
# DocField
|
"amend": 0,
|
||||||
{
|
"create": 1,
|
||||||
'doctype': u'DocField',
|
"doctype": "DocPerm",
|
||||||
'fieldname': u'phone_no',
|
"submit": 0,
|
||||||
'fieldtype': u'Data',
|
"write": 1,
|
||||||
'label': u'Phone No',
|
"role": "System Manager",
|
||||||
'oldfieldname': u'phone_no',
|
"cancel": 1,
|
||||||
'oldfieldtype': u'Data',
|
"permlevel": 0
|
||||||
'options': u'Phone',
|
},
|
||||||
'permlevel': 0
|
{
|
||||||
},
|
"doctype": "DocPerm",
|
||||||
|
"role": "All",
|
||||||
# DocField
|
"cancel": 0,
|
||||||
{
|
"permlevel": 1
|
||||||
'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
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
@ -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>
|
<span class="help">Un-trash items</span>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<b><a href="#!Form/Rename Tool/Rename Tool">Rename Master</a></b><br>
|
<b>Rename Master</b><br>
|
||||||
<span class="help">Rename a single master record</span>
|
<span class="help">Click on "Rename" on the sidebar of an item for renaming.</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="setup-column">
|
<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) {
|
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||||
if(cint(wn.boot.notification_settings.delivery_note)) {
|
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_purchase_item' :'Is Purchase Item',
|
||||||
'is_pro_applicable' :'Is Pro Applicable'}
|
'is_pro_applicable' :'Is Pro Applicable'}
|
||||||
for d in fl:
|
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_for_active_boms(check = fl[d])
|
||||||
self.check_ref_rate_detail()
|
self.check_ref_rate_detail()
|
||||||
self.fill_customer_code()
|
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) {
|
cur_frm.cscript.onload_post_render = function(doc, dt, dn) {
|
||||||
var callback = 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
|
// 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);
|
cur_frm.cscript.dynamic_label(doc, dt, dn, callback);
|
||||||
}
|
}
|
||||||
@ -118,13 +113,6 @@ cur_frm.cscript.new_contact = function(){
|
|||||||
loaddoc('Contact', tn);
|
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 *****************
|
// ***************** Get project name *****************
|
||||||
cur_frm.fields_dict['purchase_receipt_details'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) {
|
cur_frm.fields_dict['purchase_receipt_details'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) {
|
||||||
return 'SELECT `tabProject`.name FROM `tabProject` \
|
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) {
|
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||||
if(cint(wn.boot.notification_settings.purchase_receipt)) {
|
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):
|
def autoname(self):
|
||||||
self.doc.name = make_autoname(self.doc.naming_series+'.#####')
|
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):
|
def validate_fiscal_year(self):
|
||||||
get_obj(dt = 'Purchase Common').validate_fiscal_year(self.doc.fiscal_year,self.doc.posting_date,'Transaction Date')
|
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 = ''):
|
def get_item_details(self, arg = ''):
|
||||||
if arg:
|
if arg:
|
||||||
return get_obj(dt='Purchase Common').get_item_details(self,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
|
"owner": "Administrator",
|
||||||
{
|
"docstatus": 0,
|
||||||
u'creation': '2012-10-10 12:07:10',
|
"creation": "2012-10-26 14:47:52",
|
||||||
u'docstatus': 0,
|
"modified_by": "Administrator",
|
||||||
u'modified': '2012-10-25 15:03:49',
|
"modified": "2012-12-03 11:24:31"
|
||||||
u'modified_by': u'Administrator',
|
},
|
||||||
u'owner': u'Administrator'
|
{
|
||||||
},
|
"autoname": "field:warehouse_name",
|
||||||
|
"description": "A logical Warehouse against which stock entries are made.",
|
||||||
# These values are common for all DocType
|
"default_print_format": "Standard",
|
||||||
{
|
"allow_rename": 1,
|
||||||
'_last_update': u'1319016431',
|
"search_fields": "warehouse_type",
|
||||||
'allow_trash': 1,
|
"module": "Stock",
|
||||||
'autoname': u'field:warehouse_name',
|
"doctype": "DocType",
|
||||||
'colour': u'White:FFF',
|
"document_type": "Master",
|
||||||
'default_print_format': u'Standard',
|
"name": "__common__"
|
||||||
'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',
|
"name": "__common__",
|
||||||
'module': u'Stock',
|
"parent": "Warehouse",
|
||||||
u'name': u'__common__',
|
"doctype": "DocField",
|
||||||
'search_fields': u'warehouse_type',
|
"parenttype": "DocType",
|
||||||
'section_style': u'Tabbed',
|
"parentfield": "fields"
|
||||||
'server_code_error': u' ',
|
},
|
||||||
'show_in_menu': 0,
|
{
|
||||||
'version': 1
|
"name": "__common__",
|
||||||
},
|
"parent": "Warehouse",
|
||||||
|
"read": 1,
|
||||||
# These values are common for all DocField
|
"doctype": "DocPerm",
|
||||||
{
|
"parenttype": "DocType",
|
||||||
u'doctype': u'DocField',
|
"parentfield": "permissions"
|
||||||
u'name': u'__common__',
|
},
|
||||||
'parent': u'Warehouse',
|
{
|
||||||
'parentfield': u'fields',
|
"name": "Warehouse",
|
||||||
'parenttype': u'DocType'
|
"doctype": "DocType"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
# These values are common for all DocPerm
|
"oldfieldtype": "Section Break",
|
||||||
{
|
"doctype": "DocField",
|
||||||
u'doctype': u'DocPerm',
|
"label": "Warehouse Detail",
|
||||||
u'name': u'__common__',
|
"fieldname": "warehouse_detail",
|
||||||
'parent': u'Warehouse',
|
"fieldtype": "Section Break",
|
||||||
'parentfield': u'permissions',
|
"permlevel": 0
|
||||||
'parenttype': u'DocType',
|
},
|
||||||
'read': 1
|
{
|
||||||
},
|
"oldfieldtype": "Data",
|
||||||
|
"doctype": "DocField",
|
||||||
# DocType, Warehouse
|
"label": "Warehouse Name",
|
||||||
{
|
"oldfieldname": "warehouse_name",
|
||||||
u'doctype': u'DocType',
|
"fieldname": "warehouse_name",
|
||||||
u'name': u'Warehouse'
|
"fieldtype": "Data",
|
||||||
},
|
"reqd": 1,
|
||||||
|
"permlevel": 0
|
||||||
# DocField
|
},
|
||||||
{
|
{
|
||||||
u'doctype': u'DocField',
|
"oldfieldtype": "Link",
|
||||||
'fieldname': u'warehouse_detail',
|
"colour": "White:FFF",
|
||||||
'fieldtype': u'Section Break',
|
"doctype": "DocField",
|
||||||
'label': u'Warehouse Detail',
|
"label": "Warehouse Type",
|
||||||
'oldfieldtype': u'Section Break',
|
"oldfieldname": "warehouse_type",
|
||||||
'permlevel': 0
|
"options": "Warehouse Type",
|
||||||
},
|
"fieldname": "warehouse_type",
|
||||||
|
"fieldtype": "Link",
|
||||||
# DocField
|
"reqd": 1,
|
||||||
{
|
"permlevel": 0
|
||||||
u'doctype': u'DocField',
|
},
|
||||||
'fieldname': u'warehouse_name',
|
{
|
||||||
'fieldtype': u'Data',
|
"oldfieldtype": "Link",
|
||||||
'label': u'Warehouse Name',
|
"colour": "White:FFF",
|
||||||
'oldfieldname': u'warehouse_name',
|
"doctype": "DocField",
|
||||||
'oldfieldtype': u'Data',
|
"label": "Company",
|
||||||
'permlevel': 0,
|
"oldfieldname": "company",
|
||||||
'reqd': 1
|
"options": "Company",
|
||||||
},
|
"fieldname": "company",
|
||||||
|
"fieldtype": "Link",
|
||||||
# DocField
|
"search_index": 1,
|
||||||
{
|
"permlevel": 0,
|
||||||
'colour': u'White:FFF',
|
"in_filter": 1
|
||||||
u'doctype': u'DocField',
|
},
|
||||||
'fieldname': u'warehouse_type',
|
{
|
||||||
'fieldtype': u'Link',
|
"description": "For Reference Only.",
|
||||||
'label': u'Warehouse Type',
|
"colour": "White:FFF",
|
||||||
'oldfieldname': u'warehouse_type',
|
"doctype": "DocField",
|
||||||
'oldfieldtype': u'Link',
|
"label": "Warehouse Contact Info",
|
||||||
'options': u'Warehouse Type',
|
"fieldname": "warehouse_contact_info",
|
||||||
'permlevel': 0,
|
"fieldtype": "Section Break",
|
||||||
'reqd': 1
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
# DocField
|
"print_hide": 0,
|
||||||
{
|
"oldfieldtype": "Data",
|
||||||
'colour': u'White:FFF',
|
"doctype": "DocField",
|
||||||
u'doctype': u'DocField',
|
"label": "Email Id",
|
||||||
'fieldname': u'company',
|
"oldfieldname": "email_id",
|
||||||
'fieldtype': u'Link',
|
"fieldname": "email_id",
|
||||||
'in_filter': 1,
|
"fieldtype": "Data",
|
||||||
'label': u'Company',
|
"hidden": 1,
|
||||||
'oldfieldname': u'company',
|
"permlevel": 0
|
||||||
'oldfieldtype': u'Link',
|
},
|
||||||
'options': u'Company',
|
{
|
||||||
'permlevel': 0,
|
"oldfieldtype": "Int",
|
||||||
'search_index': 1
|
"doctype": "DocField",
|
||||||
},
|
"label": "Phone No",
|
||||||
|
"oldfieldname": "phone_no",
|
||||||
# DocField
|
"options": "Phone",
|
||||||
{
|
"fieldname": "phone_no",
|
||||||
'colour': u'White:FFF',
|
"fieldtype": "Data",
|
||||||
'description': u'For Reference Only.',
|
"permlevel": 0
|
||||||
u'doctype': u'DocField',
|
},
|
||||||
'fieldname': u'warehouse_contact_info',
|
{
|
||||||
'fieldtype': u'Section Break',
|
"oldfieldtype": "Int",
|
||||||
'label': u'Warehouse Contact Info',
|
"doctype": "DocField",
|
||||||
'permlevel': 0
|
"label": "Mobile No",
|
||||||
},
|
"oldfieldname": "mobile_no",
|
||||||
|
"options": "Phone",
|
||||||
# DocField
|
"fieldname": "mobile_no",
|
||||||
{
|
"fieldtype": "Data",
|
||||||
u'doctype': u'DocField',
|
"permlevel": 0
|
||||||
'fieldname': u'email_id',
|
},
|
||||||
'fieldtype': u'Data',
|
{
|
||||||
'hidden': 1,
|
"oldfieldtype": "Column Break",
|
||||||
'label': u'Email Id',
|
"doctype": "DocField",
|
||||||
'oldfieldname': u'email_id',
|
"fieldname": "column_break0",
|
||||||
'oldfieldtype': u'Data',
|
"fieldtype": "Column Break",
|
||||||
'permlevel': 0,
|
"permlevel": 0
|
||||||
'print_hide': 0
|
},
|
||||||
},
|
{
|
||||||
|
"oldfieldtype": "Data",
|
||||||
# DocField
|
"doctype": "DocField",
|
||||||
{
|
"label": "Address Line 1",
|
||||||
u'doctype': u'DocField',
|
"oldfieldname": "address_line_1",
|
||||||
'fieldname': u'phone_no',
|
"fieldname": "address_line_1",
|
||||||
'fieldtype': u'Data',
|
"fieldtype": "Data",
|
||||||
'label': u'Phone No',
|
"permlevel": 0
|
||||||
'oldfieldname': u'phone_no',
|
},
|
||||||
'oldfieldtype': u'Int',
|
{
|
||||||
'options': u'Phone',
|
"oldfieldtype": "Data",
|
||||||
'permlevel': 0
|
"doctype": "DocField",
|
||||||
},
|
"label": "Address Line 2",
|
||||||
|
"oldfieldname": "address_line_2",
|
||||||
# DocField
|
"fieldname": "address_line_2",
|
||||||
{
|
"fieldtype": "Data",
|
||||||
u'doctype': u'DocField',
|
"permlevel": 0
|
||||||
'fieldname': u'mobile_no',
|
},
|
||||||
'fieldtype': u'Data',
|
{
|
||||||
'label': u'Mobile No',
|
"oldfieldtype": "Data",
|
||||||
'oldfieldname': u'mobile_no',
|
"doctype": "DocField",
|
||||||
'oldfieldtype': u'Int',
|
"label": "City",
|
||||||
'options': u'Phone',
|
"oldfieldname": "city",
|
||||||
'permlevel': 0
|
"fieldname": "city",
|
||||||
},
|
"fieldtype": "Data",
|
||||||
|
"reqd": 0,
|
||||||
# DocField
|
"permlevel": 0
|
||||||
{
|
},
|
||||||
u'doctype': u'DocField',
|
{
|
||||||
'fieldname': u'column_break0',
|
"oldfieldtype": "Select",
|
||||||
'fieldtype': u'Column Break',
|
"colour": "White:FFF",
|
||||||
'oldfieldtype': u'Column Break',
|
"doctype": "DocField",
|
||||||
'permlevel': 0
|
"label": "State",
|
||||||
},
|
"oldfieldname": "state",
|
||||||
|
"options": "Suggest",
|
||||||
# DocField
|
"fieldname": "state",
|
||||||
{
|
"fieldtype": "Data",
|
||||||
u'doctype': u'DocField',
|
"permlevel": 0
|
||||||
'fieldname': u'address_line_1',
|
},
|
||||||
'fieldtype': u'Data',
|
{
|
||||||
'label': u'Address Line 1',
|
"oldfieldtype": "Int",
|
||||||
'oldfieldname': u'address_line_1',
|
"doctype": "DocField",
|
||||||
'oldfieldtype': u'Data',
|
"label": "PIN",
|
||||||
'permlevel': 0
|
"oldfieldname": "pin",
|
||||||
},
|
"fieldname": "pin",
|
||||||
|
"fieldtype": "Int",
|
||||||
# DocField
|
"permlevel": 0
|
||||||
{
|
},
|
||||||
u'doctype': u'DocField',
|
{
|
||||||
'fieldname': u'address_line_2',
|
"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.",
|
||||||
'fieldtype': u'Data',
|
"colour": "White:FFF",
|
||||||
'label': u'Address Line 2',
|
"doctype": "DocField",
|
||||||
'oldfieldname': u'address_line_2',
|
"label": "Merge Warehouses",
|
||||||
'oldfieldtype': u'Data',
|
"fieldname": "merge_warehouses_section",
|
||||||
'permlevel': 0
|
"fieldtype": "Section Break",
|
||||||
},
|
"permlevel": 2
|
||||||
|
},
|
||||||
# DocField
|
{
|
||||||
{
|
"doctype": "DocField",
|
||||||
u'doctype': u'DocField',
|
"label": "Merge With",
|
||||||
'fieldname': u'city',
|
"options": "Warehouse",
|
||||||
'fieldtype': u'Data',
|
"fieldname": "merge_with",
|
||||||
'label': u'City',
|
"fieldtype": "Link",
|
||||||
'oldfieldname': u'city',
|
"permlevel": 2
|
||||||
'oldfieldtype': u'Data',
|
},
|
||||||
'permlevel': 0,
|
{
|
||||||
'reqd': 0
|
"doctype": "DocField",
|
||||||
},
|
"label": "Merge",
|
||||||
|
"fieldname": "merge",
|
||||||
# DocField
|
"fieldtype": "Button",
|
||||||
{
|
"permlevel": 2
|
||||||
'colour': u'White:FFF',
|
},
|
||||||
u'doctype': u'DocField',
|
{
|
||||||
'fieldname': u'state',
|
"amend": 0,
|
||||||
'fieldtype': u'Data',
|
"create": 0,
|
||||||
'label': u'State',
|
"doctype": "DocPerm",
|
||||||
'oldfieldname': u'state',
|
"submit": 0,
|
||||||
'oldfieldtype': u'Select',
|
"write": 0,
|
||||||
'options': u'Suggest',
|
"cancel": 0,
|
||||||
'permlevel': 0
|
"role": "Material User",
|
||||||
},
|
"permlevel": 2
|
||||||
|
},
|
||||||
# DocField
|
{
|
||||||
{
|
"amend": 0,
|
||||||
u'doctype': u'DocField',
|
"create": 0,
|
||||||
'fieldname': u'pin',
|
"doctype": "DocPerm",
|
||||||
'fieldtype': u'Int',
|
"submit": 0,
|
||||||
'label': u'PIN',
|
"write": 0,
|
||||||
'oldfieldname': u'pin',
|
"cancel": 0,
|
||||||
'oldfieldtype': u'Int',
|
"role": "Material User",
|
||||||
'permlevel': 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
# DocField
|
"amend": 0,
|
||||||
{
|
"create": 0,
|
||||||
'colour': u'White:FFF',
|
"doctype": "DocPerm",
|
||||||
'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.',
|
"submit": 0,
|
||||||
u'doctype': u'DocField',
|
"write": 0,
|
||||||
'fieldname': u'merge_warehouses_section',
|
"cancel": 0,
|
||||||
'fieldtype': u'Section Break',
|
"role": "Material User",
|
||||||
'label': u'Merge Warehouses',
|
"permlevel": 1
|
||||||
'permlevel': 2
|
},
|
||||||
},
|
{
|
||||||
|
"amend": 0,
|
||||||
# DocField
|
"create": 0,
|
||||||
{
|
"doctype": "DocPerm",
|
||||||
u'doctype': u'DocField',
|
"submit": 0,
|
||||||
'fieldname': u'merge_with',
|
"write": 0,
|
||||||
'fieldtype': u'Link',
|
"cancel": 0,
|
||||||
'label': u'Merge With',
|
"role": "Material Manager",
|
||||||
'options': u'Warehouse',
|
"permlevel": 2
|
||||||
'permlevel': 2
|
},
|
||||||
},
|
{
|
||||||
|
"amend": 0,
|
||||||
# DocField
|
"create": 0,
|
||||||
{
|
"doctype": "DocPerm",
|
||||||
u'doctype': u'DocField',
|
"submit": 0,
|
||||||
'fieldname': u'merge',
|
"write": 0,
|
||||||
'fieldtype': u'Button',
|
"cancel": 0,
|
||||||
'label': u'Merge',
|
"role": "Material Manager",
|
||||||
'permlevel': 2
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
# DocPerm
|
"amend": 0,
|
||||||
{
|
"create": 0,
|
||||||
'amend': 0,
|
"doctype": "DocPerm",
|
||||||
'cancel': 1,
|
"submit": 0,
|
||||||
'create': 1,
|
"write": 0,
|
||||||
u'doctype': u'DocPerm',
|
"cancel": 0,
|
||||||
'permlevel': 0,
|
"role": "Material Manager",
|
||||||
'role': u'Material Master Manager',
|
"permlevel": 1
|
||||||
'submit': 0,
|
},
|
||||||
'write': 1
|
{
|
||||||
},
|
"doctype": "DocPerm",
|
||||||
|
"role": "All",
|
||||||
# DocPerm
|
"permlevel": 1
|
||||||
{
|
},
|
||||||
'cancel': 1,
|
{
|
||||||
'create': 1,
|
"amend": 0,
|
||||||
u'doctype': u'DocPerm',
|
"create": 1,
|
||||||
'permlevel': 0,
|
"doctype": "DocPerm",
|
||||||
'role': u'System Manager',
|
"submit": 0,
|
||||||
'write': 1
|
"write": 1,
|
||||||
},
|
"cancel": 1,
|
||||||
|
"role": "Material Master Manager",
|
||||||
# DocPerm
|
"permlevel": 0
|
||||||
{
|
},
|
||||||
'amend': 0,
|
{
|
||||||
'cancel': 0,
|
"doctype": "DocPerm",
|
||||||
'create': 0,
|
"role": "Material Master Manager",
|
||||||
u'doctype': u'DocPerm',
|
"permlevel": 1
|
||||||
'permlevel': 0,
|
},
|
||||||
'role': u'Material Manager',
|
{
|
||||||
'submit': 0,
|
"create": 1,
|
||||||
'write': 0
|
"doctype": "DocPerm",
|
||||||
},
|
"write": 1,
|
||||||
|
"role": "System Manager",
|
||||||
# DocPerm
|
"cancel": 1,
|
||||||
{
|
"permlevel": 0
|
||||||
'amend': 0,
|
},
|
||||||
'cancel': 0,
|
{
|
||||||
'create': 0,
|
"create": 0,
|
||||||
u'doctype': u'DocPerm',
|
"doctype": "DocPerm",
|
||||||
'permlevel': 0,
|
"write": 1,
|
||||||
'role': u'Material User',
|
"role": "System Manager",
|
||||||
'submit': 0,
|
"permlevel": 2
|
||||||
'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
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
@ -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['limit_page_length'] = int(webnotes.form_dict['limit_page_length'])
|
||||||
webnotes.form_dict['user'] = webnotes.session['user']
|
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']:
|
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 messages
|
||||||
return webnotes.conn.sql("""select * from `tabComment`
|
return webnotes.conn.sql("""select * from `tabComment`
|
||||||
where (owner=%(contact)s
|
where (owner=%(contact)s
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user