Merge branch 'develop'
This commit is contained in:
commit
be96600c1c
@ -211,6 +211,9 @@ class DocType:
|
|||||||
|
|
||||||
# Validate properties before merging
|
# Validate properties before merging
|
||||||
if merge:
|
if merge:
|
||||||
|
if not webnotes.conn.exists("Account", new):
|
||||||
|
webnotes.throw(_("Account ") + new +_(" does not exists"))
|
||||||
|
|
||||||
val = list(webnotes.conn.get_value("Account", new_account,
|
val = list(webnotes.conn.get_value("Account", new_account,
|
||||||
["group_or_ledger", "debit_or_credit", "is_pl_account"]))
|
["group_or_ledger", "debit_or_credit", "is_pl_account"]))
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"app_name": "ERPNext",
|
"app_name": "ERPNext",
|
||||||
"app_version": "3.3.4",
|
"app_version": "3.3.5",
|
||||||
"base_template": "app/portal/templates/base.html",
|
"base_template": "app/portal/templates/base.html",
|
||||||
"modules": {
|
"modules": {
|
||||||
"Accounts": {
|
"Accounts": {
|
||||||
|
|||||||
@ -246,6 +246,9 @@ class DocType(DocListController, WebsiteGenerator):
|
|||||||
def before_rename(self, olddn, newdn, merge=False):
|
def before_rename(self, olddn, newdn, merge=False):
|
||||||
if merge:
|
if merge:
|
||||||
# Validate properties before merging
|
# Validate properties before merging
|
||||||
|
if not webnotes.conn.exists("Item", newdn):
|
||||||
|
webnotes.throw(_("Item ") + newdn +_(" does not exists"))
|
||||||
|
|
||||||
field_list = ["stock_uom", "is_stock_item", "has_serial_no", "has_batch_no"]
|
field_list = ["stock_uom", "is_stock_item", "has_serial_no", "has_batch_no"]
|
||||||
new_properties = [cstr(d) for d in webnotes.conn.get_value("Item", newdn, field_list)]
|
new_properties = [cstr(d) for d in webnotes.conn.get_value("Item", newdn, field_list)]
|
||||||
if new_properties != [cstr(self.doc.fields[fld]) for fld in field_list]:
|
if new_properties != [cstr(self.doc.fields[fld]) for fld in field_list]:
|
||||||
|
|||||||
@ -84,6 +84,9 @@ class DocType:
|
|||||||
new_warehouse = get_name_with_abbr(newdn, self.doc.company)
|
new_warehouse = get_name_with_abbr(newdn, self.doc.company)
|
||||||
|
|
||||||
if merge:
|
if merge:
|
||||||
|
if not webnotes.conn.exists("Warehouse", newdn):
|
||||||
|
webnotes.throw(_("Warehouse ") + newdn +_(" does not exists"))
|
||||||
|
|
||||||
if self.doc.company != webnotes.conn.get_value("Warehouse", new_warehouse, "company"):
|
if self.doc.company != webnotes.conn.get_value("Warehouse", new_warehouse, "company"):
|
||||||
webnotes.throw(_("Both Warehouse must belong to same Company"))
|
webnotes.throw(_("Both Warehouse must belong to same Company"))
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
from webnotes import _
|
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
columns = get_columns()
|
columns = get_columns()
|
||||||
@ -33,13 +32,6 @@ def get_columns():
|
|||||||
"Batch:Link/Batch:100", "Serial #:Link/Serial No:100", "Company:Link/Company:100"]
|
"Batch:Link/Batch:100", "Serial #:Link/Serial No:100", "Company:Link/Company:100"]
|
||||||
|
|
||||||
def get_stock_ledger_entries(filters):
|
def get_stock_ledger_entries(filters):
|
||||||
if not filters.get("company"):
|
|
||||||
webnotes.throw(_("Company is mandatory"))
|
|
||||||
if not filters.get("from_date"):
|
|
||||||
webnotes.throw(_("From Date is mandatory"))
|
|
||||||
if not filters.get("to_date"):
|
|
||||||
webnotes.throw(_("To Date is mandatory"))
|
|
||||||
|
|
||||||
return webnotes.conn.sql("""select concat_ws(" ", posting_date, posting_time) as date,
|
return webnotes.conn.sql("""select concat_ws(" ", posting_date, posting_time) as date,
|
||||||
item_code, warehouse, actual_qty, qty_after_transaction,
|
item_code, warehouse, actual_qty, qty_after_transaction,
|
||||||
stock_value, voucher_type, voucher_no, batch_no, serial_no, company
|
stock_value, voucher_type, voucher_no, batch_no, serial_no, company
|
||||||
|
|||||||
@ -7,9 +7,7 @@ wn.query_reports["Stock Projected Qty"] = {
|
|||||||
"fieldname":"company",
|
"fieldname":"company",
|
||||||
"label": wn._("Company"),
|
"label": wn._("Company"),
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"options": "Company",
|
"options": "Company"
|
||||||
"default": wn.defaults.get_user_default("company"),
|
|
||||||
"reqd": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname":"warehouse",
|
"fieldname":"warehouse",
|
||||||
|
|||||||
@ -13,7 +13,7 @@ def execute(filters=None):
|
|||||||
projected_qty, item.re_order_level, item.re_order_qty
|
projected_qty, item.re_order_level, item.re_order_qty
|
||||||
from `tabBin` bin,
|
from `tabBin` bin,
|
||||||
(select name, company from tabWarehouse
|
(select name, company from tabWarehouse
|
||||||
where company=%(company)s {warehouse_conditions}) wh,
|
{warehouse_conditions}) wh,
|
||||||
(select name, item_name, description, stock_uom, item_group,
|
(select name, item_name, description, stock_uom, item_group,
|
||||||
brand, re_order_level, re_order_qty
|
brand, re_order_level, re_order_qty
|
||||||
from `tabItem` {item_conditions}) item
|
from `tabItem` {item_conditions}) item
|
||||||
@ -41,4 +41,10 @@ def get_item_conditions(filters):
|
|||||||
return "where {}".format(" and ".join(conditions)) if conditions else ""
|
return "where {}".format(" and ".join(conditions)) if conditions else ""
|
||||||
|
|
||||||
def get_warehouse_conditions(filters):
|
def get_warehouse_conditions(filters):
|
||||||
return " and name=%(warehouse)s" if filters.get("warehouse") else ""
|
conditions = []
|
||||||
|
if filters.get("company"):
|
||||||
|
conditions.append("company=%(company)s")
|
||||||
|
if filters.get("warehouse"):
|
||||||
|
conditions.append("name=%(warehouse)s")
|
||||||
|
|
||||||
|
return "where {}".format(" and ".join(conditions)) if conditions else ""
|
||||||
Loading…
x
Reference in New Issue
Block a user