Merge branch 'responsive' of github.com:webnotes/erpnext into responsive
This commit is contained in:
commit
971f30a12b
@ -44,9 +44,9 @@ var set_operation_no = function(doc) {
|
|||||||
var op = op_table[i].operation_no;
|
var op = op_table[i].operation_no;
|
||||||
if (op && !inList(operations, op)) operations.push(op);
|
if (op && !inList(operations, op)) operations.push(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.fields_dict["bom_materials"].grid.get_field("operation_no")
|
wn.meta.get_docfield("BOM Item", "operation_no",
|
||||||
.df.options = operations.join("\n");
|
cur_frm.docname).options = operations.join("\n");
|
||||||
|
|
||||||
$.each(getchildren("BOM Item", doc.name, "bom_materials"), function(i, v) {
|
$.each(getchildren("BOM Item", doc.name, "bom_materials"), function(i, v) {
|
||||||
if(!inList(operations, cstr(v.operation_no))) v.operation_no = null;
|
if(!inList(operations, cstr(v.operation_no))) v.operation_no = null;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"creation": "2013-01-22 15:11:38",
|
"creation": "2013-01-22 15:11:38",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2013-01-29 17:32:53",
|
"modified": "2013-06-27 11:08:28",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
@ -112,6 +112,7 @@
|
|||||||
"options": "Specify the operations, operating cost and give a unique Operation no to your operations."
|
"options": "Specify the operations, operating cost and give a unique Operation no to your operations."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"depends_on": "with_operations",
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "bom_operations",
|
"fieldname": "bom_operations",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"creation": "2013-02-22 01:27:49",
|
"creation": "2013-02-22 01:27:49",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2013-03-07 07:03:18",
|
"modified": "2013-06-27 11:30:07",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
@ -92,6 +92,7 @@
|
|||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"description": "See \"Rate Of Materials Based On\" in Costing Section",
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "rate",
|
"fieldname": "rate",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
|
@ -49,7 +49,7 @@ def execute():
|
|||||||
for key in custom_map["Timesheet Detail"]:
|
for key in custom_map["Timesheet Detail"]:
|
||||||
tl.doc.fields[key] = tsd.fields.get(key)
|
tl.doc.fields[key] = tsd.fields.get(key)
|
||||||
|
|
||||||
tl.make_obj()
|
tl.make_controller()
|
||||||
tl.controller.set_status()
|
tl.controller.set_status()
|
||||||
tl.controller.calculate_total_hours()
|
tl.controller.calculate_total_hours()
|
||||||
tl.doc.insert()
|
tl.doc.insert()
|
||||||
|
@ -190,33 +190,23 @@ class DocType:
|
|||||||
self.doc.letter_head = header
|
self.doc.letter_head = header
|
||||||
|
|
||||||
def set_default_accounts(self):
|
def set_default_accounts(self):
|
||||||
if not self.doc.receivables_group and webnotes.conn.exists('Account',
|
accounts = {
|
||||||
'Accounts Receivable - ' + self.doc.abbr):
|
"receivables_group": "Accounts Receivable",
|
||||||
webnotes.conn.set(self.doc, 'receivables_group', 'Accounts Receivable - ' +
|
"payables_group": "Accounts Payable",
|
||||||
self.doc.abbr)
|
"stock_received_but_not_billed": "Stock Received But Not Billed",
|
||||||
|
"stock_in_hand_account": "Stock In Hand",
|
||||||
if not self.doc.payables_group and webnotes.conn.exists('Account',
|
"stock_adjustment_account": "Stock Adjustment",
|
||||||
'Accounts Payable - ' + self.doc.abbr):
|
"expenses_included_in_valuation": "Expenses Included In Valuation"
|
||||||
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:
|
if not self.doc.stock_adjustment_cost_center:
|
||||||
webnotes.conn.set(self.doc, "stock_adjustment_cost_center", self.doc.cost_center)
|
webnotes.conn.set(self.doc, "stock_adjustment_cost_center", self.doc.cost_center)
|
||||||
|
|
||||||
# Create default cost center
|
# Create default cost center
|
||||||
# ---------------------------------------------------
|
# ---------------------------------------------------
|
||||||
def create_default_cost_center(self):
|
def create_default_cost_center(self):
|
||||||
@ -249,8 +239,7 @@ class DocType:
|
|||||||
where company=%s and docstatus<2 limit 1""", self.doc.name):
|
where company=%s and docstatus<2 limit 1""", self.doc.name):
|
||||||
self.create_default_accounts()
|
self.create_default_accounts()
|
||||||
|
|
||||||
if not webnotes.conn.sql("""select name from `tabCost Center`
|
if not self.doc.cost_center:
|
||||||
where cost_center_name = 'All Units' and company_name = %s""", self.doc.name):
|
|
||||||
self.create_default_cost_center()
|
self.create_default_cost_center()
|
||||||
|
|
||||||
self.set_default_accounts()
|
self.set_default_accounts()
|
||||||
|
@ -119,4 +119,13 @@ class DocType(DocListController):
|
|||||||
def scrub_posting_time(self):
|
def scrub_posting_time(self):
|
||||||
if not self.doc.posting_time or self.doc.posting_time == '00:0':
|
if not self.doc.posting_time or self.doc.posting_time == '00:0':
|
||||||
self.doc.posting_time = '00:00'
|
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()
|
@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"creation": "2013-01-29 19:25:42",
|
"creation": "2013-01-29 19:25:42",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2013-03-25 16:04:59",
|
"modified": "2013-06-28 12:39:07",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
|
@ -45,9 +45,12 @@ class DocType(StockController):
|
|||||||
return
|
return
|
||||||
|
|
||||||
data = json.loads(self.doc.reconciliation_json)
|
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:
|
if self.head_row not in data:
|
||||||
msgprint(_("""Hey! You seem to be using the wrong template. \
|
msgprint(_("""Wrong Template: Unable to find head row."""),
|
||||||
Click on 'Download Template' button to get the correct template."""),
|
|
||||||
raise_exception=1)
|
raise_exception=1)
|
||||||
|
|
||||||
# remove the help part and save the json
|
# remove the help part and save the json
|
||||||
|
@ -42,7 +42,7 @@ class DocType:
|
|||||||
bin_wrapper.ignore_permissions = 1
|
bin_wrapper.ignore_permissions = 1
|
||||||
bin_wrapper.insert()
|
bin_wrapper.insert()
|
||||||
|
|
||||||
bin_obj = bin_wrapper.make_obj()
|
bin_obj = bin_wrapper.make_controller()
|
||||||
else:
|
else:
|
||||||
bin_obj = get_obj('Bin', bin)
|
bin_obj = get_obj('Bin', bin)
|
||||||
return bin_obj
|
return bin_obj
|
||||||
|
Loading…
x
Reference in New Issue
Block a user