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

This commit is contained in:
Rushabh Mehta
2012-12-27 16:50:55 +05:30
19 changed files with 49 additions and 286 deletions

View File

@@ -78,13 +78,6 @@ class DocType(TransactionBase):
def get_tc_details(self):
return get_obj('Sales Common').get_tc_details(self)
def pull_project_customer(self):
res = sql("select customer from `tabProject` where name = '%s'" % self.doc.project_name)
if res and res[0][0]:
get_obj('DocType Mapper', 'Project-Delivery Note').dt_map('Project', 'Delivery Note', self.doc.project_name, self.doc, self.doclist, "[['Project', 'Delivery Note']]")
def get_item_details(self, args=None):
import json
args = args and json.loads(args) or {}

View File

@@ -284,15 +284,17 @@ class DocType(TransactionBase):
# on submit
def on_submit(self):
purchase_controller = webnotes.get_obj("Purchase Common")
purchase_controller.is_item_table_empty(self)
# Check for Approving Authority
get_obj('Authorization Control').validate_approving_authority(self.doc.doctype, self.doc.company, self.doc.grand_total)
# Set status as Submitted
webnotes.conn.set(self.doc,'status', 'Submitted')
pc_obj = get_obj('Purchase Common')
# Update Previous Doc i.e. update pending_qty and Status accordingly
pc_obj.update_prevdoc_detail(self, is_submit = 1)
purchase_controller.update_prevdoc_detail(self, is_submit = 1)
# Update Serial Record
get_obj('Stock Ledger').update_serial_record(self, 'purchase_receipt_details', is_submit = 1, is_incoming = 1)
@@ -301,7 +303,7 @@ class DocType(TransactionBase):
self.update_stock(is_submit = 1)
# Update last purchase rate
pc_obj.update_last_purchase_rate(self, 1)
purchase_controller.update_last_purchase_rate(self, 1)