Merge branch 'develop'
This commit is contained in:
commit
adcaf75bb0
@ -1,2 +1,2 @@
|
||||
from __future__ import unicode_literals
|
||||
__version__ = '6.4.6'
|
||||
__version__ = '6.4.7'
|
||||
|
@ -37,7 +37,8 @@ class JournalEntry(AccountsController):
|
||||
self.validate_credit_debit_note()
|
||||
self.validate_empty_accounts_table()
|
||||
self.set_account_and_party_balance()
|
||||
self.set_title()
|
||||
if not self.title:
|
||||
self.title = self.get_title()
|
||||
|
||||
def on_submit(self):
|
||||
self.check_credit_limit()
|
||||
@ -45,8 +46,8 @@ class JournalEntry(AccountsController):
|
||||
self.update_advance_paid()
|
||||
self.update_expense_claim()
|
||||
|
||||
def set_title(self):
|
||||
self.title = self.pay_to_recd_from or self.accounts[0].account
|
||||
def get_title(self):
|
||||
return self.pay_to_recd_from or self.accounts[0].account
|
||||
|
||||
def update_advance_paid(self):
|
||||
advance_paid = frappe._dict()
|
||||
|
@ -175,7 +175,7 @@ def get_pricing_rules(args):
|
||||
if parent_groups:
|
||||
if allow_blank: parent_groups.append('')
|
||||
condition = " ifnull("+field+", '') in ('" + \
|
||||
"', '".join([d.replace("'", "\\'").replace('"', '\\"') for d in parent_groups])+"')"
|
||||
"', '".join([d.replace("'", "\\'").replace('"', '\\"').replace("%", "%%") for d in parent_groups])+"')"
|
||||
return condition
|
||||
|
||||
|
||||
|
@ -1697,6 +1697,29 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "letter_head",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Letter Head",
|
||||
"no_copy": 0,
|
||||
"options": "Letter Head",
|
||||
"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": 1,
|
||||
"bold": 0,
|
||||
@ -2242,7 +2265,7 @@
|
||||
"is_submittable": 1,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"modified": "2015-09-30 08:52:56.789115",
|
||||
"modified": "2015-10-12 06:23:32.141069",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Purchase Invoice",
|
||||
|
@ -51,7 +51,8 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
|
||||
# sales team
|
||||
if party_type=="Customer":
|
||||
out["sales_team"] = [{
|
||||
"sales_person": d.sales_person
|
||||
"sales_person": d.sales_person,
|
||||
"allocated_percentage": d.allocated_percentage or None
|
||||
} for d in party.get("sales_team")]
|
||||
|
||||
return out
|
||||
|
@ -38,7 +38,7 @@ class ReceivablePayableReport(object):
|
||||
"width": 120
|
||||
})
|
||||
|
||||
columns += [_("Age (Days)") + "::80"]
|
||||
columns += [_("Age (Days)") + ":Int:80"]
|
||||
|
||||
if not "range1" in self.filters:
|
||||
self.filters["range1"] = "30"
|
||||
|
@ -34,6 +34,7 @@ status_map = {
|
||||
["To Bill", "eval:self.per_delivered == 100 and self.per_billed < 100 and self.docstatus == 1"],
|
||||
["To Deliver", "eval:self.per_delivered < 100 and self.per_billed == 100 and self.docstatus == 1"],
|
||||
["Completed", "eval:self.per_delivered == 100 and self.per_billed == 100 and self.docstatus == 1"],
|
||||
["Completed", "eval:self.order_type == 'Maintenance' and self.per_billed == 100 and self.docstatus == 1"],
|
||||
["Stopped", "eval:self.status=='Stopped'"],
|
||||
["Cancelled", "eval:self.docstatus==2"],
|
||||
],
|
||||
|
@ -355,7 +355,7 @@ class calculate_taxes_and_totals(object):
|
||||
item.net_amount = flt(item.net_amount + discount_amount_loss,
|
||||
item.precision("net_amount"))
|
||||
|
||||
item.net_rate = flt(item.net_amount / item.qty, item.precision("net_rate"))
|
||||
item.net_rate = flt(item.net_amount / item.qty, item.precision("net_rate")) if item.qty else 0
|
||||
|
||||
self._set_in_company_currency(item, ["net_rate", "net_amount"])
|
||||
|
||||
|
@ -29,7 +29,7 @@ blogs.
|
||||
"""
|
||||
app_icon = "icon-th"
|
||||
app_color = "#e74c3c"
|
||||
app_version = "6.4.6"
|
||||
app_version = "6.4.7"
|
||||
github_link = "https://github.com/frappe/erpnext"
|
||||
|
||||
error_report_email = "support@erpnext.com"
|
||||
|
@ -215,4 +215,6 @@ erpnext.patches.v6_4.round_status_updater_percentages
|
||||
erpnext.patches.v6_4.repost_gle_for_journal_entries_where_reference_name_missing
|
||||
erpnext.patches.v6_4.fix_journal_entries_due_to_reconciliation
|
||||
erpnext.patches.v6_4.fix_status_in_sales_and_purchase_order
|
||||
erpnext.patches.v6_4.fix_modified_in_sales_order_and_purchase_order
|
||||
erpnext.patches.v6_4.fix_modified_in_sales_order_and_purchase_order
|
||||
erpnext.patches.v6_4.fix_duplicate_bins
|
||||
erpnext.patches.v6_4.fix_sales_order_maintenance_status
|
||||
|
20
erpnext/patches/v6_4/fix_duplicate_bins.py
Normal file
20
erpnext/patches/v6_4/fix_duplicate_bins.py
Normal file
@ -0,0 +1,20 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from erpnext.stock.stock_balance import repost_stock
|
||||
|
||||
def execute():
|
||||
bins = frappe.db.sql("""select item_code, warehouse, count(*) from `tabBin`
|
||||
group by item_code, warehouse having count(*) > 1""", as_dict=True)
|
||||
|
||||
for d in bins:
|
||||
try:
|
||||
frappe.db.sql("delete from tabBin where item_code=%s and warehouse=%s", (d.item_code, d.warehouse))
|
||||
|
||||
repost_stock(d.item_code, d.warehouse, allow_zero_rate=True, only_actual=False, only_bin=True)
|
||||
|
||||
frappe.db.commit()
|
||||
except:
|
||||
frappe.db.rollback()
|
@ -0,0 +1,7 @@
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
for doc in frappe.get_all("Sales Order", filters={"docstatus": 1,
|
||||
"order_type": "Maintenance"}):
|
||||
doc = frappe.get_doc("Sales Order", doc.name)
|
||||
doc.set_status(update=True)
|
@ -19,7 +19,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Title",
|
||||
"no_copy": 1,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
@ -217,7 +217,7 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"modified": "2015-09-11 12:19:41.832529",
|
||||
"modified": "2015-10-12 06:24:11.748792",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Projects",
|
||||
"name": "Project Task",
|
||||
|
@ -20,7 +20,10 @@ erpnext.utils.get_party_details = function(frm, method, args, callback) {
|
||||
price_list: frm.doc.buying_price_list
|
||||
};
|
||||
}
|
||||
args.posting_date = frm.doc.transaction_date;
|
||||
|
||||
if (args) {
|
||||
args.posting_date = frm.doc.transaction_date;
|
||||
}
|
||||
}
|
||||
if(!args) return;
|
||||
|
||||
|
@ -396,7 +396,7 @@ def make_sales_invoice(source_name, target_doc=None):
|
||||
"parent": "sales_order",
|
||||
},
|
||||
"postprocess": update_item,
|
||||
"condition": lambda doc: doc.base_amount==0 or doc.billed_amt < doc.amount
|
||||
"condition": lambda doc: doc.qty and (doc.base_amount==0 or doc.billed_amt < doc.amount)
|
||||
},
|
||||
"Sales Taxes and Charges": {
|
||||
"doctype": "Sales Taxes and Charges",
|
||||
|
@ -34,14 +34,14 @@ erpnext.SalesAnalytics = frappe.views.TreeGridReport.extend({
|
||||
show: true,
|
||||
item_key: "customer",
|
||||
parent_field: "parent_customer_group",
|
||||
formatter: function(item) { return item.name; }
|
||||
formatter: function(item) { return item.customer_name || item.name; }
|
||||
},
|
||||
"Customer": {
|
||||
label: __("Customer"),
|
||||
show: false,
|
||||
item_key: "customer",
|
||||
formatter: function(item) {
|
||||
return item.name;
|
||||
return item.customer_name || item.name;
|
||||
}
|
||||
},
|
||||
"Item Group": {
|
||||
|
@ -59,10 +59,6 @@ frappe.ui.form.on("Item", {
|
||||
erpnext.item.toggle_reqd(frm);
|
||||
|
||||
erpnext.item.toggle_attributes(frm);
|
||||
|
||||
if (frm.is_new() && frm.doc.is_stock_item) {
|
||||
frm.fields_dict.inventory.collapse(false);
|
||||
}
|
||||
},
|
||||
|
||||
validate: function(frm){
|
||||
@ -95,7 +91,6 @@ frappe.ui.form.on("Item", {
|
||||
},
|
||||
|
||||
is_stock_item: function(frm) {
|
||||
frm.is_new() && frm.fields_dict.inventory.collapse(!frm.doc.is_stock_item);
|
||||
erpnext.item.toggle_reqd(frm);
|
||||
},
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -200,8 +200,8 @@ class Item(WebsiteGenerator):
|
||||
self.set("reorder_levels", [])
|
||||
|
||||
if self.re_order_level or len(self.get("reorder_levels", {"material_request_type": "Purchase"})):
|
||||
if not self.is_purchase_item:
|
||||
frappe.throw(_("""To set reorder level, item must be a Purchase Item"""))
|
||||
if not (self.is_purchase_item or self.is_pro_applicable):
|
||||
frappe.throw(_("""To set reorder level, item must be a Purchase Item or Manufacturing Item"""))
|
||||
|
||||
def validate_warehouse_for_reorder(self):
|
||||
warehouse = []
|
||||
|
@ -727,7 +727,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"description": "This will override Difference Account in Item",
|
||||
"description": "",
|
||||
"fieldname": "difference_account",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -1291,7 +1291,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-09-11 12:20:21.220215",
|
||||
"modified": "2015-10-12 18:27:59.381894",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Stock Entry",
|
||||
|
@ -102,7 +102,7 @@ class StockEntry(StockController):
|
||||
if self.difference_account and not item.expense_account:
|
||||
item.expense_account = self.difference_account
|
||||
|
||||
if not item.transfer_qty:
|
||||
if not item.transfer_qty and item.qty:
|
||||
item.transfer_qty = item.qty * item.conversion_factor
|
||||
|
||||
if (self.purpose in ("Material Transfer", "Material Transfer for Manufacture")
|
||||
|
@ -9,7 +9,7 @@ from erpnext.stock.utils import update_bin
|
||||
from erpnext.stock.stock_ledger import update_entries_after
|
||||
from erpnext.accounts.utils import get_fiscal_year
|
||||
|
||||
def repost(only_actual=False, allow_negative_stock=False, allow_zero_rate=False):
|
||||
def repost(only_actual=False, allow_negative_stock=False, allow_zero_rate=False, only_bin=False):
|
||||
"""
|
||||
Repost everything!
|
||||
"""
|
||||
@ -24,7 +24,7 @@ def repost(only_actual=False, allow_negative_stock=False, allow_zero_rate=False)
|
||||
union
|
||||
select item_code, warehouse from `tabStock Ledger Entry`) a"""):
|
||||
try:
|
||||
repost_stock(d[0], d[1], allow_zero_rate, only_actual)
|
||||
repost_stock(d[0], d[1], allow_zero_rate, only_actual, only_bin)
|
||||
frappe.db.commit()
|
||||
except:
|
||||
frappe.db.rollback()
|
||||
@ -33,22 +33,37 @@ def repost(only_actual=False, allow_negative_stock=False, allow_zero_rate=False)
|
||||
frappe.db.set_value("Stock Settings", None, "allow_negative_stock", existing_allow_negative_stock)
|
||||
frappe.db.auto_commit_on_many_writes = 0
|
||||
|
||||
def repost_stock(item_code, warehouse, allow_zero_rate=False, only_actual=False):
|
||||
repost_actual_qty(item_code, warehouse, allow_zero_rate)
|
||||
def repost_stock(item_code, warehouse, allow_zero_rate=False, only_actual=False, only_bin=False):
|
||||
if not only_bin:
|
||||
repost_actual_qty(item_code, warehouse, allow_zero_rate, only_bin)
|
||||
|
||||
if item_code and warehouse and not only_actual:
|
||||
update_bin_qty(item_code, warehouse, {
|
||||
qty_dict = {
|
||||
"reserved_qty": get_reserved_qty(item_code, warehouse),
|
||||
"indented_qty": get_indented_qty(item_code, warehouse),
|
||||
"ordered_qty": get_ordered_qty(item_code, warehouse),
|
||||
"planned_qty": get_planned_qty(item_code, warehouse)
|
||||
})
|
||||
}
|
||||
if only_bin:
|
||||
qty_dict.update({
|
||||
"actual_qty": get_balance_qty_from_sle(item_code, warehouse)
|
||||
})
|
||||
|
||||
update_bin_qty(item_code, warehouse, qty_dict)
|
||||
|
||||
def repost_actual_qty(item_code, warehouse, allow_zero_rate=False):
|
||||
try:
|
||||
update_entries_after({ "item_code": item_code, "warehouse": warehouse }, allow_zero_rate)
|
||||
except:
|
||||
pass
|
||||
|
||||
def get_balance_qty_from_sle(item_code, warehouse):
|
||||
balance_qty = frappe.db.sql("""select qty_after_transaction from `tabStock Ledger Entry`
|
||||
where item_code=%s and warehouse=%s and is_cancelled='No'
|
||||
order by posting_date desc, posting_time desc, name desc
|
||||
limit 1""", (item_code, warehouse))
|
||||
|
||||
return flt(balance_qty[0][0]) if balance_qty else 0.0
|
||||
|
||||
def get_reserved_qty(item_code, warehouse):
|
||||
reserved_qty = frappe.db.sql("""
|
||||
|
Loading…
x
Reference in New Issue
Block a user