Merge branch 'master' into production

Conflicts:
	patches/patch_list.py
	production/doctype/bom_explosion_item/bom_explosion_item.txt
This commit is contained in:
Anand Doshi 2012-12-11 14:59:19 +05:30
commit c551964d5d
96 changed files with 52 additions and 132 deletions

View File

@ -34,22 +34,21 @@ class DocType:
company_abbr = sql("select abbr from tabCompany where name=%s", self.doc.company)[0][0]
self.doc.name = self.doc.account_name.strip() + ' - ' + company_abbr
# Get customer/supplier address
def get_address(self):
add=sql("Select address from `tab%s` where name='%s'"%(self.doc.master_type,self.doc.master_name))
ret={'address':add[0][0]}
return ret
# check whether master name entered for supplier/customer
add=sql("Select address from `tab%s` where name='%s'" %
(self.doc.master_type, self.doc.master_name))
return {'address': add[0][0]}
def validate_master_name(self):
if (self.doc.master_type == 'Customer' or self.doc.master_type == 'Supplier') and not self.doc.master_name:
if (self.doc.master_type == 'Customer' or self.doc.master_type == 'Supplier') \
and not self.doc.master_name:
msgprint("Message: Please enter Master Name once the account is created.")
# Fetch Parent Details and validation for account not to be created under ledger
def validate_parent(self):
"""Fetch Parent Details and validation for account not to be created under ledger"""
if self.doc.parent_account:
par = sql("select name, group_or_ledger, is_pl_account, debit_or_credit from tabAccount where name =%s",self.doc.parent_account)
par = sql("""select name, group_or_ledger, is_pl_account, debit_or_credit
from tabAccount where name =%s""",self.doc.parent_account)
if not par:
msgprint("Parent account does not exists", raise_exception=1)
elif par and par[0][0] == self.doc.name:
@ -57,7 +56,8 @@ class DocType:
elif par and par[0][1] != 'Group':
msgprint("Parent account can not be a ledger", raise_exception=1)
elif par and self.doc.debit_or_credit and par[0][3] != self.doc.debit_or_credit:
msgprint("You can not move a %s account under %s account" % (self.doc.debit_or_credit, par[0][3]), raise_exception=1)
msgprint("You can not move a %s account under %s account" %
(self.doc.debit_or_credit, par[0][3]), raise_exception=1)
elif par and not self.doc.is_pl_account:
self.doc.is_pl_account = par[0][2]
self.doc.debit_or_credit = par[0][3]
@ -69,9 +69,10 @@ class DocType:
webnotes.msgprint("One company cannot have more than 4 root Accounts",
raise_exception=1)
# Account name must be unique
def validate_duplicate_account(self):
if (self.doc.fields.get('__islocal') or (not self.doc.name)) and sql("select name from tabAccount where account_name=%s and company=%s", (self.doc.account_name, self.doc.company)):
if (self.doc.fields.get('__islocal') or not self.doc.name) and \
sql("""select name from tabAccount where account_name=%s and company=%s""",
(self.doc.account_name, self.doc.company)):
msgprint("Account Name: %s already exists, please rename"
% self.doc.account_name, raise_exception=1)
@ -83,9 +84,11 @@ class DocType:
def convert_group_to_ledger(self):
if self.check_if_child_exists():
msgprint("Account: %s has existing child. You can not convert this account to ledger" % (self.doc.name), raise_exception=1)
msgprint("Account: %s has existing child. You can not convert this account to ledger" %
(self.doc.name), raise_exception=1)
elif self.check_gle_exists():
msgprint("Account with existing transaction can not be converted to ledger.", raise_exception=1)
msgprint("Account with existing transaction can not be converted to ledger.",
raise_exception=1)
else:
self.doc.group_or_ledger = 'Ledger'
self.doc.save()
@ -105,11 +108,13 @@ class DocType:
# Check if any previous balance exists
def check_gle_exists(self):
exists = sql("select name from `tabGL Entry` where account = '%s' and ifnull(is_cancelled, 'No') = 'No'" % (self.doc.name))
exists = sql("""select name from `tabGL Entry` where account = '%s'
and ifnull(is_cancelled, 'No') = 'No'""" % (self.doc.name))
return exists and exists[0][0] or ''
def check_if_child_exists(self):
return sql("select name from `tabAccount` where parent_account = %s and docstatus != 2", self.doc.name)
return sql("""select name from `tabAccount` where parent_account = %s
and docstatus != 2""", self.doc.name)
def validate_mandatory(self):
if not self.doc.debit_or_credit:
@ -124,61 +129,63 @@ class DocType:
self.validate_root_details()
self.validate_mandatory()
# Defaults
if not self.doc.parent_account:
self.doc.parent_account = ''
# Update Node Set Model
def update_nsm_model(self):
import webnotes
import webnotes.utils.nestedset
webnotes.utils.nestedset.update_nsm(self)
def on_update(self):
# update nsm
self.validate_max_root_accounts()
self.update_nsm_model()
# Check user role for approval process
def get_authorized_user(self):
# Check logged-in user is authorized
if webnotes.conn.get_value('Global Defaults', None, 'credit_controller') in webnotes.user.get_roles():
if webnotes.conn.get_value('Global Defaults', None, 'credit_controller') \
in webnotes.user.get_roles():
return 1
# Check Credit limit for customer
def check_credit_limit(self, account, company, tot_outstanding):
# Get credit limit
credit_limit_from = 'Customer'
cr_limit = sql("select t1.credit_limit from tabCustomer t1, `tabAccount` t2 where t2.name='%s' and t1.name = t2.master_name" % account)
cr_limit = sql("""select t1.credit_limit from tabCustomer t1, `tabAccount` t2
where t2.name='%s' and t1.name = t2.master_name""" % account)
credit_limit = cr_limit and flt(cr_limit[0][0]) or 0
if not credit_limit:
credit_limit = webnotes.conn.get_value('Company', company, 'credit_limit')
credit_limit_from = 'global settings in the Company'
# If outstanding greater than credit limit and not authorized person raise exception
if credit_limit > 0 and flt(tot_outstanding) > credit_limit and not self.get_authorized_user():
msgprint("Total Outstanding amount (%s) for <b>%s</b> can not be greater than credit limit (%s). To change your credit limit settings, please update the <b>%s</b>" \
% (fmt_money(tot_outstanding), account, fmt_money(credit_limit), credit_limit_from), raise_exception=1)
if credit_limit > 0 and flt(tot_outstanding) > credit_limit \
and not self.get_authorized_user():
msgprint("""Total Outstanding amount (%s) for <b>%s</b> can not be \
greater than credit limit (%s). To change your credit limit settings, \
please update the <b>%s</b>""" % (fmt_money(tot_outstanding),
account, fmt_money(credit_limit), credit_limit_from), raise_exception=1)
def validate_trash(self):
"""checks gl entries and if child exists"""
if not self.doc.parent_account:
msgprint("Root account can not be deleted", raise_exception=1)
if self.check_gle_exists():
msgprint("Account with existing transaction (Sales Invoice / Purchase Invoice / Journal Voucher) can not be trashed", raise_exception=1)
msgprint("""Account with existing transaction (Sales Invoice / Purchase Invoice / \
Journal Voucher) can not be trashed""", raise_exception=1)
if self.check_if_child_exists():
msgprint("Child account exists for this account. You can not trash this account.", raise_exception=1)
msgprint("Child account exists for this account. You can not trash this account.",
raise_exception=1)
# On Trash
def on_trash(self):
self.validate_trash()
# rebuild tree
self.update_nsm_model()
# delete all cancelled gl entry of this account
sql("delete from `tabGL Entry` where account = %s and ifnull(is_cancelled, 'No') = 'Yes'", self.doc.name)
sql("""delete from `tabGL Entry` where account = %s and
ifnull(is_cancelled, 'No') = 'Yes'""", self.doc.name)
# on rename
def on_rename(self, new, old):
company_abbr = webnotes.conn.get_value("Company", self.doc.company, "abbr")
parts = new.split(" - ")
@ -191,4 +198,4 @@ class DocType:
sql("update `tabAccount` set account_name = '%s' where name = '%s'" % \
(account_name, old))
return " - ".join(parts)
return " - ".join(parts)

View File

@ -13,7 +13,6 @@
"document_type": "Master",
"description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.",
"name": "__common__",
"default_print_format": "Standard",
"allow_rename": 1,
"doctype": "DocType",
"allow_copy": 1

View File

@ -13,7 +13,6 @@
# These values are common for all DocType
{
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': u'Accounts',

View File

@ -14,7 +14,6 @@
"description": "Track separate Income and Expense for product verticals or divisions.",
"autoname": "field:cost_center_name",
"name": "__common__",
"default_print_format": "Standard",
"allow_rename": 1,
"doctype": "DocType",
"allow_copy": 1

View File

@ -16,7 +16,6 @@
'allow_trash': 1,
'autoname': u'field:year',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'description': u'**Fiscal Year** represents a Financial Year. All accounting entries and other major transactions are tracked against **Fiscal Year**.',
'doctype': 'DocType',
'document_type': u'Master',

View File

@ -15,7 +15,6 @@
'_last_update': u'1319016431',
'autoname': u'GL.#######',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'in_create': 1,
'module': u'Accounts',

View File

@ -10,7 +10,6 @@
"is_submittable": 1,
"autoname": "naming_series:",
"name": "__common__",
"default_print_format": "Standard",
"search_fields": "voucher_type,posting_date, due_date, cheque_no",
"module": "Accounts",
"doctype": "DocType",

View File

@ -14,7 +14,6 @@
{
'autoname': u'JVD.######',
'colour': u'White:FFF',
'default_print_format': u'Standard',
u'doctype': u'DocType',
'istable': 1,
'module': u'Accounts',

View File

@ -14,7 +14,6 @@
{
'_last_update': u'1316509358',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'document_type': u'Other',
'issingle': 1,

View File

@ -13,7 +13,6 @@
# These values are common for all DocType
{
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': u'Accounts',

View File

@ -15,7 +15,6 @@
'_last_update': u'1311621379',
'autoname': u'PCE/.###',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'is_submittable': 1,
'module': u'Accounts',

View File

@ -15,7 +15,6 @@
'_last_update': u'1322549700',
'autoname': u'POS/.####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'module': u'Accounts',
'name': '__common__',

View File

@ -10,7 +10,6 @@
"is_submittable": 1,
"autoname": "naming_series:",
"allow_attach": 1,
"default_print_format": "Standard",
"search_fields": "posting_date, credit_to, fiscal_year, bill_no, grand_total, outstanding_amount",
"module": "Accounts",
"doctype": "DocType",

View File

@ -14,7 +14,6 @@
{
'autoname': u'EVD.######',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': u'Accounts',

View File

@ -15,7 +15,6 @@
'_last_update': u'1322549700',
'autoname': u'PVTD.######',
'colour': u'White:FFF',
'default_print_format': u'Standard',
u'doctype': u'DocType',
'hide_heading': 1,
'istable': 1,

View File

@ -16,7 +16,6 @@
'allow_trash': 1,
'autoname': u'field:title',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'description': u'Standard tax template that can be applied to all Purchase Transactions. This template can contain list of tax heads and also other expense heads like "Shipping", "Insurance", "Handling" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on "Previous Row Total" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Consider Tax or Charge for: In this section you can specify if the tax / charge is only for valuation (not a part of total) or only for total (does not add value to the item) or for both.\n10. Add or Deduct: Whether you want to add or deduct the tax.',
'doctype': 'DocType',
'document_type': u'Master',

View File

@ -10,7 +10,6 @@
"is_submittable": 1,
"autoname": "naming_series:",
"allow_attach": 1,
"default_print_format": "Standard",
"search_fields": "posting_date, due_date, debit_to, fiscal_year, grand_total, outstanding_amount",
"module": "Accounts",
"doctype": "DocType",

View File

@ -14,7 +14,6 @@
{
'autoname': u'INVD.######',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': u'Accounts',

View File

@ -14,7 +14,6 @@
{
'autoname': u'INVTD.######',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'hide_heading': 1,
'istable': 1,

View File

@ -16,7 +16,6 @@
'allow_trash': 1,
'autoname': u'field:title',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'description': u'Standard tax template that can be applied to all Sales Transactions. This template can contain list of tax heads and also other expense / income heads like "Shipping", "Insurance", "Handling" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on "Previous Row Total" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Is this Tax included in Basic Rate?: If you check this, it means that this tax will not be shown below the item table, but will be included in the Basic Rate in your main item table. This is useful where you want give a flat price (inclusive of all taxes) price to customers.',
'doctype': 'DocType',
'document_type': u'Master',

View File

@ -9,7 +9,6 @@
{
"is_submittable": 1,
"allow_attach": 1,
"default_print_format": "Standard",
"search_fields": "status, transaction_date, supplier,grand_total",
"module": "Buying",
"doctype": "DocType",

View File

@ -14,7 +14,6 @@
{
'autoname': u'POD/.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': u'Buying',

View File

@ -9,7 +9,6 @@
{
"is_submittable": 1,
"allow_attach": 1,
"default_print_format": "Standard",
"allow_print": 0,
"search_fields": "status,transaction_date,sales_order_no",
"module": "Buying",

View File

@ -14,7 +14,6 @@
{
'autoname': u'IDTD/.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': u'Buying',

View File

@ -15,7 +15,6 @@
'_last_update': u'1317365120',
'autoname': u'QAI/.######',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'is_submittable': 1,
'module': u'Buying',

View File

@ -9,7 +9,6 @@
{
"is_submittable": 1,
"allow_attach": 1,
"default_print_format": "Standard",
"search_fields": "status, transaction_date, supplier,grand_total",
"module": "Buying",
"doctype": "DocType",

View File

@ -13,7 +13,6 @@
# These values are common for all DocType
{
'autoname': u'SQI-.#####',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': u'Buying',

View File

@ -14,7 +14,6 @@
{
'autoname': u'_FEED.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
u'doctype': u'DocType',
'module': u'Home',
u'name': u'__common__',

View File

@ -15,7 +15,6 @@
'_last_update': u'1316075905',
'autoname': u'APRSL.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
u'doctype': u'DocType',
'is_submittable': 1,
'module': u'HR',

View File

@ -14,7 +14,6 @@
{
'autoname': u'APRSLD.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
u'doctype': u'DocType',
'istable': 1,
'module': u'HR',

View File

@ -14,7 +14,6 @@
{
'_last_update': u'1317365120',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'document_type': u'Master',
'is_submittable': 1,

View File

@ -10,7 +10,6 @@
"is_submittable": 1,
"autoname": "EXP.######",
"name": "__common__",
"default_print_format": "Standard",
"search_fields": "approval_status,employee,employee_name",
"module": "HR",
"doctype": "DocType"

View File

@ -13,7 +13,6 @@
# These values are common for all DocType
{
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': u'HR',

View File

@ -15,7 +15,6 @@
'_last_update': u'1317365120',
'autoname': u'LAL/.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
u'doctype': u'DocType',
'is_submittable': 1,
'module': u'HR',

View File

@ -17,7 +17,6 @@
'allow_email': 1,
'allow_print': 1,
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'hide_heading': 0,
'hide_toolbar': 0,

View File

@ -17,7 +17,6 @@
'allow_email': 1,
'allow_print': 1,
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'document_type': u'Other',
'issingle': 1,

View File

@ -19,7 +19,6 @@
"hide_heading": 0,
"issingle": 0,
"name": "__common__",
"default_print_format": "Standard",
"allow_rename": 0,
"doctype": "DocType",
"is_submittable": 1,

View File

@ -13,7 +13,6 @@
# These values are common for all DocType
{
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': u'Manufacturing',

View File

@ -13,7 +13,6 @@
# These values are common for all DocType
{
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': u'Manufacturing',

View File

@ -9,7 +9,6 @@
{
"is_submittable": 1,
"in_create": 0,
"default_print_format": "Standard",
"doctype": "DocType",
"module": "Manufacturing",
"name": "__common__"

View File

@ -10,7 +10,6 @@
"istable": 1,
"autoname": "PPID/.#####",
"name": "__common__",
"default_print_format": "Standard",
"doctype": "DocType",
"module": "Manufacturing"
},

View File

@ -10,7 +10,6 @@
"istable": 1,
"autoname": "PP/.SO/.#####",
"name": "__common__",
"default_print_format": "Standard",
"doctype": "DocType",
"module": "Manufacturing"
},

View File

@ -10,7 +10,6 @@
"read_only": 1,
"issingle": 1,
"in_create": 1,
"default_print_format": "Standard",
"doctype": "DocType",
"module": "Manufacturing",
"name": "__common__"

View File

@ -17,7 +17,6 @@
'allow_trash': 1,
'autoname': u'field:workstation_name',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'document_type': u'Master',
'module': u'Manufacturing',

View File

@ -0,0 +1,4 @@
import webnotes
def execute():
webnotes.conn.sql("""update `tabDocType` set default_print_format=null
where default_print_format='Standard'""")

View File

@ -525,5 +525,8 @@ patch_list = [
{
'patch_module': 'patches.december_2012',
'patch_file': 'production_cleanup',
{
'patch_module': 'patches.december_2012',
'patch_file': 'fix_default_print_format',
},
]

View File

@ -9,7 +9,6 @@
{
"autoname": "field:project_name",
"allow_attach": 1,
"default_print_format": "Standard",
"search_fields": "customer, status, priority, is_active",
"module": "Projects",
"doctype": "DocType",

View File

@ -13,7 +13,6 @@
# These values are common for all DocType
{
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': u'Projects',

View File

@ -17,7 +17,6 @@
'allow_trash': 1,
'autoname': u'TASK.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
u'doctype': u'DocType',
'document_type': u'Master',
'max_attachments': 5,

View File

@ -16,7 +16,6 @@
'allow_trash': 1,
'autoname': u'field:campaign_name',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'description': u'Keep Track of Sales Campaigns. Keep track of Leads, Quotations, Sales Order etc from Campaigns to gauge Return on Investment. ',
'doctype': 'DocType',
'document_type': u'Master',

View File

@ -14,7 +14,6 @@
"document_type": "Master",
"autoname": "naming_series:",
"name": "__common__",
"default_print_format": "Standard",
"allow_rename": 1,
"doctype": "DocType"
},

View File

@ -15,7 +15,6 @@
'_last_update': u'1306480044',
'autoname': u'IN/.####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'is_submittable': 1,
'module': u'Selling',

View File

@ -14,7 +14,6 @@
{
'autoname': u'IID/.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': u'Selling',

View File

@ -9,7 +9,6 @@
{
"autoname": "naming_series:",
"name": "__common__",
"default_print_format": "Standard",
"search_fields": "lead_name,lead_owner,status",
"module": "Selling",
"doctype": "DocType",

View File

@ -10,7 +10,6 @@
"is_submittable": 1,
"autoname": "naming_series:",
"description": "Potential Sales Deal",
"default_print_format": "Standard",
"search_fields": "status,transaction_date,customer,lead,enquiry_type,territory,company",
"module": "Selling",
"doctype": "DocType",

View File

@ -16,7 +16,6 @@
"allow_email": 0,
"autoname": "naming_series:",
"name": "__common__",
"default_print_format": "Standard",
"doctype": "DocType",
"max_attachments": 1,
"hide_toolbar": 0

View File

@ -14,7 +14,6 @@
{
'autoname': u'QUOD/.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'is_transaction_doc': 0,
'istable': 1,

View File

@ -16,7 +16,6 @@
"document_type": "Transaction",
"issingle": 0,
"name": "__common__",
"default_print_format": "Standard",
"doctype": "DocType"
},
{

View File

@ -14,7 +14,6 @@
{
'autoname': u'SOD/.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': u'Selling',

View File

@ -18,7 +18,6 @@
'allow_email': 1,
'allow_print': 1,
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'hide_heading': 0,
'hide_toolbar': 0,

View File

@ -204,11 +204,10 @@ class DocType:
glc.add_cc(str(c))
# On update
# ---------------------------------------------------
def on_update(self):
self.set_letter_head()
ac = sql("select name from tabAccount where account_name='Income' and company=%s", self.doc.name)
ac = sql("select name from tabAccount where company=%s and docstatus<2 limit 1",
self.doc.name)
if not ac:
self.create_default_accounts()
self.set_default_groups()
@ -216,8 +215,7 @@ class DocType:
if not cc:
self.create_default_cost_center()
#
# ---------------------------------------------------
def on_trash(self):
"""
Trash accounts and cost centers for this company if no gl entry exists

View File

@ -14,7 +14,6 @@
"read_only": 1,
"autoname": "field:customer_group_name",
"name": "__common__",
"default_print_format": "Standard",
"allow_rename": 1,
"doctype": "DocType"
},

View File

@ -17,7 +17,6 @@
'allow_email': 1,
'allow_print': 1,
'colour': u'White:FFF',
'default_print_format': u'Standard',
'description': u'Email Settings for Outgoing and Incoming Emails.',
'doctype': 'DocType',
'in_create': 1,

View File

@ -14,7 +14,6 @@
{
'_last_update': u'1323840127',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'issingle': 1,
'module': u'Setup',

View File

@ -17,7 +17,6 @@
'allow_email': 1,
'allow_print': 1,
'colour': u'White:FFF',
'default_print_format': u'Standard',
u'doctype': u'DocType',
'hide_toolbar': 0,
'in_create': 1,

View File

@ -15,7 +15,6 @@
"description": "Item Classification",
"issingle": 0,
"name": "__common__",
"default_print_format": "Standard",
"allow_rename": 1,
"doctype": "DocType"
},

View File

@ -14,7 +14,6 @@
{
'autoname': u'__NSO.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'in_create': 1,
'module': u'Setup',

View File

@ -16,7 +16,6 @@
'allow_trash': 1,
'autoname': u'field:partner_name',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'description': u'A **Sales Partner** is a third party distributor / dealer / commission agent / affiliate / reseller who sells the companies products for a commission. This is useful if you make the end sale to the **Customer**, involving your **Sales Partner**.\n\nIf you sell to your **Sales Partner** who in-turn sells it to the **Customer**, then you must make a **Customer** instead.',
'doctype': 'DocType',
'document_type': u'Master',

View File

@ -16,7 +16,6 @@
'allow_trash': 1,
'autoname': u'field:title',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'description': u'Standard Terms and Conditions that can be added to Sales and Purchases.\n\nExamples:\n\n1. Validity of the offer.\n1. Payment Terms (In Advance, On Credit, part advance etc).\n1. What is extra (or payable by the Customer).\n1. Safety / usage warning.\n1. Warranty if any.\n1. Returns Policy.\n1. Terms of shipping, if applicable.\n1. Ways of addressing disputes, indemnity, liability, etc.\n1. Address and Contact of your Company.',
'doctype': 'DocType',
'document_type': u'Master',

View File

@ -15,7 +15,6 @@
"read_only": 1,
"autoname": "field:territory_name",
"name": "__common__",
"default_print_format": "Standard",
"allow_rename": 1,
"doctype": "DocType",
"name_case": "Title Case"

View File

@ -14,7 +14,6 @@
{
'autoname': u'field:rule_name',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'document_type': u'Master',
'module': u'Setup',

View File

@ -15,7 +15,6 @@
'_last_update': u'1322549701',
'autoname': u'BIN/.#######',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'hide_toolbar': 1,
'in_create': 1,

View File

@ -16,7 +16,6 @@
"allow_attach": 1,
"autoname": "naming_series:",
"name": "__common__",
"default_print_format": "Standard",
"doctype": "DocType"
},
{

View File

@ -15,7 +15,6 @@
'_last_update': u'1311621379',
'autoname': u'DND/.#######',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': u'Stock',

View File

@ -14,7 +14,6 @@
"description": "A Product or a Service that is bought, sold or kept in stock.",
"autoname": "field:item_code",
"name": "__common__",
"default_print_format": "Standard",
"allow_rename": 1,
"doctype": "DocType",
"max_attachments": 1

View File

@ -14,7 +14,6 @@
{
'autoname': u'RFD/.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'in_create': 1,
'istable': 1,

View File

@ -13,7 +13,6 @@
# These values are common for all DocType
{
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': u'Stock',

View File

@ -13,7 +13,6 @@
# These values are common for all DocType
{
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': u'Stock',

View File

@ -14,7 +14,6 @@
{
'_last_update': u'1321441191',
'colour': u'White:FFF',
'default_print_format': u'Standard',
u'doctype': u'DocType',
'issingle': 1,
'module': u'Stock',

View File

@ -9,7 +9,6 @@
{
"is_submittable": 1,
"allow_attach": 1,
"default_print_format": "Standard",
"search_fields": "status, posting_date, supplier",
"module": "Stock",
"doctype": "DocType",

View File

@ -10,7 +10,6 @@
"istable": 1,
"autoname": "GRND/.#######",
"name": "__common__",
"default_print_format": "Standard",
"doctype": "DocType",
"module": "Stock"
},

View File

@ -14,7 +14,6 @@
"description": "Distinct unit of an Item",
"autoname": "field:serial_no",
"name": "__common__",
"default_print_format": "Standard",
"allow_rename": 1,
"doctype": "DocType"
},

View File

@ -21,7 +21,6 @@
"hide_heading": 0,
"issingle": 0,
"name": "__common__",
"default_print_format": "Standard",
"allow_rename": 0,
"doctype": "DocType",
"max_attachments": 0,

View File

@ -10,7 +10,6 @@
"istable": 1,
"autoname": "MTND/.######",
"name": "__common__",
"default_print_format": "Standard",
"doctype": "DocType",
"module": "Stock"
},

View File

@ -15,7 +15,6 @@
'_last_update': u'1322549701',
'autoname': u'SLE/.########',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'hide_toolbar': 1,
'in_create': 1,

View File

@ -16,7 +16,6 @@
'allow_attach': 1,
'autoname': u'SR/.######',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'is_submittable': 1,
'max_attachments': 1,

View File

@ -9,7 +9,6 @@
{
"autoname": "field:warehouse_name",
"description": "A logical Warehouse against which stock entries are made.",
"default_print_format": "Standard",
"allow_rename": 1,
"search_fields": "warehouse_type",
"module": "Stock",

View File

@ -10,7 +10,6 @@
"is_submittable": 1,
"autoname": "naming_series:",
"name": "__common__",
"default_print_format": "Standard",
"search_fields": "status,customer,customer_name,allocated_to,allocated_on, territory",
"module": "Support",
"doctype": "DocType"

View File

@ -15,7 +15,6 @@
'_last_update': u'1322549701',
'autoname': u'MS.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'is_submittable': 1,
'module': u'Support',

View File

@ -14,7 +14,6 @@
{
'autoname': u'MSD.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': u'Support',

View File

@ -14,7 +14,6 @@
{
'autoname': u'IMD.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': u'Support',

View File

@ -15,7 +15,6 @@
'_last_update': u'1322549701',
'autoname': u'MV.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'is_submittable': 1,
'module': u'Support',

View File

@ -9,7 +9,6 @@
{
"autoname": "naming_series:",
"allow_attach": 1,
"default_print_format": "Standard",
"search_fields": "status,customer,allocated_to,subject,raised_by",
"module": "Support",
"doctype": "DocType",

View File

@ -15,7 +15,6 @@
'_last_update': u'1319016431',
'allow_trash': 1,
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'document_type': u'Master',
'in_dialog': 1,

View File

@ -8,7 +8,6 @@
},
{
"in_create": 0,
"default_print_format": "Standard",
"doctype": "DocType",
"module": "Utilities",
"in_dialog": 0,

View File

@ -14,7 +14,6 @@
{
'autoname': u'GLMDetail.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'istable': 1,
'module': u'Utilities',