[fix] update future gl entries for stock

This commit is contained in:
Nabin Hait
2013-11-14 18:40:08 +05:30
parent 155232e04e
commit e83069cb32
9 changed files with 112 additions and 39 deletions

View File

@@ -294,11 +294,10 @@ class DocType(BuyingController):
def get_rate(self,arg):
return get_obj('Purchase Common').get_rate(arg,self)
def get_gl_entries_for_stock(self, warehouse_account=None):
def get_gl_entries(self, warehouse_account=None):
against_stock_account = self.get_company_default("stock_received_but_not_billed")
gl_entries = super(DocType, self).get_gl_entries_for_stock(warehouse_account,
against_stock_account)
gl_entries = super(DocType, self).get_gl_entries(warehouse_account, against_stock_account)
return gl_entries

View File

@@ -478,7 +478,7 @@ class DocType(StockController):
self.doc.from_warehouse = ""
item = webnotes.conn.sql("""select name, item_name, description,
uom, purchase_account, cost_center from `tabItem`
stock_uom, purchase_account, cost_center from `tabItem`
where name=(select item from tabBOM where name=%s)""",
self.doc.bom_no, as_dict=1)
self.add_to_stock_entry_detail({
@@ -486,7 +486,7 @@ class DocType(StockController):
"qty": self.doc.fg_completed_qty,
"item_name": item[0].item_name,
"description": item[0]["description"],
"stock_uom": item[0]["uom"],
"stock_uom": item[0]["stock_uom"],
"from_warehouse": "",
"expense_account": item[0].purchase_account,
"cost_center": item[0].cost_center,

View File

@@ -275,11 +275,11 @@ class DocType(StockController):
"posting_time": self.doc.posting_time
})
def get_gl_entries_for_stock(self, warehouse_account=None):
def get_gl_entries(self, warehouse_account=None):
if not self.doc.cost_center:
msgprint(_("Please enter Cost Center"), raise_exception=1)
return super(DocType, self).get_gl_entries_for_stock(warehouse_account,
return super(DocType, self).get_gl_entries(warehouse_account,
self.doc.expense_account, self.doc.cost_center)

View File

@@ -23,5 +23,10 @@ test_records = [
"doctype": "Warehouse User",
"parentfield": "warehouse_users",
"user": "test2@example.com"
}]
}],
[{
"doctype": "Warehouse",
"warehouse_name": "_Test Warehouse No Account",
"company": "_Test Company",
}],
]