Merge branch 'responsive' of github.com:webnotes/erpnext into responsive

This commit is contained in:
Anand Doshi 2013-06-28 19:19:04 +05:30
commit 971f30a12b
9 changed files with 40 additions and 37 deletions

View File

@ -45,8 +45,8 @@ var set_operation_no = function(doc) {
if (op && !inList(operations, op)) operations.push(op);
}
cur_frm.fields_dict["bom_materials"].grid.get_field("operation_no")
.df.options = operations.join("\n");
wn.meta.get_docfield("BOM Item", "operation_no",
cur_frm.docname).options = operations.join("\n");
$.each(getchildren("BOM Item", doc.name, "bom_materials"), function(i, v) {
if(!inList(operations, cstr(v.operation_no))) v.operation_no = null;

View File

@ -2,7 +2,7 @@
{
"creation": "2013-01-22 15:11:38",
"docstatus": 0,
"modified": "2013-01-29 17:32:53",
"modified": "2013-06-27 11:08:28",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -112,6 +112,7 @@
"options": "Specify the operations, operating cost and give a unique Operation no to your operations."
},
{
"depends_on": "with_operations",
"doctype": "DocField",
"fieldname": "bom_operations",
"fieldtype": "Table",

View File

@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:49",
"docstatus": 0,
"modified": "2013-03-07 07:03:18",
"modified": "2013-06-27 11:30:07",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -92,6 +92,7 @@
"reqd": 1
},
{
"description": "See \"Rate Of Materials Based On\" in Costing Section",
"doctype": "DocField",
"fieldname": "rate",
"fieldtype": "Float",

View File

@ -49,7 +49,7 @@ def execute():
for key in custom_map["Timesheet Detail"]:
tl.doc.fields[key] = tsd.fields.get(key)
tl.make_obj()
tl.make_controller()
tl.controller.set_status()
tl.controller.calculate_total_hours()
tl.doc.insert()

View File

@ -190,29 +190,19 @@ class DocType:
self.doc.letter_head = header
def set_default_accounts(self):
if not self.doc.receivables_group and webnotes.conn.exists('Account',
'Accounts Receivable - ' + self.doc.abbr):
webnotes.conn.set(self.doc, 'receivables_group', 'Accounts Receivable - ' +
self.doc.abbr)
accounts = {
"receivables_group": "Accounts Receivable",
"payables_group": "Accounts Payable",
"stock_received_but_not_billed": "Stock Received But Not Billed",
"stock_in_hand_account": "Stock In Hand",
"stock_adjustment_account": "Stock Adjustment",
"expenses_included_in_valuation": "Expenses Included In Valuation"
}
if not self.doc.payables_group and webnotes.conn.exists('Account',
'Accounts Payable - ' + self.doc.abbr):
webnotes.conn.set(self.doc, 'payables_group', 'Accounts Payable - ' + self.doc.abbr)
if not self.doc.stock_received_but_not_billed and webnotes.conn.exists("Account",
"Stock Received But Not Billed - " + self.doc.abbr):
webnotes.conn.set(self.doc, "stock_received_but_not_billed",
"Stock Received But Not Billed - " + self.doc.abbr)
if not self.doc.stock_adjustment_account and webnotes.conn.exists("Account",
"Stock Adjustment - " + self.doc.abbr):
webnotes.conn.set(self.doc, "stock_adjustment_account", "Stock Adjustment - " +
self.doc.abbr)
if not self.doc.expenses_included_in_valuation and webnotes.conn.exists("Account",
"Expenses Included In Valuation - " + self.doc.abbr):
webnotes.conn.set(self.doc, "expenses_included_in_valuation",
"Expenses Included In Valuation - " + self.doc.abbr)
for a in accounts:
account_name = accounts[a] + " - " + self.doc.abbr
if not self.doc.fields[a] and webnotes.conn.exists("Account", account_name):
webnotes.conn.set(self.doc, account_name)
if not self.doc.stock_adjustment_cost_center:
webnotes.conn.set(self.doc, "stock_adjustment_cost_center", self.doc.cost_center)
@ -249,8 +239,7 @@ class DocType:
where company=%s and docstatus<2 limit 1""", self.doc.name):
self.create_default_accounts()
if not webnotes.conn.sql("""select name from `tabCost Center`
where cost_center_name = 'All Units' and company_name = %s""", self.doc.name):
if not self.doc.cost_center:
self.create_default_cost_center()
self.set_default_accounts()

View File

@ -120,3 +120,12 @@ class DocType(DocListController):
if not self.doc.posting_time or self.doc.posting_time == '00:0':
self.doc.posting_time = '00:00'
def on_doctype_update(self):
webnotes.msgprint(webnotes.conn.sql("""show index from `tabStock Ledger Entry`
where Key_name="posting_sort_index" """))
if not webnotes.conn.sql("""show index from `tabStock Ledger Entry`
where Key_name="posting_sort_index" """):
webnotes.conn.commit()
webnotes.conn.sql("""alter table `tabStock Ledger Entry`
add index posting_sort_index(posting_date, posting_time, name)""")
webnotes.conn.begin()

View File

@ -2,7 +2,7 @@
{
"creation": "2013-01-29 19:25:42",
"docstatus": 0,
"modified": "2013-03-25 16:04:59",
"modified": "2013-06-28 12:39:07",
"modified_by": "Administrator",
"owner": "Administrator"
},

View File

@ -45,9 +45,12 @@ class DocType(StockController):
return
data = json.loads(self.doc.reconciliation_json)
# strip out extra columns (if any)
data = [row[:4] for row in data]
if self.head_row not in data:
msgprint(_("""Hey! You seem to be using the wrong template. \
Click on 'Download Template' button to get the correct template."""),
msgprint(_("""Wrong Template: Unable to find head row."""),
raise_exception=1)
# remove the help part and save the json

View File

@ -42,7 +42,7 @@ class DocType:
bin_wrapper.ignore_permissions = 1
bin_wrapper.insert()
bin_obj = bin_wrapper.make_obj()
bin_obj = bin_wrapper.make_controller()
else:
bin_obj = get_obj('Bin', bin)
return bin_obj