[minor] merge conflict fixed

This commit is contained in:
Nabin Hait
2013-11-21 12:28:50 +05:30
25 changed files with 225 additions and 226 deletions

View File

@@ -23,8 +23,8 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
cur_frm.dashboard.add_progress(cint(doc.per_billed) + wn._("% Billed"),
doc.per_billed);
cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms);
cur_frm.appframe.add_button(wn._('Send SMS'), cur_frm.cscript['Send SMS'], "icon-mobile-phone");
if(flt(doc.per_received, 2) < 100)
cur_frm.add_custom_button(wn._('Make Purchase Receipt'), this.make_purchase_receipt);
if(flt(doc.per_billed, 2) < 100)

View File

@@ -148,29 +148,21 @@ class DocType(TransactionBase):
self.delete_supplier_contact()
self.delete_supplier_account()
def on_rename(self, new, old, merge=False):
def after_rename(self, old, new, merge=False):
#update supplier_name if not naming series
if webnotes.defaults.get_global_default('supp_master_name') == 'Supplier Name':
update_fields = [
('Supplier', 'name'),
('Address', 'supplier'),
('Contact', 'supplier'),
('Purchase Invoice', 'supplier'),
('Purchase Order', 'supplier'),
('Purchase Receipt', 'supplier'),
('Serial No', 'supplier')]
for rec in update_fields:
webnotes.conn.sql("update `tab%s` set supplier_name = %s where `%s` = %s" % \
(rec[0], '%s', rec[1], '%s'), (new, old))
webnotes.conn.set(self.doc, "supplier_name", new)
for account in webnotes.conn.sql("""select name, account_name from
tabAccount where master_name=%s and master_type='Supplier'""", old, as_dict=1):
if account.account_name != new:
webnotes.rename_doc("Account", account.name, new, merge=merge)
merge_account = True if merge and webnotes.conn.get_value("Account",
{"master_name": new, "master_type": "Supplier"}) else False
webnotes.rename_doc("Account", account.name, new, merge=merge_account)
#update master_name in doctype account
webnotes.conn.sql("""update `tabAccount` set master_name = %s,
master_type = 'Supplier' where master_name = %s""" , (new,old))
master_type = 'Supplier' where master_name = %s""" , (new, old))
@webnotes.whitelist()
def get_dashboard_info(supplier):

View File

@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import webnotes
from webnotes import msgprint, _
from webnotes.utils import getdate, flt, add_days
from webnotes.utils import getdate, flt, add_days, cstr
import json
@webnotes.whitelist()
@@ -94,7 +94,6 @@ def _get_price_list_rate(args, item_bean, meta):
(args.buying_price_list, args.item_code), as_dict=1)
if price_list_rate:
from utilities.transaction_base import validate_currency
validate_currency(args, item_bean.doc, meta)
out.import_ref_rate = flt(price_list_rate[0].ref_rate) * \
@@ -132,7 +131,7 @@ def _validate_item_details(args, item):
_("Please select a sub-contracted item or do not sub-contract the transaction."),
raise_exception=True)
def get_last_purchase_details(item_code, doc_name, conversion_rate=1.0):
def get_last_purchase_details(item_code, doc_name=None, conversion_rate=1.0):
"""returns last purchase details in stock uom"""
# get last purchase order item details
last_purchase_order = webnotes.conn.sql("""\
@@ -143,7 +142,7 @@ def get_last_purchase_details(item_code, doc_name, conversion_rate=1.0):
where po.docstatus = 1 and po_item.item_code = %s and po.name != %s and
po.name = po_item.parent
order by po.transaction_date desc, po.name desc
limit 1""", (item_code, doc_name), as_dict=1)
limit 1""", (item_code, cstr(doc_name)), as_dict=1)
# get last purchase receipt item details
last_purchase_receipt = webnotes.conn.sql("""\
@@ -154,7 +153,7 @@ def get_last_purchase_details(item_code, doc_name, conversion_rate=1.0):
where pr.docstatus = 1 and pr_item.item_code = %s and pr.name != %s and
pr.name = pr_item.parent
order by pr.posting_date desc, pr.posting_time desc, pr.name desc
limit 1""", (item_code, doc_name), as_dict=1)
limit 1""", (item_code, cstr(doc_name)), as_dict=1)
purchase_order_date = getdate(last_purchase_order and last_purchase_order[0].transaction_date \
or "1900-01-01")