Merge branch 'develop'

This commit is contained in:
Anand Doshi 2015-10-19 16:30:33 +05:30
commit 639826e888
310 changed files with 65657 additions and 53388 deletions

View File

@ -1,2 +1,2 @@
from __future__ import unicode_literals
__version__ = '6.4.7'
__version__ = '6.5.0'

View File

@ -426,7 +426,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-11 15:51:26",
"modified": "2015-10-02 07:38:37.436071",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Account",

View File

@ -249,7 +249,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-10 16:59:43.974705",
"modified": "2015-10-02 07:38:39.149782",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Reconciliation Detail",

View File

@ -89,7 +89,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-02-19 01:06:59.471417",
"modified": "2015-10-02 07:38:40.727468",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Budget Detail",

View File

@ -344,7 +344,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 3,
"modified": "2015-09-07 15:51:26",
"modified": "2015-10-02 07:38:40.926061",
"modified_by": "Administrator",
"module": "Accounts",
"name": "C-Form",

View File

@ -136,7 +136,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-01-01 14:29:58.597428",
"modified": "2015-10-02 07:38:41.105885",
"modified_by": "Administrator",
"module": "Accounts",
"name": "C-Form Invoice Detail",

View File

@ -17,8 +17,7 @@ erpnext.accounts.CostCenterController = frappe.ui.form.Controller.extend({
return {
filters:[
['Account', 'company', '=', me.frm.doc.company],
['Account', 'root_type', '=', 'Expense'],
['Account', 'is_group', '=', '0'],
['Account', 'is_group', '=', '0']
]
}
});

View File

@ -298,7 +298,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:55.020690",
"modified": "2015-10-02 07:38:42.617993",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Cost Center",

View File

@ -32,13 +32,13 @@ class CostCenter(NestedSet):
for d in self.get('budgets'):
if d.account:
account_details = frappe.db.get_value("Account", d.account,
["is_group", "company", "root_type"], as_dict=1)
["is_group", "company", "report_type"], as_dict=1)
if account_details.is_group:
frappe.throw(_("Budget cannot be assigned against Group Account {0}").format(d.account))
elif account_details.company != self.company:
frappe.throw(_("Account {0} does not belongs to company {1}").format(d.account, self.company))
elif account_details.root_type != "Expense":
frappe.throw(_("Budget cannot be assigned against {0}, as it's not an Expense account")
elif account_details.report_type != "Profit and Loss":
frappe.throw(_("Budget cannot be assigned against {0}, as it's not an Income or Expense account")
.format(d.account))
if [d.account, d.fiscal_year] in check_acc_list:

View File

@ -133,7 +133,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:56.280252",
"modified": "2015-10-02 07:38:50.942038",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Fiscal Year",

View File

@ -39,7 +39,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-09-14 02:55:56.368682",
"modified": "2015-10-02 07:38:51.045350",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Fiscal Year Company",

View File

@ -511,7 +511,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-21 15:51:26",
"modified": "2015-10-02 07:38:51.117114",
"modified_by": "Administrator",
"module": "Accounts",
"name": "GL Entry",

View File

@ -11,6 +11,8 @@ from erpnext.accounts.utils import get_account_currency
from erpnext.setup.doctype.company.company import get_company_currency
from erpnext.exceptions import InvalidAccountCurrency, CustomerFrozen
exclude_from_linked_with = True
class GLEntry(Document):
def validate(self):
self.flags.ignore_submit_comment = True

View File

@ -1024,7 +1024,7 @@
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"modified": "2015-09-30 08:52:57.388579",
"modified": "2015-10-02 07:38:54.074343",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry",

View File

@ -563,7 +563,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-09-11 12:55:59.270539",
"modified": "2015-10-02 07:38:54.406370",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry Account",

View File

@ -65,7 +65,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:58.003800",
"modified": "2015-10-02 07:38:57.318104",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Mode of Payment",

View File

@ -63,7 +63,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-01-06 17:26:57.053474",
"modified": "2015-10-02 07:38:57.388194",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Mode of Payment Account",

View File

@ -91,7 +91,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-02-05 05:11:41.429491",
"modified": "2015-10-02 07:38:57.594541",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Monthly Distribution",

View File

@ -63,7 +63,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-02-19 01:07:00.800015",
"modified": "2015-10-02 07:38:57.670950",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Monthly Distribution Percentage",

View File

@ -82,7 +82,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-26 11:23:22.917738",
"modified": "2015-10-02 07:38:59.582533",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Party Account",

View File

@ -83,7 +83,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Column Break",
"label": "",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -144,7 +144,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2014-07-18 12:20:51.269974",
"modified": "2015-10-16 06:14:07.460813",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Reconciliation Invoice",

View File

@ -229,7 +229,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-09-21 03:39:40.320070",
"modified": "2015-10-02 07:38:59.835936",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Reconciliation Payment",

View File

@ -149,7 +149,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-31 18:58:35.537060",
"modified": "2015-10-02 07:38:59.950506",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Tool Detail",

View File

@ -250,7 +250,7 @@
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"modified": "2015-02-05 05:11:42.268561",
"modified": "2015-10-02 07:39:00.056337",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Period Closing Voucher",

View File

@ -622,7 +622,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-07 15:51:26",
"modified": "2015-10-02 07:39:00.196535",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Profile",

View File

@ -851,7 +851,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-11 12:19:52.242771",
"modified": "2015-10-02 07:39:00.632196",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Pricing Rule",

View File

@ -2265,7 +2265,7 @@
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"modified": "2015-10-12 06:23:32.141069",
"modified": "2015-10-12 16:23:32.141069",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",

View File

@ -76,7 +76,7 @@ class PurchaseInvoice(BuyingController):
def get_advances(self):
if not self.is_return:
super(PurchaseInvoice, self).get_advances(self.credit_to, "Supplier", self.supplier,
"Purchase Invoice Advance", "advances", "debit", "purchase_order")
"Purchase Invoice Advance", "advances", "debit_in_account_currency", "purchase_order")
def check_active_purchase_items(self):
for d in self.get('items'):
@ -421,7 +421,7 @@ class PurchaseInvoice(BuyingController):
if self.bill_no:
if cint(frappe.db.get_single_value("Accounts Settings", "check_supplier_invoice_uniqueness")):
pi = frappe.db.exists("Purchase Invoice", {"bill_no": self.bill_no,
"fiscal_year": self.fiscal_year, "name": ("!=", self.name)})
"fiscal_year": self.fiscal_year, "name": ("!=", self.name), "docstatus": ("<", 2)})
if pi:
frappe.throw("Supplier Invoice No exists in Purchase Invoice {0}".format(pi))

View File

@ -164,7 +164,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-25 17:51:30.274069",
"modified": "2015-10-02 07:39:03.538046",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Advance",

View File

@ -1093,7 +1093,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-26 12:28:16.728059",
"modified": "2015-10-19 03:04:52.304768",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",

View File

@ -504,7 +504,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-28 02:57:08.769473",
"modified": "2015-10-02 07:39:06.372275",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Taxes and Charges",

View File

@ -176,7 +176,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-11 12:19:53.741725",
"modified": "2015-10-02 07:39:06.563868",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Taxes and Charges Template",

View File

@ -376,7 +376,7 @@ cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) {
// --------------------------------
cur_frm.set_query("income_account", "items", function(doc) {
return{
query: "erpnext.accounts.doctype.sales_invoice.sales_invoice.get_income_account",
query: "erpnext.controllers.queries.get_income_account",
filters: {'company': doc.company}
}
});

View File

@ -2951,7 +2951,7 @@
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"modified": "2015-09-30 08:52:53.679566",
"modified": "2015-10-02 07:39:09.123982",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",

View File

@ -256,7 +256,7 @@ class SalesInvoice(SellingController):
def get_advances(self):
if not self.is_return:
super(SalesInvoice, self).get_advances(self.debit_to, "Customer", self.customer,
"Sales Invoice Advance", "advances", "credit", "sales_order")
"Sales Invoice Advance", "advances", "credit_in_account_currency", "sales_order")
def get_company_abbr(self):
return frappe.db.sql("select abbr from tabCompany where name=%s", self.company)[0][0]
@ -422,7 +422,7 @@ class SalesInvoice(SellingController):
def update_packing_list(self):
if cint(self.update_stock) == 1:
from erpnext.stock.doctype.packed_item.packed_item import make_packing_list
make_packing_list(self, 'items')
make_packing_list(self)
else:
self.set('packed_items', [])
@ -637,24 +637,6 @@ def get_bank_cash_account(mode_of_payment, company):
"account": account
}
@frappe.whitelist()
def get_income_account(doctype, txt, searchfield, start, page_len, filters):
from erpnext.controllers.queries import get_match_cond
# income account can be any Credit account,
# but can also be a Asset account with account_type='Income Account' in special circumstances.
# Hence the first condition is an "OR"
return frappe.db.sql("""select tabAccount.name from `tabAccount`
where (tabAccount.report_type = "Profit and Loss"
or tabAccount.account_type in ("Income Account", "Temporary"))
and tabAccount.is_group=0
and tabAccount.docstatus!=2
and tabAccount.company = '%(company)s'
and tabAccount.%(key)s LIKE '%(txt)s'
%(mcond)s""" % {'company': filters['company'], 'key': searchfield,
'txt': "%%%s%%" % frappe.db.escape(txt), 'mcond':get_match_cond(doctype)})
@frappe.whitelist()
def make_delivery_note(source_name, target_doc=None):
def set_missing_values(source, target):

View File

@ -8,6 +8,8 @@ from frappe.utils import nowdate, add_days, flt
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry, get_qty_after_transaction
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory
from erpnext.exceptions import InvalidAccountCurrency, InvalidCurrency
from erpnext.stock.doctype.serial_no.serial_no import SerialNoWarehouseError
from frappe.model.naming import make_autoname
class TestSalesInvoice(unittest.TestCase):
def make(self):
@ -688,7 +690,6 @@ class TestSalesInvoice(unittest.TestCase):
si.insert()
si.submit()
self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "status"), "Delivered")
self.assertFalse(frappe.db.get_value("Serial No", serial_nos[0], "warehouse"))
self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0],
"delivery_document_no"), si.name)
@ -702,33 +703,26 @@ class TestSalesInvoice(unittest.TestCase):
serial_nos = get_serial_nos(si.get("items")[0].serial_no)
self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "status"), "Available")
self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "warehouse"), "_Test Warehouse - _TC")
self.assertFalse(frappe.db.get_value("Serial No", serial_nos[0],
"delivery_document_no"))
def test_serialize_status(self):
from erpnext.stock.doctype.serial_no.serial_no import SerialNoStatusError, get_serial_nos, SerialNoDuplicateError
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item
se = make_serialized_item()
serial_nos = get_serial_nos(se.get("items")[0].serial_no)
sr = frappe.get_doc("Serial No", serial_nos[0])
sr.status = "Not Available"
sr.save()
serial_no = frappe.get_doc({
"doctype": "Serial No",
"item_code": "_Test Serialized Item With Series",
"serial_no": make_autoname("SR", "Serial No")
})
serial_no.save()
si = frappe.copy_doc(test_records[0])
si.update_stock = 1
si.get("items")[0].item_code = "_Test Serialized Item With Series"
si.get("items")[0].qty = 1
si.get("items")[0].serial_no = serial_nos[0]
si.get("items")[0].serial_no = serial_no.name
si.insert()
self.assertRaises(SerialNoStatusError, si.submit)
# hack! because stock ledger entires are already inserted and are not rolled back!
self.assertRaises(SerialNoDuplicateError, si.cancel)
self.assertRaises(SerialNoWarehouseError, si.submit)
def test_invoice_due_date_against_customers_credit_days(self):
# set customer's credit days

View File

@ -164,7 +164,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-21 16:22:28.866049",
"modified": "2015-10-02 07:39:09.979547",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Advance",

View File

@ -843,6 +843,29 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "target_warehouse",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Target Warehouse",
"no_copy": 0,
"options": "Warehouse",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@ -1259,7 +1282,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-20 17:18:52.752064",
"modified": "2015-10-19 03:04:52.093181",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",

View File

@ -456,7 +456,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-28 02:57:00.766305",
"modified": "2015-10-02 07:39:11.977789",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Taxes and Charges",

View File

@ -175,7 +175,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-17 07:09:28.797959",
"modified": "2015-10-02 07:39:12.157257",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Taxes and Charges Template",

View File

@ -305,7 +305,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-22 08:30:57.226342",
"modified": "2015-10-02 07:39:12.778062",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Shipping Rule",

View File

@ -81,7 +81,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2013-12-20 19:21:46",
"modified": "2015-10-02 07:39:12.974539",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Shipping Rule Condition",

View File

@ -39,7 +39,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-09-17 06:43:22.767534",
"modified": "2015-10-02 07:39:13.035775",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Shipping Rule Country",

View File

@ -580,7 +580,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-24 07:59:06.502058",
"modified": "2015-10-02 07:39:16.298546",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Tax Rule",

View File

@ -217,11 +217,17 @@ def validate_party_accounts(doc):
for account in doc.get("accounts"):
if account.company in companies:
frappe.throw(_("There can only be 1 Account per Company in {0} {1}").format(doc.doctype, doc.name),
DuplicatePartyAccountError)
frappe.throw(_("There can only be 1 Account per Company in {0} {1}")
.format(doc.doctype, doc.name), DuplicatePartyAccountError)
else:
companies.append(account.company)
party_account_currency = frappe.db.get_value("Account", account.account, "account_currency")
existing_gle_currency = get_party_gle_currency(doc.doctype, doc.name, account.company)
if existing_gle_currency and party_account_currency != existing_gle_currency:
frappe.throw(_("Accounting entries have already been made in currency {0} for company {1}. Please select a receivable or payable account with currency {0}.").format(existing_gle_currency, account.company))
@frappe.whitelist()
def get_due_date(posting_date, party_type, party, company):
"""Set Due Date = Posting Date + Credit Days"""

View File

@ -84,7 +84,9 @@ def get_balance_on(account=None, date=None, party_type=None, party=None, in_acco
if account:
acc = frappe.get_doc("Account", account)
acc.check_permission("read")
if not frappe.flags.ignore_account_permission:
acc.check_permission("read")
# for pl accounts, get balance within a fiscal year
if acc.report_type == 'Profit and Loss':
@ -209,7 +211,8 @@ def update_against_doc(d, jv_obj):
if d['allocated_amt'] < d['unadjusted_amt']:
jvd = frappe.db.sql("""
select cost_center, balance, against_account, is_advance, account_type, exchange_rate
select cost_center, balance, against_account, is_advance,
account_type, exchange_rate, account_currency
from `tabJournal Entry Account` where name = %s
""", d['voucher_detail_no'], as_dict=True)
@ -220,6 +223,7 @@ def update_against_doc(d, jv_obj):
ch = jv_obj.append("accounts")
ch.account = d['account']
ch.account_type = jvd[0]['account_type']
ch.account_currency = jvd[0]['account_currency']
ch.exchange_rate = jvd[0]['exchange_rate']
ch.party_type = d["party_type"]
ch.party = d["party"]
@ -310,7 +314,7 @@ def get_stock_and_account_difference(account_list=None, posting_date=None):
def validate_expense_against_budget(args):
args = frappe._dict(args)
if frappe.db.get_value("Account", {"name": args.account, "report_type": "Profit and Loss"}):
if frappe.db.get_value("Account", {"name": args.account, "root_type": "Expense"}):
budget = frappe.db.sql("""
select bd.budget_allocated, cc.distribution_id
from `tabCost Center` cc, `tabBudget Detail` bd

View File

@ -1761,7 +1761,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Column Break",
"label": "",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -1920,7 +1920,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Column Break",
"label": "",
"no_copy": 0,
"permlevel": 0,
"print_hide": 1,
@ -2033,7 +2033,7 @@
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:17:59.659036",
"modified": "2015-10-16 06:13:50.058318",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order",

View File

@ -1200,7 +1200,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-27 02:29:53.767477",
"modified": "2015-10-19 03:04:51.773011",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order Item",

View File

@ -226,7 +226,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-03-03 03:40:45.982762",
"modified": "2015-10-02 07:39:05.021801",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order Item Supplied",

View File

@ -360,7 +360,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-19 12:45:54.810580",
"modified": "2015-10-02 07:39:06.224300",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Receipt Item Supplied",

View File

@ -547,7 +547,7 @@
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"modified": "2015-06-08 02:40:25.121948",
"modified": "2015-10-02 07:39:06.674821",
"modified_by": "Administrator",
"module": "Buying",
"name": "Quality Inspection",

View File

@ -318,7 +318,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-02-19 01:07:01.658125",
"modified": "2015-10-02 07:39:06.876419",
"modified_by": "Administrator",
"module": "Buying",
"name": "Quality Inspection Reading",

View File

@ -511,7 +511,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-25 06:34:56.909099",
"modified": "2015-10-02 07:39:14.767820",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier",

View File

@ -1554,7 +1554,7 @@
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"modified": "2015-09-30 08:52:51.539634",
"modified": "2015-10-02 07:39:15.027459",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Quotation",

View File

@ -925,7 +925,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-26 11:51:55.140967",
"modified": "2015-10-19 03:04:51.597343",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Quotation Item",

View File

@ -0,0 +1,7 @@
- Income type Account can now be added to Cost Center Budget
- Target Warehouse added to Delivery Note. Sponsored by [Startrack GPS (Guatemala)](http://gps.gt/)
- Serial No validations will now be based on Warehouse and not Status
- New Design for Email Digests. Now Email Digest will show Accounting Status and notifications. And, something special at the end!
- Thumbnail generation for Website views of product listing
- Ability to select Variant in shopping cart
- Now you can invite a Contact to become a portal user

View File

@ -293,3 +293,27 @@ def get_account_list(doctype, txt, searchfield, start, page_len, filters):
fields = ["name", "parent_account"],
limit_start=start, limit_page_length=page_len, as_list=True)
@frappe.whitelist()
def get_income_account(doctype, txt, searchfield, start, page_len, filters):
from erpnext.controllers.queries import get_match_cond
# income account can be any Credit account,
# but can also be a Asset account with account_type='Income Account' in special circumstances.
# Hence the first condition is an "OR"
if not filters: filters = {}
condition = ""
if filters.get("company"):
condition += "and tabAccount.company = %(company)s"
return frappe.db.sql("""select tabAccount.name from `tabAccount`
where (tabAccount.report_type = "Profit and Loss"
or tabAccount.account_type in ("Income Account", "Temporary"))
and tabAccount.is_group=0
and tabAccount.`{key}` LIKE %(txt)s
{condition} {match_condition}"""
.format(condition=condition, match_condition=get_match_cond(doctype), key=searchfield), {
'txt': "%%%s%%" % frappe.db.escape(txt),
'company': filters.get("company", "")
})

View File

@ -173,7 +173,8 @@ class SellingController(StockController):
'uom': p.uom,
'batch_no': cstr(p.batch_no).strip(),
'serial_no': cstr(p.serial_no).strip(),
'name': d.name
'name': d.name,
'target_warehouse': p.target_warehouse
}))
else:
il.append(frappe._dict({
@ -184,7 +185,8 @@ class SellingController(StockController):
'stock_uom': d.stock_uom,
'batch_no': cstr(d.get("batch_no")).strip(),
'serial_no': cstr(d.get("serial_no")).strip(),
'name': d.name
'name': d.name,
'target_warehouse': d.target_warehouse
}))
return il

View File

@ -7,6 +7,7 @@ from frappe.utils import cint, flt, cstr
from frappe import msgprint, _
import frappe.defaults
from erpnext.accounts.general_ledger import make_gl_entries, delete_gl_entries, process_gl_map
from erpnext.stock.utils import get_incoming_rate
from erpnext.controllers.accounts_controller import AccountsController
@ -184,7 +185,7 @@ class StockController(AccountsController):
"voucher_no": self.name,
"voucher_detail_no": d.name,
"actual_qty": (self.docstatus==1 and 1 or -1)*flt(d.get("stock_qty")),
"stock_uom": d.get("stock_uom"),
"stock_uom": frappe.db.get_value("Item", args.get("item_code") or d.get("item_code"), "stock_uom"),
"incoming_rate": 0,
"company": self.company,
"fiscal_year": self.fiscal_year,
@ -217,13 +218,14 @@ class StockController(AccountsController):
return serialized_items
def get_incoming_rate_for_sales_return(self, item_code, against_document):
def get_incoming_rate_for_sales_return(self, item_code, warehouse, against_document):
incoming_rate = 0.0
if against_document and item_code:
incoming_rate = frappe.db.sql("""select abs(ifnull(stock_value_difference, 0) / actual_qty)
from `tabStock Ledger Entry`
where voucher_type = %s and voucher_no = %s and item_code = %s limit 1""",
(self.doctype, against_document, item_code))
where voucher_type = %s and voucher_no = %s
and item_code = %s and warehouse=%s limit 1""",
(self.doctype, against_document, item_code, warehouse))
incoming_rate = incoming_rate[0][0] if incoming_rate else 0.0
return incoming_rate
@ -252,18 +254,53 @@ class StockController(AccountsController):
sl_entries = []
for d in self.get_item_list():
if frappe.db.get_value("Item", d.item_code, "is_stock_item") == 1 \
and d.warehouse and flt(d['qty']):
incoming_rate = 0
if frappe.db.get_value("Item", d.item_code, "is_stock_item") == 1 and flt(d.qty):
return_rate = 0
if cint(self.is_return) and self.return_against and self.docstatus==1:
incoming_rate = self.get_incoming_rate_for_sales_return(d.item_code, self.return_against)
return_rate = self.get_incoming_rate_for_sales_return(d.item_code,
d.warehouse, self.return_against)
sl_entries.append(self.get_sl_entries(d, {
"actual_qty": -1*flt(d['qty']),
"stock_uom": frappe.db.get_value("Item", d.item_code, "stock_uom"),
"incoming_rate": incoming_rate
}))
# On cancellation or if return entry submission, make stock ledger entry for
# target warehouse first, to update serial no values properly
if d.warehouse and ((not cint(self.is_return) and self.docstatus==1)
or (cint(self.is_return) and self.docstatus==2)):
sl_entries.append(self.get_sl_entries(d, {
"actual_qty": -1*flt(d.qty),
"incoming_rate": return_rate
}))
if d.target_warehouse:
target_warehouse_sle = self.get_sl_entries(d, {
"actual_qty": flt(d.qty),
"warehouse": d.target_warehouse
})
if self.docstatus == 1:
if not cint(self.is_return):
args = frappe._dict({
"item_code": d.item_code,
"warehouse": d.warehouse,
"posting_date": self.posting_date,
"posting_time": self.posting_time,
"qty": -1*flt(d.qty),
"serial_no": d.serial_no
})
target_warehouse_sle.update({
"incoming_rate": get_incoming_rate(args)
})
else:
target_warehouse_sle.update({
"outgoing_rate": return_rate
})
sl_entries.append(target_warehouse_sle)
if d.warehouse and ((not cint(self.is_return) and self.docstatus==2)
or (cint(self.is_return) and self.docstatus==1)):
sl_entries.append(self.get_sl_entries(d, {
"actual_qty": -1*flt(d.qty),
"incoming_rate": return_rate
}))
self.make_sl_entries(sl_entries)

View File

@ -808,7 +808,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:57:27.841011",
"modified": "2015-10-02 07:38:55.014441",
"modified_by": "Administrator",
"module": "CRM",
"name": "Lead",

View File

@ -215,7 +215,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-07-20 05:43:33.818567",
"modified": "2015-10-02 07:38:57.733269",
"modified_by": "Administrator",
"module": "CRM",
"name": "Newsletter",

View File

@ -62,7 +62,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-11 12:20:05.237636",
"modified": "2015-10-02 07:38:57.839265",
"modified_by": "Administrator",
"module": "CRM",
"name": "Newsletter List",

View File

@ -84,7 +84,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:58.113810",
"modified": "2015-10-02 07:38:57.901238",
"modified_by": "Administrator",
"module": "CRM",
"name": "Newsletter List Subscriber",

View File

@ -889,7 +889,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-11 12:19:38.052900",
"modified": "2015-10-02 07:38:58.453338",
"modified_by": "Administrator",
"module": "CRM",
"name": "Opportunity",

View File

@ -316,7 +316,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-19 12:45:53.472229",
"modified": "2015-10-19 03:04:51.988510",
"modified_by": "Administrator",
"module": "CRM",
"name": "Opportunity Item",

View File

@ -29,7 +29,7 @@ blogs.
"""
app_icon = "icon-th"
app_color = "#e74c3c"
app_version = "6.4.7"
app_version = "6.5.0"
github_link = "https://github.com/frappe/erpnext"
error_report_email = "support@erpnext.com"

View File

@ -465,7 +465,7 @@
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"modified": "2015-09-07 15:51:26",
"modified": "2015-10-02 07:38:38.259403",
"modified_by": "Administrator",
"module": "HR",
"name": "Appraisal",

View File

@ -182,7 +182,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-03-02 06:48:00.380426",
"modified": "2015-10-02 07:38:38.437815",
"modified_by": "Administrator",
"module": "HR",
"name": "Appraisal Goal",

View File

@ -91,7 +91,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:53.800359",
"modified": "2015-10-02 07:38:38.527810",
"modified_by": "Administrator",
"module": "HR",
"name": "Appraisal Template",

View File

@ -68,7 +68,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-02-19 01:06:59.356774",
"modified": "2015-10-02 07:38:38.594066",
"modified_by": "Administrator",
"module": "HR",
"name": "Appraisal Template Goal",

View File

@ -277,7 +277,7 @@
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:53.875571",
"modified": "2015-10-02 07:38:38.766621",
"modified_by": "Administrator",
"module": "HR",
"name": "Attendance",

View File

@ -42,7 +42,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:54.431393",
"modified": "2015-10-02 07:38:40.571426",
"modified_by": "Administrator",
"module": "HR",
"name": "Branch",

View File

@ -66,7 +66,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:55.387298",
"modified": "2015-10-02 07:38:44.282690",
"modified_by": "Administrator",
"module": "HR",
"name": "Deduction Type",

View File

@ -65,7 +65,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:55.449257",
"modified": "2015-10-02 07:38:45.543232",
"modified_by": "Administrator",
"module": "HR",
"name": "Department",

View File

@ -42,7 +42,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:55.508901",
"modified": "2015-10-02 07:38:45.651511",
"modified_by": "Administrator",
"module": "HR",
"name": "Designation",

View File

@ -66,7 +66,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:55.558890",
"modified": "2015-10-02 07:38:47.553467",
"modified_by": "Administrator",
"module": "HR",
"name": "Earning Type",

View File

@ -1893,7 +1893,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:55.671692",
"modified": "2015-10-19 03:04:49.862553",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee",

View File

@ -157,7 +157,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2013-12-20 19:23:12",
"modified": "2015-10-02 07:38:49.501752",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee Education",

View File

@ -155,7 +155,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2013-12-20 19:23:12",
"modified": "2015-10-02 07:38:49.600116",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee External Work History",

View File

@ -134,7 +134,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2014-05-09 02:16:44.613840",
"modified": "2015-10-02 07:38:49.685680",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee Internal Work History",

View File

@ -41,7 +41,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-02-19 01:07:00.128600",
"modified": "2015-10-02 07:38:49.771647",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee Leave Approver",

View File

@ -42,7 +42,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:56.145539",
"modified": "2015-10-02 07:38:49.822148",
"modified_by": "Administrator",
"module": "HR",
"name": "Employment Type",

View File

@ -536,7 +536,7 @@
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"modified": "2015-09-11 12:20:16.578324",
"modified": "2015-10-02 07:38:50.191920",
"modified_by": "Administrator",
"module": "HR",
"name": "Expense Claim",

View File

@ -252,7 +252,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-19 12:46:31.788770",
"modified": "2015-10-02 07:38:50.425244",
"modified_by": "Administrator",
"module": "HR",
"name": "Expense Claim Detail",

View File

@ -89,7 +89,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:56.204289",
"modified": "2015-10-02 07:38:50.532121",
"modified_by": "Administrator",
"module": "HR",
"name": "Expense Claim Type",

View File

@ -62,7 +62,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-19 12:46:31.898963",
"modified": "2015-10-02 07:38:51.356409",
"modified_by": "Administrator",
"module": "HR",
"name": "Holiday",

View File

@ -177,7 +177,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:56.430032",
"modified": "2015-10-02 07:38:51.415692",
"modified_by": "Administrator",
"module": "HR",
"name": "Holiday List",

View File

@ -34,8 +34,8 @@ class HolidayList(Document):
def validate_days(self):
for day in self.get("holidays"):
if (self.weekly_off).upper() == (day.description).upper():
frappe.throw("Records alredy exist for mentioned weekly off")
if (self.weekly_off or "").upper() == (day.description or "").upper():
frappe.throw("Records already exist for mentioned weekly off")
def get_weekly_off_date_list(self, year_start_date, year_end_date):
from frappe.utils import getdate

View File

@ -191,7 +191,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:57.100488",
"modified": "2015-10-02 07:38:53.861921",
"modified_by": "Administrator",
"module": "HR",
"name": "Job Applicant",

View File

@ -85,7 +85,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:57.210679",
"modified": "2015-10-02 07:38:53.972949",
"modified_by": "Administrator",
"module": "HR",
"name": "Job Opening",

View File

@ -310,7 +310,7 @@
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"modified": "2015-09-07 15:51:26",
"modified": "2015-10-02 07:38:55.314632",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Allocation",

View File

@ -559,7 +559,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 3,
"modified": "2015-09-14 02:55:57.427750",
"modified": "2015-10-02 07:38:55.471712",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Application",

View File

@ -5,7 +5,7 @@ from __future__ import unicode_literals
import frappe, json
from frappe import _
from frappe.utils import cint, cstr, date_diff, flt, formatdate, getdate, get_url_to_form, \
from frappe.utils import cint, cstr, date_diff, flt, formatdate, getdate, get_link_to_form, \
comma_or, get_fullname
from frappe import msgprint
from erpnext.hr.utils import set_employee_name
@ -164,7 +164,7 @@ class LeaveApplication(Document):
def _get_message(url=False):
if url:
name = get_url_to_form(self.doctype, self.name)
name = get_link_to_form(self.doctype, self.name)
else:
name = self.name
@ -184,8 +184,8 @@ class LeaveApplication(Document):
name = self.name
employee_name = cstr(employee.employee_name)
if url:
name = get_url_to_form(self.doctype, self.name)
employee_name = get_url_to_form("Employee", self.employee, label=employee_name)
name = get_link_to_form(self.doctype, self.name)
employee_name = get_link_to_form("Employee", self.employee, label=employee_name)
return (_("New Leave Application") + ": %s - " + _("Employee") + ": %s") % (name, employee_name)

View File

@ -195,7 +195,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:57.796873",
"modified": "2015-10-02 07:38:55.691200",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Block List",

View File

@ -40,7 +40,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2013-12-20 19:23:18",
"modified": "2015-10-02 07:38:55.787281",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Block List Allow",

View File

@ -62,7 +62,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2013-12-20 19:23:19",
"modified": "2015-10-02 07:38:55.839918",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Block List Date",

View File

@ -174,7 +174,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:57.897034",
"modified": "2015-10-02 07:38:55.903280",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Type",

View File

@ -310,7 +310,7 @@
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:58.358852",
"modified": "2015-10-02 07:38:58.043259",
"modified_by": "Administrator",
"module": "HR",
"name": "Offer Letter",

View File

@ -82,7 +82,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-04-01 03:46:49.530328",
"modified": "2015-10-02 07:38:58.211366",
"modified_by": "Administrator",
"module": "HR",
"name": "Offer Letter Term",

View File

@ -39,7 +39,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-09-14 02:55:58.508655",
"modified": "2015-10-02 07:38:58.280068",
"modified_by": "Administrator",
"module": "HR",
"name": "Offer Term",

Some files were not shown because too many files have changed in this diff Show More