Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Nabin Hait
2012-12-24 18:47:57 +05:30
39 changed files with 534 additions and 503 deletions

View File

@@ -42,7 +42,7 @@ class DocType:
self.doc.total_amount = 0.0 self.doc.total_amount = 0.0
for d in dl: for d in dl:
nl = addchild(self.doc, 'entries', 'Bank Reconciliation Detail', 1, self.doclist) nl = addchild(self.doc, 'entries', 'Bank Reconciliation Detail', self.doclist)
nl.posting_date = cstr(d[5]) nl.posting_date = cstr(d[5])
nl.voucher_id = cstr(d[0]) nl.voucher_id = cstr(d[0])
nl.cheque_number = cstr(d[1]) nl.cheque_number = cstr(d[1])

View File

@@ -31,7 +31,8 @@ class DocType:
'October','November','December'] 'October','November','December']
idx =1 idx =1
for m in month_list: for m in month_list:
mnth = addchild(self.doc,'budget_distribution_details','Budget Distribution Detail',1,self.doclist) mnth = addchild(self.doc, 'budget_distribution_details',
'Budget Distribution Detail', self.doclist)
mnth.month = m or '' mnth.month = m or ''
mnth.idx = idx mnth.idx = idx
idx += 1 idx += 1

View File

@@ -223,7 +223,7 @@ class DocType:
obj.doclist = obj.doc.clear_table(obj.doclist,table_field_name) obj.doclist = obj.doc.clear_table(obj.doclist,table_field_name)
# Create advance table # Create advance table
for d in jv_detail: for d in jv_detail:
add = addchild(obj.doc, table_field_name, table_name, 1, obj.doclist) add = addchild(obj.doc, table_field_name, table_name, obj.doclist)
add.journal_voucher = d[0] add.journal_voucher = d[0]
add.jv_detail_no = d[3] add.jv_detail_no = d[3]
add.remarks = d[1] add.remarks = d[1]
@@ -286,7 +286,7 @@ class DocType:
webnotes.conn.sql("update `tabJournal Voucher Detail` set %s = '%s', %s = '%s' where name = '%s'" % (dr_or_cr, flt(allocate), doctype == "Purchase Invoice" and 'against_voucher' or 'against_invoice',cstr(against_document_no), jv_detail_no)) webnotes.conn.sql("update `tabJournal Voucher Detail` set %s = '%s', %s = '%s' where name = '%s'" % (dr_or_cr, flt(allocate), doctype == "Purchase Invoice" and 'against_voucher' or 'against_invoice',cstr(against_document_no), jv_detail_no))
# new entry with balance amount # new entry with balance amount
add = addchild(jv_obj.doc, 'entries', 'Journal Voucher Detail', 1, jv_obj.doclist) add = addchild(jv_obj.doc, 'entries', 'Journal Voucher Detail', jv_obj.doclist)
add.account = account_head add.account = account_head
add.cost_center = cstr(jvd[0][1]) add.cost_center = cstr(jvd[0][1])
add.balance = cstr(jvd[0][2]) add.balance = cstr(jvd[0][2])
@@ -353,7 +353,7 @@ class DocType:
if d['allocated_amt'] < d['unadjusted_amt']: if d['allocated_amt'] < d['unadjusted_amt']:
jvd = webnotes.conn.sql("select cost_center, balance, against_account, is_advance from `tabJournal Voucher Detail` where name = '%s'" % d['voucher_detail_no']) jvd = webnotes.conn.sql("select cost_center, balance, against_account, is_advance from `tabJournal Voucher Detail` where name = '%s'" % d['voucher_detail_no'])
# new entry with balance amount # new entry with balance amount
ch = addchild(jv_obj.doc, 'entries', 'Journal Voucher Detail', 1) ch = addchild(jv_obj.doc, 'entries', 'Journal Voucher Detail')
ch.account = d['account'] ch.account = d['account']
ch.cost_center = cstr(jvd[0][0]) ch.cost_center = cstr(jvd[0][0])
ch.balance = cstr(jvd[0][1]) ch.balance = cstr(jvd[0][1])

View File

@@ -174,7 +174,7 @@ class DocType:
# Set the diff in a new row # Set the diff in a new row
if flag == 0 and (flt(diff) != 0): if flag == 0 and (flt(diff) != 0):
jd = addchild(self.doc, 'entries', 'Journal Voucher Detail', 1, self.doclist) jd = addchild(self.doc, 'entries', 'Journal Voucher Detail', self.doclist)
if diff>0: if diff>0:
jd.credit = flt(diff) jd.credit = flt(diff)
elif diff<0: elif diff<0:
@@ -256,7 +256,7 @@ class DocType:
total = 0 total = 0
for d in self.get_values(): for d in self.get_values():
total += flt(d[2]) total += flt(d[2])
jd = addchild(self.doc, 'entries', 'Journal Voucher Detail', 1, self.doclist) jd = addchild(self.doc, 'entries', 'Journal Voucher Detail', self.doclist)
jd.account = cstr(d[1]) jd.account = cstr(d[1])
if self.doc.write_off_based_on == 'Accounts Receivable': if self.doc.write_off_based_on == 'Accounts Receivable':
jd.credit = flt(d[2]) jd.credit = flt(d[2])
@@ -265,7 +265,7 @@ class DocType:
jd.debit = flt(d[2]) jd.debit = flt(d[2])
jd.against_voucher = cstr(d[0]) jd.against_voucher = cstr(d[0])
jd.save(1) jd.save(1)
jd = addchild(self.doc, 'entries', 'Journal Voucher Detail', 1, self.doclist) jd = addchild(self.doc, 'entries', 'Journal Voucher Detail', self.doclist)
if self.doc.write_off_based_on == 'Accounts Receivable': if self.doc.write_off_based_on == 'Accounts Receivable':
jd.debit = total jd.debit = total
elif self.doc.write_off_based_on == 'Accounts Payable': elif self.doc.write_off_based_on == 'Accounts Payable':

View File

@@ -100,7 +100,7 @@ class DocType:
#-------------------------------------------------- #--------------------------------------------------
def create_payment_table(self, gle): def create_payment_table(self, gle):
for d in gle: for d in gle:
ch = addchild(self.doc, 'ir_payment_details', 'Payment to Invoice Matching Tool Detail', 1, self.doclist) ch = addchild(self.doc, 'ir_payment_details', 'Payment to Invoice Matching Tool Detail', self.doclist)
ch.voucher_no = d.get('voucher_no') ch.voucher_no = d.get('voucher_no')
ch.posting_date = d.get('posting_date') ch.posting_date = d.get('posting_date')
ch.amt_due = self.acc_type == 'debit' and flt(d.get('amt_due')) or -1*flt(d.get('amt_due')) ch.amt_due = self.acc_type == 'debit' and flt(d.get('amt_due')) or -1*flt(d.get('amt_due'))

View File

@@ -612,7 +612,8 @@ class DocType(TransactionBase):
idx = 0 idx = 0
for other in other_charge: for other in other_charge:
d = addchild(obj.doc, 'purchase_tax_details', 'Purchase Taxes and Charges', 1, obj.doclist) d = addchild(obj.doc, 'purchase_tax_details', 'Purchase Taxes and Charges',
obj.doclist)
d.category = other['category'] d.category = other['category']
d.add_deduct_tax = other['add_deduct_tax'] d.add_deduct_tax = other['add_deduct_tax']
d.charge_type = other['charge_type'] d.charge_type = other['charge_type']

View File

@@ -314,7 +314,7 @@ class DocType(TransactionBase):
for i in bom_det: for i in bom_det:
if i and not sql("select name from `tabPurchase Order Item Supplied` where reference_name = '%s' and bom_detail_no = '%s' and parent = '%s' " %(d.name, i[6], self.doc.name)): if i and not sql("select name from `tabPurchase Order Item Supplied` where reference_name = '%s' and bom_detail_no = '%s' and parent = '%s' " %(d.name, i[6], self.doc.name)):
rm_child = addchild(self.doc, 'po_raw_material_details', 'Purchase Order Item Supplied', 1, self.doclist) rm_child = addchild(self.doc, 'po_raw_material_details', 'Purchase Order Item Supplied', self.doclist)
rm_child.reference_name = d.name rm_child.reference_name = d.name
rm_child.bom_detail_no = i and i[6] or '' rm_child.bom_detail_no = i and i[6] or ''

View File

@@ -41,7 +41,7 @@ class DocType:
specification = sql("select specification, value from `tabItem Quality Inspection Parameter` \ specification = sql("select specification, value from `tabItem Quality Inspection Parameter` \
where parent = '%s' order by idx" % (self.doc.item_code)) where parent = '%s' order by idx" % (self.doc.item_code))
for d in specification: for d in specification:
child = addchild(self.doc, 'qa_specification_details', 'Quality Inspection Reading', 1, self.doclist) child = addchild(self.doc, 'qa_specification_details', 'Quality Inspection Reading', self.doclist)
child.specification = d[0] child.specification = d[0]
child.value = d[1] child.value = d[1]
child.status = 'Accepted' child.status = 'Accepted'

View File

@@ -19,7 +19,7 @@ import webnotes
import webnotes.model import webnotes.model
from webnotes import _, msgprint from webnotes import _, msgprint
from webnotes.utils import cint, flt from webnotes.utils import cint, flt
from webnotes.model.utils import round_doc from webnotes.model.utils import round_floats_in_doc
import json import json
from controllers.transaction_controller import TransactionController from controllers.transaction_controller import TransactionController
@@ -83,7 +83,7 @@ class TaxController(TransactionController):
self.precision.item[base_field]) self.precision.item[base_field])
for item in self.item_doclist: for item in self.item_doclist:
round_doc(item, self.precision.item) round_floats_in_doc(item, self.precision.item)
if item.fields.get(self.fmap.discount) == 100: if item.fields.get(self.fmap.discount) == 100:
if not item.fields.get(self.fmap.print_ref_rate): if not item.fields.get(self.fmap.print_ref_rate):
@@ -126,7 +126,7 @@ class TaxController(TransactionController):
self.validate_included_tax(tax) self.validate_included_tax(tax)
# round relevant values # round relevant values
round_doc(tax, self.precision.tax) round_floats_in_doc(tax, self.precision.tax)
def calculate_net_total(self): def calculate_net_total(self):
self.doc.net_total = 0 self.doc.net_total = 0

View File

@@ -0,0 +1,6 @@
.layout-attributions table {
width: 70%;
}
.layout-attributions td:first-child {
width: 30%;
}

View File

@@ -1,83 +1,99 @@
<div class="layout-wrapper"> <div class="layout-wrapper layout-wrapper-appframe layout-attributions">
<a class="close" onclick="window.history.back();">&times;</a> <div class="layout-appframe"></div>
<h1>Attributions</h1> <div class="layout-main">
<h3>ERPNext is made using these Awesome Open Source Projects <i class="icon-heart" style="color: red"></i></h3>
<hr> <hr>
<p><b>Source Code:</b> <a href="https://github.com/webnotes/erpnext"> <table class="table table-bordered table-striped">
https://github.com/webnotes/erpnext</a></p> <tbody>
<p><b>Website:</b> <a href="https://erpnext.com"> <tr>
https://erpnext.com</a></p> <td><a href="https://github.com/webnotes/wnframework">wnframework</a></td>
<td>The full stack Python + Javascript web application framework on which ERPNext is built.</td>
</tr>
<tr>
<td><a href="https://github.com/webnotes/erpnext">ERPNext</a></td>
<td>Web based, Open Source ERP.</td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/Linux">Linux Operating System</a></td>
<td>The operating system that brought a revolution in Open Source software.</td>
</tr>
<tr>
<td><a href="http://www.mysql.com/">MySQL Database</a></td>
<td>The world's most popular Open Source Database.</td>
</tr>
<tr>
<td><a href="http://httpd.apache.org">Apache HTTPD web server</a></td>
<td>The Number One HTTP Server On The Internet.</td>
</tr>
<tr>
<td><a href="http://python.org/">Python Programming Language</a></td>
<td>The "batteries included" language that lets you write elegant code, quickly.<br><br>Python Libraries:
<ul>
<li>MySQLdb
<li>pytz
<li>jinja2
<li>markdown2
<li>dateutil
<li>termcolor
<li>python-memcached
</ul>
</td>
</tr>
<tr>
<td><a href="http://git-scm.com/">Git - Source Code Management</a></td>
<td>Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.<br><br>
Kindly hosted on the web by <a href="https://github.com">GitHub</a>: The service that makes it easier for individuals and teams to write better code, faster. </td>
</tr>
<tr>
<td><a href="http://jquery.com/">JQuery Javascript Libary</a></td>
<td>The write less, do more Javascript Library.</td>
</tr>
<tr>
<td><a href="http://jqueryui.com/">JQuery UI - User Interface Library</a></td>
<td>A curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library.</td>
</tr>
<tr>
<td><a href="http://twitter.github.com/bootstrap/index.html">Bootstrap CSS Framework</a></td>
<td>Sleek, intuitive, and powerful front-end framework for faster and easier web development.</td>
</tr>
<tr>
<td><a href="http://fortawesome.github.com/Font-Awesome/">Font Awesome - Icons</a></td>
<td>The iconic font designed for use with Twitter Bootstrap.</td>
</tr>
<tr>
<td><a href="http://www.tinymce.com/">TinyMCE Rich Text Editor</a></td>
<td>TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL by Moxiecode Systems AB.</td>
</tr>
<tr>
<td><a href="https://github.com/mleibman/SlickGrid">SlickGrid</a></td>
<td>A lightning fast JavaScript grid/spreadsheet.</td>
</tr>
<tr>
<td><a href="http://www.flotcharts.org/">Flot Charting Library</a></td>
<td>Attractive JavaScript plotting for jQuery.</td>
</tr>
<tr>
<td><a href="http://ace.ajax.org/">Ace Code Editor</a></td>
<td>High Performance Code Editor for the web.</td>
</tr>
<tr>
<td><a href="http://taitems.github.com/jQuery.Gantt/">JQuery.Gantt - Gantt Charts</a></td>
<td>Draw Gantt charts with the famous jQuery ease of development.</td>
</tr>
<tr>
<td><a href="http://jscolor.com/">JSColor - Color Picker</a></td>
<td>HTML/Javascript Color Picker.</td>
</tr>
<tr>
<td><a href="https://github.com/dcneiner/Downloadify">Downloadify - Flash Download Widget</a></td>
<td>A tiny javascript + Flash library that enables the creation and download of text files without server interaction.</td>
</tr>
</tbody>
</table>
<hr> <hr>
<p class="help">ERPNext is an Open Source project and is possible because of the work of <h3>ERPNext License: GNU/General Public License</h3>
thousands of software developers, companies and designers who have contributed their <div class="well">
work to the community. We have tried to list as many projects as possible that are
used by ERPNext, but this list may not be exhaustive.</p>
<h4>Server</h4>
<ul>
<li>Linux (GNU)</li>
<li>Apache HTTPD server (web server)</li>
<li>MySQL (database, Percona build)</li>
<li>Git (source code control via Github)</li>
</ul>
<h4>Programming Languages & Libraries</h4>
<ul>
<li><a href="http://python.org">Python</a></li>
<ul>
<li>Python-MySQL</li>
<li>pytz (timezones)</li>
<li>jinja2 (templating)</li>
<li>markdown2 (markdown parser)</li>
<li>jsmin (javascript minifier)</li>
</ul>
<li>Javascript</li>
<ul>
<li>JQuery</li>
<li>JQuery UI (datepicker, sortable)</li>
<li>TinyMCE - text editor</li>
<li>Twitter Bootstrap</li>
<li>Ace - code editor</li>
<li>Slick Grid - report grid</li>
<li>jQPlot - graphs</li>
<li><a href="http://taitems.github.com/jQuery.Gantt/" target="_blank">
JQuery.Gantt</a> - Gantt Chart</li>
<li>JSON2 - JSON builder, parser</li>
<li>JSColor - color picker</li>
<li><a href="https://github.com/dcneiner/Downloadify" target="_blank">
Downloadify</a> - Export CSV files from the browser</li>
<li><a href="https://github.com/harvesthq/chosen" target="_blank">
Chosen</a> - a searchable select dropdown</li>
</ul>
</ul>
<h4>CSS Frameworks</h4>
<ul>
<li>Twitter Bootstrap</li>
</ul>
<h4>Icons</h4>
<ul>
<li>The Noun Project</li>
<li>Font Awesome: http://fortawesome.github.com/Font-Awesome</li>
</ul>
<h4>Web Frameworks</h4>
<ul>
<li>wnframework</li>
</ul>
<h4>Web Browsers</h4>
<ul>
<li>Mozilla Firefox</li>
<ul>
<li>Firebug (debugger)</li>
</ul>
<li>Apple Safari</li>
<li>Google Chorme</li>
</ul>
<hr>
<h2>ERPNext License</h2>
<p><b>ERPNext - Open Source, web based ERP</b></p> <p><b>ERPNext - Open Source, web based ERP</b></p>
<p>Copyright &copy; 2008 onwards, Web Notes Technologies Pvt Ltd, India</p> <p>Copyright &copy; 2008 onwards, Web Notes Technologies Pvt Ltd, India</p>
@@ -92,6 +108,9 @@
GNU General Public License for more details.</p> GNU General Public License for more details.</p>
<p>For complete license see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a></p> <p>For complete license see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a></p>
</div>
<p class="alert">Note: A link to this page must be easily accessible and all other ERPNext branding must remain as it is.</p>
<hr> <hr>
<p>For more information please write to us at support@erpnext.com</p> <p>For more information please write to us at support@erpnext.com</p>
</div> </div>
</div>

View File

@@ -1 +1,4 @@
wn.pages['attributions'].onload = function(wrapper) { } wn.pages['attributions'].onload = function(wrapper) {
wrapper.appframe = new wn.ui.AppFrame($(wrapper).find(".layout-appframe"),
"Attributions");
}

View File

@@ -1,7 +1,7 @@
erpnext.updates = [ erpnext.updates = [
["21st December 2012", [ ["21st December 2012", [
"Manufacturing: For Material Transfer against Production Order, \ "Manufacturing: For Material Transfer against Production Order, \
fetch quantity pending to be transferred for each item." fetch quantity pending to be transferred for each item.",
"Desktop: New Icons and now sortable by dragging." "Desktop: New Icons and now sortable by dragging."
]], ]],
["20th December 2012", [ ["20th December 2012", [

View File

@@ -99,7 +99,7 @@ class DocType:
yr_start_date, yr_end_date = self.get_fy_start_end_dates() yr_start_date, yr_end_date = self.get_fy_start_end_dates()
date_list = self.get_weekly_off_date_list(yr_start_date, yr_end_date) date_list = self.get_weekly_off_date_list(yr_start_date, yr_end_date)
for d in date_list: for d in date_list:
ch = addchild(self.doc, 'holiday_list_details', 'Holiday', 1, self.doclist) ch = addchild(self.doc, 'holiday_list_details', 'Holiday', self.doclist)
ch.description = self.doc.weekly_off ch.description = self.doc.weekly_off
ch.holiday_date = d ch.holiday_date = d

View File

@@ -70,7 +70,7 @@ class DocType:
def make_table(self, doct_name, tab_fname, tab_name): def make_table(self, doct_name, tab_fname, tab_name):
list1 = sql("select name from `tab%s` where docstatus != 2" % doct_name) list1 = sql("select name from `tab%s` where docstatus != 2" % doct_name)
for li in list1: for li in list1:
child = addchild(self.doc, tab_fname, tab_name, 1, self.doclist) child = addchild(self.doc, tab_fname, tab_name, self.doclist)
if(tab_fname == 'earning_details'): if(tab_fname == 'earning_details'):
child.e_type = cstr(li[0]) child.e_type = cstr(li[0])
child.modified_value = 0 child.modified_value = 0

View File

@@ -357,7 +357,8 @@ class DocType:
"Add items to Flat BOM table" "Add items to Flat BOM table"
self.doclist = self.doc.clear_table(self.doclist, 'flat_bom_details', 1) self.doclist = self.doc.clear_table(self.doclist, 'flat_bom_details', 1)
for d in self.cur_exploded_items: for d in self.cur_exploded_items:
ch = addchild(self.doc, 'flat_bom_details', 'BOM Explosion Item', 1, self.doclist) ch = addchild(self.doc, 'flat_bom_details', 'BOM Explosion Item',
self.doclist)
for i in d.keys(): for i in d.keys():
ch.fields[i] = d[i] ch.fields[i] = d[i]
ch.docstatus = self.doc.docstatus ch.docstatus = self.doc.docstatus

View File

@@ -101,7 +101,7 @@ class DocType:
for r in open_so: for r in open_so:
if cstr(r['name']) not in so_list: if cstr(r['name']) not in so_list:
pp_so = addchild(self.doc, 'pp_so_details', pp_so = addchild(self.doc, 'pp_so_details',
'Production Plan Sales Order', 1, self.doclist) 'Production Plan Sales Order', self.doclist)
pp_so.sales_order = r['name'] pp_so.sales_order = r['name']
pp_so.sales_order_date = cstr(r['transaction_date']) pp_so.sales_order_date = cstr(r['transaction_date'])
pp_so.customer = cstr(r['customer']) pp_so.customer = cstr(r['customer'])
@@ -150,7 +150,7 @@ class DocType:
for p in items: for p in items:
item_details = sql("""select description, stock_uom, default_bom item_details = sql("""select description, stock_uom, default_bom
from tabItem where name=%s""", p['item_code']) from tabItem where name=%s""", p['item_code'])
pi = addchild(self.doc, 'pp_details', 'Production Plan Item', 1, self.doclist) pi = addchild(self.doc, 'pp_details', 'Production Plan Item', self.doclist)
pi.sales_order = p['parent'] pi.sales_order = p['parent']
pi.item_code = p['item_code'] pi.item_code = p['item_code']
pi.description = item_details and item_details[0][0] or '' pi.description = item_details and item_details[0][0] or ''

View File

@@ -7,7 +7,7 @@ def execute():
webnotes.conn.sql("delete from `tabDocPerm` where role = 'All' and permlevel = 0 and parent in ('Appraisal', 'Ticket', 'Project')") webnotes.conn.sql("delete from `tabDocPerm` where role = 'All' and permlevel = 0 and parent in ('Appraisal', 'Ticket', 'Project')")
appr = get_obj('DocType', 'Appraisal', with_children=1) appr = get_obj('DocType', 'Appraisal', with_children=1)
ch = addchild(appr.doc, 'permissions', 'DocPerm', 0) ch = addchild(appr.doc, 'permissions', 'DocPerm')
ch.permlevel = 0 ch.permlevel = 0
ch.role = 'Employee' ch.role = 'Employee'
ch.read = 1 ch.read = 1

View File

@@ -11,7 +11,7 @@ def execute():
addr = get_obj('DocType', 'Address', with_children=1) addr = get_obj('DocType', 'Address', with_children=1)
for d in role1+role2: for d in role1+role2:
ch = addchild(addr.doc, 'permissions', 'DocPerm', 0) ch = addchild(addr.doc, 'permissions', 'DocPerm')
ch.role = d ch.role = d
ch.read = 1 ch.read = 1
ch.write = 1 ch.write = 1

View File

@@ -24,8 +24,6 @@ from webnotes import msgprint
sql = webnotes.conn.sql sql = webnotes.conn.sql
class DocType: class DocType:
def __init__(self,doc,doclist=[]): def __init__(self,doc,doclist=[]):
self.doc = doc self.doc = doc
@@ -37,7 +35,6 @@ class DocType:
ret = {'customer': cust and cust[0][0] or '', 'customer_name': cust and cust[0][1] or ''} ret = {'customer': cust and cust[0][0] or '', 'customer_name': cust and cust[0][1] or ''}
return ret return ret
# TODO: Remove these? as the field customer doesn't exists
def get_customer_details(self): def get_customer_details(self):
cust = sql("select customer_name from `tabCustomer` where name=%s", self.doc.customer) cust = sql("select customer_name from `tabCustomer` where name=%s", self.doc.customer)
if cust: if cust:

View File

@@ -2,27 +2,18 @@
{ {
"owner": "Administrator", "owner": "Administrator",
"docstatus": 0, "docstatus": 0,
"creation": "2012-09-18 11:05:48", "creation": "2012-10-29 14:30:00",
"modified_by": "Administrator", "modified_by": "Administrator",
"modified": "2012-10-29 14:24:55" "modified": "2012-12-24 10:46:06"
}, },
{ {
"section_style": "Tray",
"allow_attach": 1,
"tag_fields": "status",
"module": "Projects",
"server_code_error": " ",
"allow_trash": 1,
"doctype": "DocType",
"document_type": "Master",
"subject": "%(subject)s",
"autoname": "TASK.#####", "autoname": "TASK.#####",
"name": "__common__", "allow_attach": 1,
"colour": "White:FFF", "doctype": "DocType",
"_last_update": "1324880734", "module": "Projects",
"show_in_menu": 0,
"max_attachments": 5, "max_attachments": 5,
"version": 1 "document_type": "Master",
"name": "__common__"
}, },
{ {
"name": "__common__", "name": "__common__",
@@ -74,13 +65,13 @@
"reqd": 0 "reqd": 0
}, },
{ {
"search_index": 1, "oldfieldtype": "Date",
"doctype": "DocField", "doctype": "DocField",
"label": "Expected End Date", "label": "Expected End Date",
"oldfieldname": "exp_end_date", "oldfieldname": "exp_end_date",
"fieldname": "exp_end_date", "fieldname": "exp_end_date",
"fieldtype": "Date", "fieldtype": "Date",
"oldfieldtype": "Date", "search_index": 1,
"reqd": 0, "reqd": 0,
"in_filter": 1 "in_filter": 1
}, },
@@ -93,11 +84,9 @@
}, },
{ {
"oldfieldtype": "Link", "oldfieldtype": "Link",
"colour": "White:FFF",
"doctype": "DocField", "doctype": "DocField",
"label": "Project", "label": "Project",
"oldfieldname": "project", "oldfieldname": "project",
"trigger": "Client",
"fieldname": "project", "fieldname": "project",
"fieldtype": "Link", "fieldtype": "Link",
"options": "Project" "options": "Project"
@@ -105,23 +94,21 @@
{ {
"no_copy": 1, "no_copy": 1,
"oldfieldtype": "Select", "oldfieldtype": "Select",
"colour": "White:FFF",
"doctype": "DocField", "doctype": "DocField",
"label": "Status", "label": "Status",
"oldfieldname": "status", "oldfieldname": "status",
"trigger": "Client",
"fieldname": "status", "fieldname": "status",
"fieldtype": "Select", "fieldtype": "Select",
"options": "Open\nWorking\nPending Review\nClosed\nCancelled" "options": "Open\nWorking\nPending Review\nClosed\nCancelled"
}, },
{ {
"search_index": 1, "oldfieldtype": "Select",
"doctype": "DocField", "doctype": "DocField",
"label": "Priority", "label": "Priority",
"oldfieldname": "priority", "oldfieldname": "priority",
"fieldname": "priority", "fieldname": "priority",
"fieldtype": "Select", "fieldtype": "Select",
"oldfieldtype": "Select", "search_index": 1,
"reqd": 0, "reqd": 0,
"options": "Low\nMedium\nHigh\nUrgent", "options": "Low\nMedium\nHigh\nUrgent",
"in_filter": 1 "in_filter": 1
@@ -217,13 +204,12 @@
}, },
{ {
"doctype": "DocField", "doctype": "DocField",
"label": "More Details",
"fieldname": "more_details", "fieldname": "more_details",
"fieldtype": "Section Break", "fieldtype": "Section Break"
"label": "More Details"
}, },
{ {
"oldfieldtype": "Date", "oldfieldtype": "Date",
"colour": "White:FFF",
"doctype": "DocField", "doctype": "DocField",
"label": "Review Date", "label": "Review Date",
"oldfieldname": "review_date", "oldfieldname": "review_date",
@@ -234,7 +220,6 @@
}, },
{ {
"oldfieldtype": "Date", "oldfieldtype": "Date",
"colour": "White:FFF",
"doctype": "DocField", "doctype": "DocField",
"label": "Closing Date", "label": "Closing Date",
"oldfieldname": "closing_date", "oldfieldname": "closing_date",
@@ -260,7 +245,7 @@
"permlevel": 0 "permlevel": 0
}, },
{ {
"permlevel": 1, "doctype": "DocPerm",
"doctype": "DocPerm" "permlevel": 1
} }
] ]

View File

@@ -60,7 +60,7 @@ erpnext.toolbar.add_modules = function() {
for(var i in modules_list) { for(var i in modules_list) {
var m = modules_list[i] var m = modules_list[i]
if(m!='Setup' && wn.boot.profile.allow_modules.indexOf(m)!=-1) { if(m!='Setup' && wn.boot.profile.allow_modules.indexOf(m)!=-1 && wn.modules[m]) {
args = { args = {
module: m, module: m,
module_page: wn.modules[m].link, module_page: wn.modules[m].link,

View File

@@ -123,7 +123,7 @@ class DocType(TransactionBase):
user_lst.append(chk[0][0]) user_lst.append(chk[0][0])
for d in user_lst: for d in user_lst:
ch = addchild(ev, 'event_individuals', 'Event User', 0) ch = addchild(ev, 'event_individuals', 'Event User')
ch.person = d ch.person = d
ch.save(1) ch.save(1)

View File

@@ -19,7 +19,7 @@ import webnotes
from webnotes.utils import cstr, load_json from webnotes.utils import cstr, load_json
from webnotes.model import db_exists from webnotes.model import db_exists
from webnotes.model.doc import Document, addchild from webnotes.model.doc import Document
from webnotes.model.wrapper import getlist, copy_doclist from webnotes.model.wrapper import getlist, copy_doclist
from webnotes.model.code import get_obj from webnotes.model.code import get_obj
from webnotes import msgprint from webnotes import msgprint

View File

@@ -75,7 +75,7 @@ class DocType(TransactionBase):
obj.doclist = obj.doc.clear_table(obj.doclist,'sales_team') obj.doclist = obj.doc.clear_table(obj.doclist,'sales_team')
idx = 0 idx = 0
for d in webnotes.conn.sql("select sales_person, allocated_percentage, allocated_amount, incentives from `tabSales Team` where parent = '%s'" % obj.doc.customer): for d in webnotes.conn.sql("select sales_person, allocated_percentage, allocated_amount, incentives from `tabSales Team` where parent = '%s'" % obj.doc.customer):
ch = addchild(obj.doc, 'sales_team', 'Sales Team', 1, obj.doclist) ch = addchild(obj.doc, 'sales_team', 'Sales Team', obj.doclist)
ch.sales_person = d and cstr(d[0]) or '' ch.sales_person = d and cstr(d[0]) or ''
ch.allocated_percentage = d and flt(d[1]) or 0 ch.allocated_percentage = d and flt(d[1]) or 0
ch.allocated_amount = d and flt(d[2]) or 0 ch.allocated_amount = d and flt(d[2]) or 0
@@ -265,7 +265,7 @@ class DocType(TransactionBase):
for field in default_fields: for field in default_fields:
if field in other: del other[field] if field in other: del other[field]
d = addchild(obj.doc, 'other_charges', 'Sales Taxes and Charges', 1, d = addchild(obj.doc, 'other_charges', 'Sales Taxes and Charges',
obj.doclist) obj.doclist)
d.fields.update(other) d.fields.update(other)
d.rate = flt(d.rate) d.rate = flt(d.rate)
@@ -481,7 +481,8 @@ class DocType(TransactionBase):
break break
if not exists: if not exists:
pi = addchild(obj.doc, 'packing_details', 'Delivery Note Packing Item', 1, obj.doclist) pi = addchild(obj.doc, 'packing_details', 'Delivery Note Packing Item',
obj.doclist)
pi.parent_item = line.item_code pi.parent_item = line.item_code
pi.item_code = packing_item_code pi.item_code = packing_item_code

View File

@@ -239,13 +239,13 @@ class DocType:
def add_roles(self, pr): def add_roles(self, pr):
roles_list = ['Accounts Manager', 'Accounts User', 'Blogger', 'HR Manager', 'HR User', 'Maintenance User', 'Maintenance Manager', 'Material Manager', 'Material User', 'Material Master Manager', 'Manufacturing Manager', 'Manufacturing User', 'Projects User', 'Purchase Manager', 'Purchase User', 'Purchase Master Manager', 'Quality Manager', 'Sales Manager', 'Sales User', 'Sales Master Manager', 'Support Manager', 'Support Team', 'System Manager', 'Website Manager'] roles_list = ['Accounts Manager', 'Accounts User', 'Blogger', 'HR Manager', 'HR User', 'Maintenance User', 'Maintenance Manager', 'Material Manager', 'Material User', 'Material Master Manager', 'Manufacturing Manager', 'Manufacturing User', 'Projects User', 'Purchase Manager', 'Purchase User', 'Purchase Master Manager', 'Quality Manager', 'Sales Manager', 'Sales User', 'Sales Master Manager', 'Support Manager', 'Support Team', 'System Manager', 'Website Manager']
for r in roles_list: for r in roles_list:
d = addchild(pr, 'userroles', 'UserRole', 1) d = addchild(pr, 'userroles', 'UserRole')
d.role = r d.role = r
d.save(1) d.save(1)
# Add roles to Administrator profile # Add roles to Administrator profile
pr = Document('Profile','Administrator') pr = Document('Profile','Administrator')
for r in roles_list: for r in roles_list:
d = addchild(pr,'userroles', 'UserRole', 1) d = addchild(pr,'userroles', 'UserRole')
d.role = r d.role = r
d.save(1) d.save(1)

View File

@@ -350,7 +350,7 @@ class DocType:
reaches re-order level when %s %s was created""" % (doc_type,doc_name) reaches re-order level when %s %s was created""" % (doc_type,doc_name)
indent.save(1) indent.save(1)
indent_obj = get_obj('Purchase Request',indent.name,with_children=1) indent_obj = get_obj('Purchase Request',indent.name,with_children=1)
indent_details_child = addchild(indent_obj.doc,'indent_details','Purchase Request Item',0) indent_details_child = addchild(indent_obj.doc,'indent_details','Purchase Request Item')
indent_details_child.item_code = self.doc.item_code indent_details_child.item_code = self.doc.item_code
indent_details_child.uom = self.doc.stock_uom indent_details_child.uom = self.doc.stock_uom
indent_details_child.warehouse = self.doc.warehouse indent_details_child.warehouse = self.doc.warehouse

View File

@@ -70,7 +70,8 @@ class DocType:
raise Exception raise Exception
if not cstr(self.doc.stock_uom) in check_list : if not cstr(self.doc.stock_uom) in check_list :
child = addchild( self.doc, 'uom_conversion_details', 'UOM Conversion Detail', 1, self.doclist) child = addchild( self.doc, 'uom_conversion_details',
'UOM Conversion Detail', self.doclist)
child.uom = self.doc.stock_uom child.uom = self.doc.stock_uom
child.conversion_factor = 1 child.conversion_factor = 1
child.save() child.save()

View File

@@ -51,7 +51,8 @@ class DocType:
msgprint("Please enter date of shorter duration as there are too many purchase receipt, hence it cannot be loaded.", raise_exception=1) msgprint("Please enter date of shorter duration as there are too many purchase receipt, hence it cannot be loaded.", raise_exception=1)
for i in pr: for i in pr:
ch = addchild(self.doc, 'lc_pr_details', 'Landed Cost Purchase Receipt', 1, self.doclist) ch = addchild(self.doc, 'lc_pr_details', 'Landed Cost Purchase Receipt',
self.doclist)
ch.purchase_receipt = i and i['name'] or '' ch.purchase_receipt = i and i['name'] or ''
ch.save() ch.save()
@@ -62,7 +63,8 @@ class DocType:
idx = 0 idx = 0
landed_cost = sql("select account_head, description from `tabLanded Cost Master Detail` where parent=%s", (self.doc.landed_cost), as_dict = 1) landed_cost = sql("select account_head, description from `tabLanded Cost Master Detail` where parent=%s", (self.doc.landed_cost), as_dict = 1)
for cost in landed_cost: for cost in landed_cost:
lct = addchild(self.doc, 'landed_cost_details', 'Landed Cost Item', 1, self.doclist) lct = addchild(self.doc, 'landed_cost_details', 'Landed Cost Item',
self.doclist)
lct.account_head = cost['account_head'] lct.account_head = cost['account_head']
lct.description = cost['description'] lct.description = cost['description']
@@ -100,7 +102,7 @@ class DocType:
pr_oc_row = sql("select name from `tabPurchase Taxes and Charges` where parent = %s and category = 'Valuation' and add_deduct_tax = 'Add' and charge_type = 'Actual' and account_head = %s",(pr, lc.account_head)) pr_oc_row = sql("select name from `tabPurchase Taxes and Charges` where parent = %s and category = 'Valuation' and add_deduct_tax = 'Add' and charge_type = 'Actual' and account_head = %s",(pr, lc.account_head))
if not pr_oc_row: # add if not exists if not pr_oc_row: # add if not exists
ch = addchild(pr_obj.doc, 'purchase_tax_details', 'Purchase Taxes and Charges', 1) ch = addchild(pr_obj.doc, 'purchase_tax_details', 'Purchase Taxes and Charges')
ch.category = 'Valuation' ch.category = 'Valuation'
ch.add_deduct_tax = 'Add' ch.add_deduct_tax = 'Add'
ch.charge_type = 'Actual' ch.charge_type = 'Actual'

View File

@@ -390,7 +390,7 @@ class DocType(TransactionBase):
if i and not sql("select name from `tabPurchase Receipt Item Supplied` where reference_name = '%s' and bom_detail_no = '%s' and parent = '%s' " %(d.name, i[6], self.doc.name)): if i and not sql("select name from `tabPurchase Receipt Item Supplied` where reference_name = '%s' and bom_detail_no = '%s' and parent = '%s' " %(d.name, i[6], self.doc.name)):
rm_child = addchild(self.doc, 'pr_raw_material_details', 'Purchase Receipt Item Supplied', 1, self.doclist) rm_child = addchild(self.doc, 'pr_raw_material_details', 'Purchase Receipt Item Supplied', self.doclist)
rm_child.reference_name = d.name rm_child.reference_name = d.name
rm_child.bom_detail_no = i and i[6] or '' rm_child.bom_detail_no = i and i[6] or ''

View File

@@ -52,7 +52,8 @@ class DocType :
def create_item_table(self, det): def create_item_table(self, det):
self.doclist = self.doc.clear_table(self.doclist, 'return_details', 1) self.doclist = self.doc.clear_table(self.doclist, 'return_details', 1)
for i in det: for i in det:
ch = addchild(self.doc, 'return_details', 'Sales and Purchase Return Item', 1, self.doclist) ch = addchild(self.doc, 'return_details', 'Sales and Purchase Return Item',
self.doclist)
ch.detail_name = i and i[0] or '' ch.detail_name = i and i[0] or ''
ch.item_code = i and i[1] or '' ch.item_code = i and i[1] or ''
ch.description = i and i[2] or '' ch.description = i and i[2] or ''

View File

@@ -160,6 +160,7 @@ fld.get_query = function(doc, cdt, cdn) {
return 'SELECT tabItem.name, tabItem.description, tabBin.actual_qty ' return 'SELECT tabItem.name, tabItem.description, tabBin.actual_qty '
+ 'FROM tabItem, tabBin ' + 'FROM tabItem, tabBin '
+ 'WHERE tabItem.name = tabBin.item_code ' + 'WHERE tabItem.name = tabBin.item_code '
+ 'AND tabItem.is_stock_item = "Yes"'
+ 'AND ifnull(`tabBin`.`actual_qty`,0) > 0 ' + 'AND ifnull(`tabBin`.`actual_qty`,0) > 0 '
+ 'AND tabBin.warehouse="'+ d.s_warehouse +'" ' + 'AND tabBin.warehouse="'+ d.s_warehouse +'" '
+ 'AND tabItem.docstatus < 2 ' + 'AND tabItem.docstatus < 2 '
@@ -171,6 +172,7 @@ fld.get_query = function(doc, cdt, cdn) {
return 'SELECT tabItem.name, tabItem.description ' return 'SELECT tabItem.name, tabItem.description '
+ 'FROM tabItem ' + 'FROM tabItem '
+ 'WHERE tabItem.docstatus < 2 ' + 'WHERE tabItem.docstatus < 2 '
+ 'AND tabItem.is_stock_item = "Yes"'
+ 'AND (ifnull(`tabItem`.`end_of_life`,"") = "" OR `tabItem`.`end_of_life` > NOW() OR `tabItem`.`end_of_life`="0000-00-00") ' + 'AND (ifnull(`tabItem`.`end_of_life`,"") = "" OR `tabItem`.`end_of_life` > NOW() OR `tabItem`.`end_of_life`="0000-00-00") '
+ 'AND tabItem.%(key)s LIKE "%s" ' + 'AND tabItem.%(key)s LIKE "%s" '
+ 'ORDER BY tabItem.name ASC ' + 'ORDER BY tabItem.name ASC '

View File

@@ -36,7 +36,6 @@ class DocType(TransactionBase):
def validate(self): def validate(self):
self.validate_serial_nos() self.validate_serial_nos()
pro_obj = self.doc.production_order and \ pro_obj = self.doc.production_order and \
get_obj('Production Order', self.doc.production_order) or None get_obj('Production Order', self.doc.production_order) or None
@@ -467,7 +466,8 @@ class DocType(TransactionBase):
def add_to_stock_entry_detail(self, source_wh, target_wh, item_dict, bom_no=None): def add_to_stock_entry_detail(self, source_wh, target_wh, item_dict, bom_no=None):
for d in item_dict: for d in item_dict:
se_child = addchild(self.doc, 'mtn_details', 'Stock Entry Detail', 0, self.doclist) se_child = addchild(self.doc, 'mtn_details', 'Stock Entry Detail',
self.doclist)
se_child.s_warehouse = source_wh se_child.s_warehouse = source_wh
se_child.t_warehouse = target_wh se_child.t_warehouse = target_wh
se_child.item_code = cstr(d) se_child.item_code = cstr(d)

View File

@@ -29,6 +29,14 @@ class DocType:
self.doc = doc self.doc = doc
self.doclist = doclist self.doclist = doclist
def validate(self):
self.validate_mandatory()
self.validate_posting_time()
self.validate_item()
self.actual_amt_check()
self.check_stock_frozen_date()
self.scrub_posting_time()
#check for item quantity available in stock #check for item quantity available in stock
def actual_amt_check(self): def actual_amt_check(self):
if self.doc.batch_no: if self.doc.batch_no:
@@ -53,7 +61,9 @@ class DocType:
msgprint("Warehouse: '%s' does not exist in the system. Please check." % self.doc.fields.get(k), raise_exception = 1) msgprint("Warehouse: '%s' does not exist in the system. Please check." % self.doc.fields.get(k), raise_exception = 1)
def validate_item(self): def validate_item(self):
item_det = sql("select name, has_batch_no, docstatus from tabItem where name = '%s'" % self.doc.item_code) item_det = sql("""select name, has_batch_no, docstatus,
ifnull(is_stock_item, 'No') from tabItem where name=%s""",
self.doc.item_code)
# check item exists # check item exists
if item_det: if item_det:
@@ -61,6 +71,10 @@ class DocType:
else: else:
msgprint("Item: '%s' does not exist in the system. Please check." % self.doc.item_code, raise_exception = 1) msgprint("Item: '%s' does not exist in the system. Please check." % self.doc.item_code, raise_exception = 1)
if item_det[3]!='Yes':
webnotes.msgprint("""Item: "%s" is not a Stock Item.""" % self.doc.item_code,
raise_exception=1)
# check if item is trashed # check if item is trashed
if cint(item_det[2])==2: if cint(item_det[2])==2:
msgprint("Item: '%s' is trashed, cannot make a stock transaction against a trashed item" % self.doc.item_code, raise_exception = 1) msgprint("Item: '%s' is trashed, cannot make a stock transaction against a trashed item" % self.doc.item_code, raise_exception = 1)
@@ -97,11 +111,3 @@ class DocType:
if len(self.doc.posting_time.split(':')) > 2: if len(self.doc.posting_time.split(':')) > 2:
self.doc.posting_time = '00:00' self.doc.posting_time = '00:00'
def validate(self):
self.validate_mandatory()
self.validate_posting_time()
self.validate_item()
self.actual_amt_check()
self.check_stock_frozen_date()
self.scrub_posting_time()

View File

@@ -63,7 +63,8 @@ class DocType(TransactionBase):
s_list =[] s_list =[]
s_list = self.create_schedule_list(d.start_date, d.end_date, d.no_of_visits) s_list = self.create_schedule_list(d.start_date, d.end_date, d.no_of_visits)
for i in range(d.no_of_visits): for i in range(d.no_of_visits):
child = addchild(self.doc,'maintenance_schedule_detail','Maintenance Schedule Detail',1,self.doclist) child = addchild(self.doc, 'maintenance_schedule_detail',
'Maintenance Schedule Detail', self.doclist)
child.item_code = d.item_code child.item_code = d.item_code
child.item_name = d.item_name child.item_name = d.item_name
child.scheduled_date = s_list[i].strftime('%Y-%m-%d') child.scheduled_date = s_list[i].strftime('%Y-%m-%d')

View File

@@ -220,7 +220,7 @@ class TransactionBase:
self.doclist = self.doc.clear_table(self.doclist,'sales_team') self.doclist = self.doc.clear_table(self.doclist,'sales_team')
idx = 0 idx = 0
for d in webnotes.conn.sql("select sales_person, allocated_percentage, allocated_amount, incentives from `tabSales Team` where parent = '%s'" % name): for d in webnotes.conn.sql("select sales_person, allocated_percentage, allocated_amount, incentives from `tabSales Team` where parent = '%s'" % name):
ch = addchild(self.doc, 'sales_team', 'Sales Team', 1, self.doclist) ch = addchild(self.doc, 'sales_team', 'Sales Team', self.doclist)
ch.sales_person = d and cstr(d[0]) or '' ch.sales_person = d and cstr(d[0]) or ''
ch.allocated_percentage = d and flt(d[1]) or 0 ch.allocated_percentage = d and flt(d[1]) or 0
ch.allocated_amount = d and flt(d[2]) or 0 ch.allocated_amount = d and flt(d[2]) or 0

View File

@@ -6,7 +6,9 @@ div#body_div {
padding: 0px; padding: 0px;
min-height: 400px; min-height: 400px;
margin: 40px auto; margin: 40px auto;
box-shadow: 1px 1px 3px 3px #ccc; box-shadow: 1px 1px 3px 3px #bbb;
border-radius: 5px;
overflow: hidden;
} }
.navbar-inner { .navbar-inner {
@@ -23,6 +25,7 @@ p, li {
box-shadow: none; box-shadow: none;
-webkit-box-shadow: none; -webkit-box-shadow: none;
-moz-box-shadow: none; -moz-box-shadow: none;
border-radius: 0px 0px 5px 5px;
} }
.layout-main { .layout-main {

View File

@@ -10,6 +10,7 @@
box-shadow: 1px 1px 3px 3px #ccc; box-shadow: 1px 1px 3px 3px #ccc;
font-size: 12px; font-size: 12px;
min-height: 100px; min-height: 100px;
border-radius: 5px;
} }
#login_wrapper h3 { #login_wrapper h3 {

View File

@@ -210,7 +210,7 @@ def get_outer_env():
from `tabWebsite Product Category` t1, `tabItem Group` t2 from `tabWebsite Product Category` t1, `tabItem Group` t2
where t1.item_group = t2.name where t1.item_group = t2.name
and ifnull(t2.show_in_website,0)=1 order by t1.idx""", as_dict=1) and ifnull(t2.show_in_website,0)=1 order by t1.idx""", as_dict=1)
products_item = filter(lambda d: d.url.split(".")[0]=="products", top_items)[0] products_item = filter(lambda d: d.url and d.url.split(".")[0]=="products", top_items)[0]
products_item.child_items = products products_item.child_items = products
return { return {