diff --git a/accounts/doctype/journal_voucher/journal_voucher.py b/accounts/doctype/journal_voucher/journal_voucher.py
index 2c9b7ae7b6..ab5d5564e1 100644
--- a/accounts/doctype/journal_voucher/journal_voucher.py
+++ b/accounts/doctype/journal_voucher/journal_voucher.py
@@ -23,7 +23,7 @@ from webnotes.model import db_exists
from webnotes.model.doc import Document, addchild, getchildren, make_autoname
from webnotes.model.doclist import getlist, copy_doclist
from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax
-from webnotes import session, form, msgprint, errprint
+from webnotes import session, form, is_testing, msgprint, errprint
set = webnotes.conn.set
sql = webnotes.conn.sql
@@ -42,15 +42,9 @@ class DocType:
self.credit_days_global = -1
self.is_approving_authority = -1
- #--------------------------------------------------------------------------------------------------------
- # Autoname
- #--------------------------------------------------------------------------------------------------------
def autoname(self):
self.doc.name = make_autoname(self.doc.naming_series+'.#####')
- #--------------------------------------------------------------------------------------------------------
- # Fetch outstanding amount from RV/PV
- #--------------------------------------------------------------------------------------------------------
def get_outstanding(self, args):
args = eval(args)
o_s = sql("select outstanding_amount from `tab%s` where name = '%s'" % (args['doctype'],args['docname']))
@@ -59,9 +53,6 @@ class DocType:
if args['doctype'] == 'Sales Invoice':
return {'credit': o_s and flt(o_s[0][0]) or 0}
- #--------------------------------------------------------------------------------------------------------
- # Create remarks
- #--------------------------------------------------------------------------------------------------------
def create_remarks(self):
r = []
if self.doc.cheque_no :
@@ -90,9 +81,6 @@ class DocType:
if r:
self.doc.remark = ("\n").join(r)
- # --------------------------------------------------------------------------------------------------------
- # Check user role for approval process
- # --------------------------------------------------------------------------------------------------------
def get_authorized_user(self):
if self.is_approving_authority==-1:
self.is_approving_authority = 0
@@ -107,17 +95,12 @@ class DocType:
return self.is_approving_authority
- # get master type
- # ---------------
def get_master_type(self, ac):
if not self.master_type.get(ac):
self.master_type[ac] = sql("select master_type from `tabAccount` where name=%s", ac)[0][0] or 'None'
return self.master_type[ac]
- # get credit days for
- # -------------------
def get_credit_days_for(self, ac):
-
if not self.credit_days_for.has_key(ac):
self.credit_days_for[ac] = sql("select credit_days from `tabAccount` where name='%s'" % ac)[0][0] or 0
@@ -128,10 +111,6 @@ class DocType:
else:
return self.credit_days_for[ac]
-
- # --------------------------------------------------------------------------------------------------------
- # Check Credit Days - Cheque Date can not after (Posting date + Credit Days)
- # --------------------------------------------------------------------------------------------------------
def check_credit_days(self):
date_diff = 0
if self.doc.cheque_date:
@@ -150,9 +129,6 @@ class DocType:
msgprint("Credit Not Allowed: Cannot allow a check that is dated more than %s days after the posting date" % credit_days)
raise Exception
- #--------------------------------------------------------------------------------------------------------
- # validation of debit/credit account with Debit To Account(RV) or Credit To Account (PV)
- #--------------------------------------------------------------------------------------------------------
def check_account_against_entries(self):
for d in getlist(self.doclist,'entries'):
if d.against_invoice:
@@ -167,9 +143,6 @@ class DocType:
msgprint("Credit account is not matching with payable voucher")
raise Exception
- #--------------------------------------------------------------------------------------------------------
- # Validate Cheque Info: Mandatory for Bank/Contra voucher
- #--------------------------------------------------------------------------------------------------------
def validate_cheque_info(self):
if self.doc.voucher_type in ['Bank Voucher']:
if not self.doc.cheque_no or not self.doc.cheque_date:
@@ -180,9 +153,6 @@ class DocType:
msgprint("Cheque No is mandatory if you entered Cheque Date")
raise Exception
- #--------------------------------------------------------------------------------------------------------
- # Gives reminder for making is_advance = 'Yes' in Advance Entry
- #--------------------------------------------------------------------------------------------------------
def validate_entries_for_advance(self):
for d in getlist(self.doclist,'entries'):
if not d.is_advance and not d.against_voucher and not d.against_invoice and d.against_jv:
@@ -190,9 +160,6 @@ class DocType:
if (master_type == 'Customer' and flt(d.credit) > 0) or (master_type == 'Supplier' and flt(d.debit) > 0):
msgprint("Message: Please check Is Advance as 'Yes' against Account %s if this is an advance entry." % d.account)
- #--------------------------------------------------------------------------------------------------------
- # TDS: Validate tds related fields
- #--------------------------------------------------------------------------------------------------------
def get_tds_category_account(self):
for d in getlist(self.doclist,'entries'):
if flt(d.debit) > 0 and not d.against_voucher and d.is_advance == 'Yes':
@@ -220,11 +187,6 @@ class DocType:
msgprint("Please select TDS Applicable = 'Yes' in account head: '%s' if you want to deduct TDS." % self.doc.supplier_account)
raise Exception
-
-
- #--------------------------------------------------------------------------------------------------------
- # If TDS applicable , TDS category and supplier account should be mandatory
- #--------------------------------------------------------------------------------------------------------
def validate_category_account(self, credit_account):
if not self.doc.tds_category:
msgprint("Please select TDS Category")
@@ -236,10 +198,6 @@ class DocType:
msgprint("Supplier Account is not matching with the account mentioned in the table. Please select proper Supplier Account and click on 'Get TDS' button.")
raise Exception
-
- #--------------------------------------------------------------------------------------------------------
- # If TDS is not applicable , all related fields should blank
- #--------------------------------------------------------------------------------------------------------
def set_fields_null(self):
self.doc.ded_amount = 0
self.doc.rate = 0
@@ -247,9 +205,6 @@ class DocType:
self.doc.tds_category = ''
self.doc.supplier_account = ''
- #--------------------------------------------------------------------------------------------------------
- # Get TDS amount
- #--------------------------------------------------------------------------------------------------------
def get_tds(self):
if cstr(self.doc.is_opening) != 'Yes':
if self.doc.total_debit > 0:
@@ -257,10 +212,6 @@ class DocType:
if self.doc.supplier_account and self.doc.tds_category:
get_obj('TDS Control').get_tds_amount(self)
-
- #--------------------------------------------------------------------------------------------------------
- # Insert new row to balance total debit and total credit
- #--------------------------------------------------------------------------------------------------------
def get_balance(self):
if not getlist(self.doclist,'entries'):
msgprint("Please enter atleast 1 entry in 'GL Entries' table")
@@ -295,9 +246,6 @@ class DocType:
self.doc.difference = flt(self.doc.total_debit) - flt(self.doc.total_credit)
- #--------------------------------------------------------------------------------------------------------
- # Set against account
- #--------------------------------------------------------------------------------------------------------
def get_against_account(self):
# Debit = Credit
debit, credit = 0.0, 0.0
@@ -323,9 +271,6 @@ class DocType:
if flt(d.debit) > 0: d.against_account = ', '.join(credit_list)
if flt(d.credit) > 0: d.against_account = ', '.join(debit_list)
-
- # set aging date
- #---------------
def set_aging_date(self):
if self.doc.is_opening != 'Yes':
self.doc.aging_date = self.doc.posting_date
@@ -345,9 +290,6 @@ class DocType:
else:
self.doc.aging_date = self.doc.posting_date
- # ------------------------
- # set print format fields
- # ------------------------
def set_print_format_fields(self):
for d in getlist(self.doclist, 'entries'):
#msgprint(self.doc.company)
@@ -363,10 +305,6 @@ class DocType:
self.doc.total_amount = dcc +' '+ cstr(amt)
self.doc.total_amount_in_words = get_obj('Sales Common').get_total_in_words(dcc, cstr(amt))
-
- # --------------------------------
- # get outstanding invoices values
- # --------------------------------
def get_values(self):
cond = (flt(self.doc.write_off_amount) > 0) and ' and outstanding_amount <= '+self.doc.write_off_amount or ''
if self.doc.write_off_based_on == 'Accounts Receivable':
@@ -375,9 +313,6 @@ class DocType:
return sql("select name, credit_to, outstanding_amount from `tabPurchase Invoice` where docstatus = 1 and company = '%s' and outstanding_amount > 0 %s" % (self.doc.company, cond))
- # -------------------------
- # get outstanding invoices
- # -------------------------
def get_outstanding_invoices(self):
self.doclist = self.doc.clear_table(self.doclist, 'entries')
total = 0
@@ -399,13 +334,10 @@ class DocType:
jd.credit = total
jd.save(1)
-
- #--------------------------------------------------------------------------------------------------------
- # VALIDATE
- #--------------------------------------------------------------------------------------------------------
def validate(self):
if not self.doc.is_opening:
self.doc.is_opening='No'
+ self.validate_debit_credit()
self.get_against_account()
self.validate_cheque_info()
self.create_remarks()
@@ -420,25 +352,24 @@ class DocType:
self.set_print_format_fields()
#FY and Date validation
- get_obj('Sales Common').validate_fiscal_year(self.doc.fiscal_year,self.doc.posting_date,'Posting Date')
+ get_obj('Sales Common').validate_fiscal_year(self.doc.fiscal_year, \
+ self.doc.posting_date, 'Posting Date')
+
+ def validate_debit_credit(self):
+ for d in getlist(self.doclist, 'entries'):
+ if d.debit and d.credit:
+ msgprint("You cannot credit and debit same account at the same time.",
+ raise_exception=1)
- #--------------------------------------------------------------------------------------------------------
- # On Update - Update Feed
- #--------------------------------------------------------------------------------------------------------
def on_update(self):
pass
- #--------------------------------------------------------------------------------------------------------
- # On submit
- #--------------------------------------------------------------------------------------------------------
def on_submit(self):
if self.doc.voucher_type in ['Bank Voucher', 'Contra Voucher', 'Journal Entry']:
self.check_credit_days()
self.check_account_against_entries()
get_obj(dt='GL Control').make_gl_entries(self.doc, self.doclist)
-
- # validate against jv no
def validate_against_jv(self):
for d in getlist(self.doclist, 'entries'):
if d.against_jv:
@@ -448,18 +379,13 @@ class DocType:
elif not sql("select name from `tabJournal Voucher Detail` where account = '%s' and docstatus = 1 and parent = '%s'" % (d.account, d.against_jv)):
msgprint("Against JV: "+ d.against_jv + " is not valid. Please check")
raise Exception
-
- #--------------------------------------------------------------------------------------------------------
- # On cancel reverse gl entry
- #--------------------------------------------------------------------------------------------------------
+
def on_cancel(self):
self.check_tds_payment_voucher()
get_obj(dt='GL Control').make_gl_entries(self.doc, self.doclist, cancel=1)
- # Check whether tds payment voucher has been created against this voucher
- #---------------------------------------------------------------------------
def check_tds_payment_voucher(self):
tdsp = sql("select parent from `tabTDS Payment Detail` where voucher_no = '%s' and docstatus = 1 and parent not like 'old%'")
if tdsp:
msgprint("TDS Payment voucher '%s' has been made against this voucher. Please cancel the payment voucher to proceed." % (tdsp and tdsp[0][0] or ''))
- raise Exception
+ raise Exception
\ No newline at end of file
diff --git a/accounts/doctype/purchase_invoice/purchase_invoice.py b/accounts/doctype/purchase_invoice/purchase_invoice.py
index 969f99c77f..9e92b85aa1 100644
--- a/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -66,7 +66,9 @@ class DocType(TransactionBase):
def get_cust(self):
ret = {}
if self.doc.credit_to:
- ret['supplier'] = get_value('Account',self.doc.credit_to,'master_name')
+ acc = get_value('Account',self.doc.credit_to,['master_name', 'credit_days'])
+ ret['supplier'] = acc[0]
+ ret['due_date'] = add_days(cstr(self.doc.posting_date), acc and cint(acc[1]) or 0)
return ret
diff --git a/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt b/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt
index 4673189ad3..3198b25632 100644
--- a/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt
+++ b/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt
@@ -5,7 +5,7 @@
{
u'creation': '2012-09-18 11:20:24',
u'docstatus': 0,
- u'modified': '2012-09-28 12:19:57',
+ u'modified': '2012-09-28 12:27:43',
u'modified_by': u'Administrator',
u'owner': u'wasim@webnotestech.com'
},
diff --git a/accounts/doctype/sales_invoice/sales_invoice.js b/accounts/doctype/sales_invoice/sales_invoice.js
index 091c652e4a..16973f07bd 100644
--- a/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/accounts/doctype/sales_invoice/sales_invoice.js
@@ -30,7 +30,7 @@ wn.require('app/setup/doctype/notification_control/notification_control.js');
// On Load
// -------
cur_frm.cscript.onload = function(doc,dt,dn) {
- if(!doc.customer && doc.debit_to) get_field(dt, 'debit_to', dn).print_hide = 0;
+ if(!doc.customer && doc.debit_to) Meta.get_field(dt, 'debit_to', dn).print_hide = 0;
if (doc.__islocal) {
//if(!doc.voucher_date) set_multiple(dt,dn,{voucher_date:get_today()});
if(!doc.due_date) set_multiple(dt,dn,{due_date:get_today()});
diff --git a/accounts/page/general_ledger/general_ledger.js b/accounts/page/general_ledger/general_ledger.js
index eca9dea97a..c8866fcfd5 100644
--- a/accounts/page/general_ledger/general_ledger.js
+++ b/accounts/page/general_ledger/general_ledger.js
@@ -102,8 +102,9 @@ erpnext.GeneralLedger = wn.views.GridReport.extend({
var default_company = me.filter_inputs.company.get(0).opts.default_value;
$filter.empty().add_options([$filter.get(0).opts.default_value].concat(
$.map(wn.report_dump.data["Account"], function(ac) {
- return (accounts_by_company[company].indexOf(ac.name)!=-1 ||
- company===default_company) ? ac.name : null;
+ return (company===default_company ||
+ accounts_by_company[company].indexOf(ac.name)!=-1) ?
+ ac.name : null;
})));
me.filter_inputs.refresh.click();
});
diff --git a/hr/doctype/appraisal/appraisal.js b/hr/doctype/appraisal/appraisal.js
index fbd7e02214..1243dc48f3 100644
--- a/hr/doctype/appraisal/appraisal.js
+++ b/hr/doctype/appraisal/appraisal.js
@@ -53,7 +53,7 @@ cur_frm.cscript.employee = function(doc,cdt,cdn){
$c_obj(make_doclist(doc.doctype, doc.name),'set_approver','', function(r,rt){
if(r.message){
doc.employee_name = r.message['emp_nm'];
- get_field(doc.doctype, 'kra_approver' , doc.name).options = r.message['app_lst'];
+ Meta.get_field(doc.doctype, 'kra_approver' , doc.name).options = r.message['app_lst'];
refresh_many(['kra_approver','employee_name']);
}
});
diff --git a/hr/doctype/appraisal/appraisal.py b/hr/doctype/appraisal/appraisal.py
index b0652dbf4e..2b206418f4 100644
--- a/hr/doctype/appraisal/appraisal.py
+++ b/hr/doctype/appraisal/appraisal.py
@@ -89,6 +89,7 @@ class DocType:
self.validate_fiscal_year()
def set_approver(self):
+ errprint('here')
ret={}
approver_lst =[]
emp_nm = self.get_employee_name()
diff --git a/hr/doctype/leave_allocation/leave_allocation.txt b/hr/doctype/leave_allocation/leave_allocation.txt
index 9045221092..287dc80b28 100644
--- a/hr/doctype/leave_allocation/leave_allocation.txt
+++ b/hr/doctype/leave_allocation/leave_allocation.txt
@@ -3,11 +3,11 @@
# These values are common in all dictionaries
{
- 'creation': '2012-03-27 14:35:58',
- 'docstatus': 0,
- 'modified': '2012-03-27 14:45:49',
- 'modified_by': u'Administrator',
- 'owner': u'Administrator'
+ u'creation': '2012-05-15 12:14:45',
+ u'docstatus': 0,
+ u'modified': '2012-10-02 11:21:31',
+ u'modified_by': u'Administrator',
+ u'owner': u'Administrator'
},
# These values are common for all DocType
@@ -16,21 +16,21 @@
'autoname': u'LAL/.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
- 'doctype': 'DocType',
+ u'doctype': u'DocType',
'is_submittable': 1,
'module': u'HR',
- 'name': '__common__',
+ u'name': u'__common__',
'search_fields': u'employee,employee_name,leave_type,total_leaves_allocated,fiscal_year',
'section_style': u'Simple',
'server_code_error': u' ',
'show_in_menu': 0,
- 'version': 1560
+ 'version': 1
},
# These values are common for all DocField
{
- 'doctype': u'DocField',
- 'name': '__common__',
+ u'doctype': u'DocField',
+ u'name': u'__common__',
'parent': u'Leave Allocation',
'parentfield': u'fields',
'parenttype': u'DocType'
@@ -38,8 +38,8 @@
# These values are common for all DocPerm
{
- 'doctype': u'DocPerm',
- 'name': '__common__',
+ u'doctype': u'DocPerm',
+ u'name': u'__common__',
'parent': u'Leave Allocation',
'parentfield': u'permissions',
'parenttype': u'DocType',
@@ -48,58 +48,13 @@
# DocType, Leave Allocation
{
- 'doctype': 'DocType',
- 'name': u'Leave Allocation'
- },
-
- # DocPerm
- {
- 'amend': 1,
- 'cancel': 1,
- 'create': 1,
- 'doctype': u'DocPerm',
- 'match': u'owner',
- 'permlevel': 0,
- 'role': u'HR User',
- 'submit': 1,
- 'write': 1
- },
-
- # DocPerm
- {
- 'amend': 0,
- 'cancel': 0,
- 'create': 0,
- 'doctype': u'DocPerm',
- 'match': u'owner',
- 'permlevel': 0,
- 'role': u'HR User',
- 'submit': 0,
- 'write': 0
- },
-
- # DocPerm
- {
- 'amend': 1,
- 'cancel': 1,
- 'create': 1,
- 'doctype': u'DocPerm',
- 'permlevel': 0,
- 'role': u'HR Manager',
- 'submit': 1,
- 'write': 1
- },
-
- # DocPerm
- {
- 'doctype': u'DocPerm',
- 'permlevel': 1,
- 'role': u'HR Manager'
+ u'doctype': u'DocType',
+ u'name': u'Leave Allocation'
},
# DocField
{
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'column_break0',
'fieldtype': u'Column Break',
'permlevel': 0,
@@ -109,7 +64,7 @@
# DocField
{
'colour': u'White:FFF',
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'employee',
'fieldtype': u'Link',
'in_filter': 1,
@@ -125,7 +80,7 @@
# DocField
{
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'employee_name',
'fieldtype': u'Data',
'in_filter': 1,
@@ -137,7 +92,7 @@
# DocField
{
'colour': u'White:FFF',
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'leave_type',
'fieldtype': u'Select',
'in_filter': 1,
@@ -155,7 +110,7 @@
{
'colour': u'White:FFF',
'default': u'Today',
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'posting_date',
'fieldtype': u'Date',
'hidden': 0,
@@ -171,7 +126,7 @@
# DocField
{
'colour': u'White:FFF',
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'fiscal_year',
'fieldtype': u'Select',
'in_filter': 1,
@@ -188,7 +143,7 @@
# DocField
{
'colour': u'White:FFF',
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'description',
'fieldtype': u'Small Text',
'hidden': 0,
@@ -201,7 +156,7 @@
# DocField
{
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'column_break1',
'fieldtype': u'Column Break',
'permlevel': 0,
@@ -210,7 +165,7 @@
# DocField
{
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'carry_forward',
'fieldtype': u'Check',
'label': u'Carry Forward',
@@ -220,7 +175,7 @@
# DocField
{
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'carry_forwarded_leaves',
'fieldtype': u'Currency',
'label': u'Carry Forwarded Leaves',
@@ -230,7 +185,7 @@
# DocField
{
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'new_leaves_allocated',
'fieldtype': u'Currency',
'label': u'New Leaves Allocated',
@@ -240,7 +195,7 @@
# DocField
{
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'total_leaves_allocated',
'fieldtype': u'Currency',
'label': u'Total Leaves Allocated',
@@ -250,7 +205,7 @@
# DocField
{
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'amended_from',
'fieldtype': u'Data',
'hidden': 0,
@@ -265,7 +220,7 @@
# DocField
{
'description': u'The date at which current entry is corrected in the system.',
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'amendment_date',
'fieldtype': u'Date',
'hidden': 0,
@@ -275,5 +230,37 @@
'oldfieldtype': u'Date',
'permlevel': 1,
'print_hide': 1
+ },
+
+ # DocPerm
+ {
+ 'amend': 1,
+ 'cancel': 1,
+ 'create': 1,
+ u'doctype': u'DocPerm',
+ 'match': u'owner',
+ 'permlevel': 0,
+ 'role': u'HR User',
+ 'submit': 1,
+ 'write': 1
+ },
+
+ # DocPerm
+ {
+ 'amend': 1,
+ 'cancel': 1,
+ 'create': 1,
+ u'doctype': u'DocPerm',
+ 'permlevel': 0,
+ 'role': u'HR Manager',
+ 'submit': 1,
+ 'write': 1
+ },
+
+ # DocPerm
+ {
+ u'doctype': u'DocPerm',
+ 'permlevel': 1,
+ 'role': u'All'
}
]
\ No newline at end of file
diff --git a/hr/doctype/leave_application/leave_application.txt b/hr/doctype/leave_application/leave_application.txt
index b2ce2ab338..c87c746b2f 100644
--- a/hr/doctype/leave_application/leave_application.txt
+++ b/hr/doctype/leave_application/leave_application.txt
@@ -3,11 +3,11 @@
# These values are common in all dictionaries
{
- 'creation': '2012-03-27 14:35:58',
- 'docstatus': 0,
- 'modified': '2012-03-27 14:45:49',
- 'modified_by': u'Administrator',
- 'owner': u'Administrator'
+ u'creation': '2012-05-15 12:14:45',
+ u'docstatus': 0,
+ u'modified': '2012-10-02 11:19:44',
+ u'modified_by': u'Administrator',
+ u'owner': u'Administrator'
},
# These values are common for all DocType
@@ -15,23 +15,23 @@
'_last_update': u'1310019491',
'autoname': u'LAP/.#####',
'colour': u'White:FFF',
- 'doctype': 'DocType',
+ u'doctype': u'DocType',
'document_type': u'Transaction',
'is_submittable': 1,
'module': u'HR',
- 'name': '__common__',
+ u'name': u'__common__',
'search_fields': u'employee,employee_name,leave_type,from_date,to_date,total_leave_days,fiscal_year',
'section_style': u'Simple',
'show_in_menu': 0,
'subject': u'From %(employee_name)s, %(designation)s',
'tag_fields': u'leave_type',
- 'version': 17
+ 'version': 1
},
# These values are common for all DocField
{
- 'doctype': u'DocField',
- 'name': '__common__',
+ u'doctype': u'DocField',
+ u'name': u'__common__',
'parent': u'Leave Application',
'parentfield': u'fields',
'parenttype': u'DocType'
@@ -39,8 +39,8 @@
# These values are common for all DocPerm
{
- 'doctype': u'DocPerm',
- 'name': '__common__',
+ u'doctype': u'DocPerm',
+ u'name': u'__common__',
'parent': u'Leave Application',
'parentfield': u'permissions',
'parenttype': u'DocType',
@@ -49,85 +49,13 @@
# DocType, Leave Application
{
- 'doctype': 'DocType',
- 'name': u'Leave Application'
- },
-
- # DocPerm
- {
- 'amend': 1,
- 'cancel': 1,
- 'create': 1,
- 'doctype': u'DocPerm',
- 'match': u'owner',
- 'permlevel': 0,
- 'submit': 1,
- 'write': 1
- },
-
- # DocPerm
- {
- 'amend': 0,
- 'cancel': 0,
- 'create': 0,
- 'doctype': u'DocPerm',
- 'match': u'owner',
- 'permlevel': 0,
- 'submit': 0,
- 'write': 0
- },
-
- # DocPerm
- {
- 'amend': 1,
- 'cancel': 1,
- 'create': 1,
- 'doctype': u'DocPerm',
- 'permlevel': 0,
- 'role': u'HR User',
- 'submit': 1,
- 'write': 1
- },
-
- # DocPerm
- {
- 'amend': 1,
- 'cancel': 1,
- 'create': 1,
- 'doctype': u'DocPerm',
- 'permlevel': 0,
- 'role': u'HR Manager',
- 'submit': 1,
- 'write': 1
- },
-
- # DocPerm
- {
- 'amend': 0,
- 'cancel': 0,
- 'create': 0,
- 'doctype': u'DocPerm',
- 'permlevel': 1,
- 'role': u'HR User',
- 'submit': 0,
- 'write': 0
- },
-
- # DocPerm
- {
- 'amend': 0,
- 'cancel': 0,
- 'create': 0,
- 'doctype': u'DocPerm',
- 'permlevel': 1,
- 'role': u'HR Manager',
- 'submit': 0,
- 'write': 0
+ u'doctype': u'DocType',
+ u'name': u'Leave Application'
},
# DocField
{
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'column_break0',
'fieldtype': u'Column Break',
'permlevel': 0,
@@ -136,7 +64,7 @@
# DocField
{
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'employee',
'fieldtype': u'Link',
'in_filter': 1,
@@ -149,7 +77,7 @@
# DocField
{
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'employee_name',
'fieldtype': u'Data',
'in_filter': 1,
@@ -160,7 +88,7 @@
# DocField
{
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'leave_type',
'fieldtype': u'Select',
'in_filter': 1,
@@ -173,7 +101,7 @@
# DocField
{
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'leave_balance',
'fieldtype': u'Currency',
'label': u'Leave Balance',
@@ -184,7 +112,7 @@
{
'colour': u'White:FFF',
'default': u'Today',
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'posting_date',
'fieldtype': u'Date',
'label': u'Posting Date',
@@ -195,7 +123,7 @@
# DocField
{
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'fiscal_year',
'fieldtype': u'Select',
'in_filter': 1,
@@ -208,7 +136,7 @@
# DocField
{
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'column_break1',
'fieldtype': u'Column Break',
'permlevel': 0,
@@ -218,7 +146,7 @@
# DocField
{
'colour': u'White:FFF',
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'half_day',
'fieldtype': u'Check',
'label': u'Half Day',
@@ -229,7 +157,7 @@
# DocField
{
'colour': u'White:FFF',
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'from_date',
'fieldtype': u'Date',
'label': u'From Date',
@@ -241,7 +169,7 @@
# DocField
{
'colour': u'White:FFF',
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'to_date',
'fieldtype': u'Date',
'label': u'To Date',
@@ -252,7 +180,7 @@
# DocField
{
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'total_leave_days',
'fieldtype': u'Currency',
'label': u'Total Leave Days',
@@ -261,7 +189,7 @@
# DocField
{
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'description',
'fieldtype': u'Small Text',
'label': u'Description',
@@ -271,7 +199,7 @@
# DocField
{
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'letter_head',
'fieldtype': u'Link',
'label': u'Letter Head',
@@ -281,7 +209,7 @@
# DocField
{
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'amended_from',
'fieldtype': u'Data',
'label': u'Amended From',
@@ -290,10 +218,68 @@
# DocField
{
- 'doctype': u'DocField',
+ u'doctype': u'DocField',
'fieldname': u'amendment_date',
'fieldtype': u'Date',
'label': u'Amendment Date',
'permlevel': 1
+ },
+
+ # DocPerm
+ {
+ 'amend': 0,
+ 'cancel': 0,
+ 'create': 0,
+ u'doctype': u'DocPerm',
+ 'match': u'owner',
+ 'permlevel': 0,
+ 'role': u'Employee',
+ 'submit': 0,
+ 'write': 0
+ },
+
+ # DocPerm
+ {
+ 'amend': 1,
+ 'cancel': 1,
+ 'create': 1,
+ u'doctype': u'DocPerm',
+ 'permlevel': 0,
+ 'role': u'HR User',
+ 'submit': 1,
+ 'write': 1
+ },
+
+ # DocPerm
+ {
+ 'amend': 1,
+ 'cancel': 1,
+ 'create': 1,
+ u'doctype': u'DocPerm',
+ 'permlevel': 0,
+ 'role': u'HR Manager',
+ 'submit': 1,
+ 'write': 1
+ },
+
+ # DocPerm
+ {
+ u'doctype': u'DocPerm',
+ 'permlevel': 1,
+ 'role': u'HR User'
+ },
+
+ # DocPerm
+ {
+ u'doctype': u'DocPerm',
+ 'permlevel': 1,
+ 'role': u'HR Manager'
+ },
+
+ # DocPerm
+ {
+ u'doctype': u'DocPerm',
+ 'permlevel': 1,
+ 'role': u'Employee'
}
]
\ No newline at end of file
diff --git a/patches/before_jan_2012/repost_account_bal.py b/patches/before_jan_2012/repost_account_bal.py
index a87bfe0cfc..b1d68c7d0f 100644
--- a/patches/before_jan_2012/repost_account_bal.py
+++ b/patches/before_jan_2012/repost_account_bal.py
@@ -30,10 +30,7 @@ def execute():
fy_obj = get_obj('Fiscal Year', f[0])
fy_obj.doc.past_year = prev_fy
fy_obj.doc.company = c[0]
- fy_obj.doc.save()
-
- fy_obj = get_obj('Fiscal Year', f[0])
fy_obj.repost()
prev_fy = f[0]
- sql("commit")
- sql("start transaction")
+ webnotes.conn.commit()
+ webnotes.conn.begin()
\ No newline at end of file
diff --git a/patches/october_2012/__init__.py b/patches/october_2012/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/patches/october_2012/update_permission.py b/patches/october_2012/update_permission.py
new file mode 100644
index 0000000000..5686a8ebc5
--- /dev/null
+++ b/patches/october_2012/update_permission.py
@@ -0,0 +1,39 @@
+# 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
1. Click on "Download Template" \ - to download the template of all Items.
' - +'2. Update prices and Currency.
' - +'3. Save it as a CSV (.csv) file.
' - +'4. Upload the file.
'); + if (wn.boot.profile.can_create.indexOf(cdt) !== -1) { + if(!doc.file_list) { + cur_frm.set_intro('1. Click on "Download Template" \ + to download the template of all Items.
' + +'2. Update prices and Currency.
' + +'3. Save it as a CSV (.csv) file.
' + +'4. Upload the file.
'); - cur_frm.add_custom_button('Download Template', function() { - $c_obj_csv(cur_frm.get_doclist(), 'download_template'); - }, 'icon-download') + cur_frm.add_custom_button('Download Template', function() { + $c_obj_csv(cur_frm.get_doclist(), 'download_template'); + }, 'icon-download') - cur_frm.add_custom_button('Upload Price List', function() { - cur_frm.attachments.add_attachment(); - }, 'icon-upload') + cur_frm.add_custom_button('Upload Price List', function() { + cur_frm.attachments.add_attachment(); + }, 'icon-upload'); + } else { + cur_frm.set_intro('To update prices from the attachment, click on "Update Prices". \ + To reset prices, delete the attachment (in the sidebar) and upload again.'); - - } else { - cur_frm.set_intro('To update prices from the attachment, click on "Update Prices". \ - To reset prices, delete the attachment (in the sidebar) and upload again.'); - - // Update Prices - cur_frm.add_custom_button('Update Prices', function() { - cur_frm.call_server('update_prices'); - }, 'icon-refresh') + // Update Prices + cur_frm.add_custom_button('Update Prices', function() { + cur_frm.call_server('update_prices'); + }, 'icon-refresh'); + } } } diff --git a/startup/event_handlers.py b/startup/event_handlers.py index 9b9c03019f..472d5d105c 100644 --- a/startup/event_handlers.py +++ b/startup/event_handlers.py @@ -118,8 +118,7 @@ def check_if_expired(): # if expired, stop user from logging in from webnotes.utils import formatdate - msg = """Oops! Your subscription expired on %s. -