aii: patches and default values fetching

This commit is contained in:
Nabin Hait
2013-03-25 18:28:16 +05:30
parent 57916252d9
commit 557d858d89
13 changed files with 166 additions and 95 deletions

View File

@@ -323,7 +323,7 @@ cur_frm.fields_dict['delivery_note_details'].grid.get_field('expense_account').g
}
// cost center
cur_frm.fields_dict["delivery_note_details"].grid.get_field("cost_center").get_query = function(doc) {
cur_frm.fields_dict.delivery_note_details.grid.get_field("cost_center").get_query = function(doc) {
return {
query: "accounts.utils.get_cost_center_list",
filters: { company_name: doc.company}

View File

@@ -85,8 +85,11 @@ class DocType(SellingController):
obj = get_obj('Sales Common')
for doc in self.doclist:
if doc.fields.get('item_code'):
arg = {'item_code':doc.fields.get('item_code'), 'income_account':doc.fields.get('income_account'),
'cost_center': doc.fields.get('cost_center'), 'warehouse': doc.fields.get('warehouse')};
arg = {
'item_code':doc.fields.get('item_code'),
'expense_account':doc.fields.get('expense_account'),
'cost_center': doc.fields.get('cost_center'),
'warehouse': doc.fields.get('warehouse')};
ret = obj.get_item_defaults(arg)
for r in ret:
if not doc.fields.get(r):

View File

@@ -1,8 +1,8 @@
[
{
"creation": "2013-03-07 11:42:59",
"creation": "2013-03-25 11:55:16",
"docstatus": 0,
"modified": "2013-03-22 18:43:10",
"modified": "2013-03-25 15:43:04",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -253,14 +253,15 @@
"no_copy": 1,
"options": "Account",
"print_hide": 1,
"read_only": 0,
"width": "120px"
},
{
"doctype": "DocField",
"fieldname": "purchase_cost_center",
"fieldname": "cost_center",
"fieldtype": "Link",
"hidden": 1,
"label": "Purchase Cost Center",
"label": "Cost Center",
"no_copy": 1,
"options": "Cost Center",
"print_hide": 1,

View File

@@ -27,7 +27,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
if (sys_defaults.auto_inventory_accounting && !this.frm.doc.expense_adjustment_account) {
if (this.frm.doc.purpose == "Sales Return")
account_for = "stock_delivered_but_not_billed";
account_for = "stock_in_hand_account";
else if (this.frm.doc.purpose == "Purchase Return")
account_for = "stock_received_but_not_billed";
else account_for = "stock_adjustment_account";