Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
commit
06ae34b015
@ -540,8 +540,7 @@ class DocType(SellingController):
|
|||||||
if not w:
|
if not w:
|
||||||
ps = webnotes.conn.sql("select name, warehouse from `tabPOS Setting` where ifnull(user,'') = '' and company = '%s'" % self.doc.company)
|
ps = webnotes.conn.sql("select name, warehouse from `tabPOS Setting` where ifnull(user,'') = '' and company = '%s'" % self.doc.company)
|
||||||
if not ps:
|
if not ps:
|
||||||
msgprint("To make POS entry, please create POS Setting from Accounts --> POS Setting page and refresh the system.")
|
msgprint("To make POS entry, please create POS Setting from Accounts --> POS Setting page and refresh the system.", raise_exception=True)
|
||||||
raise Exception
|
|
||||||
elif not ps[0][1]:
|
elif not ps[0][1]:
|
||||||
msgprint("Please enter warehouse in POS Setting")
|
msgprint("Please enter warehouse in POS Setting")
|
||||||
else:
|
else:
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
wn.provide("erpnext.buying");
|
wn.provide("erpnext.buying");
|
||||||
|
|
||||||
erpnext.buying.BuyingController = erpnext.utils.Controller.extend({
|
erpnext.buying.BuyingController = wn.ui.form.Controller.extend({
|
||||||
setup: function() {
|
setup: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
@ -68,15 +68,15 @@ erpnext.buying.BuyingController = erpnext.utils.Controller.extend({
|
|||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if(!r.exc) {
|
if(!r.exc) {
|
||||||
me.price_list_currency();
|
me.price_list_currency();
|
||||||
if (callback_fn) callback_fn(me.frm.doc, me.frm.doc.doctype,
|
if (typeof callback_fn === "function")
|
||||||
me.frm.doc.name);
|
callback_fn(me.frm.doc, me.frm.doc.doctype, me.frm.doc.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
me.price_list_currency();
|
me.price_list_currency();
|
||||||
if (callback_fn) callback_fn(me.frm.doc, me.frm.doc.doctype,
|
if (typeof callback_fn === "function")
|
||||||
me.frm.doc.name);
|
callback_fn(me.frm.doc, me.frm.doc.doctype, me.frm.doc.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -132,6 +132,10 @@ class DocType(BuyingController):
|
|||||||
for d in getlist(self.doclist, 'po_details'):
|
for d in getlist(self.doclist, 'po_details'):
|
||||||
#1. Check if is_stock_item == 'Yes'
|
#1. Check if is_stock_item == 'Yes'
|
||||||
if webnotes.conn.get_value("Item", d.item_code, "is_stock_item") == "Yes":
|
if webnotes.conn.get_value("Item", d.item_code, "is_stock_item") == "Yes":
|
||||||
|
# this happens when item is changed from non-stock to stock item
|
||||||
|
if not d.warehouse:
|
||||||
|
continue
|
||||||
|
|
||||||
ind_qty, po_qty = 0, flt(d.qty) * flt(d.conversion_factor)
|
ind_qty, po_qty = 0, flt(d.qty) * flt(d.conversion_factor)
|
||||||
if is_stopped:
|
if is_stopped:
|
||||||
po_qty = flt(d.qty) > flt(d.received_qty) and \
|
po_qty = flt(d.qty) > flt(d.received_qty) and \
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
erpnext.updates = [
|
erpnext.updates = [
|
||||||
["5th March", ["Refactored Upload Attendace Tool"]],
|
["12th March", ["Updates to website module. Added more options in Style Settings and Website Settings."]],
|
||||||
|
["5th March", ["Refactored Upload Attendance Tool"]],
|
||||||
["4th March", ["Lead organization added in Quotation classic/spartan/modern print format"]],
|
["4th March", ["Lead organization added in Quotation classic/spartan/modern print format"]],
|
||||||
["1st March", [
|
["1st March", [
|
||||||
"Time Log, Time Log Batch: Created feature to batch Time Logs so that they can be tracked for billing.",
|
"Time Log, Time Log Batch: Created feature to batch Time Logs so that they can be tracked for billing.",
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
|
|
||||||
from webnotes.utils import getdate, validate_email_add
|
from webnotes.utils import getdate, validate_email_add, cstr
|
||||||
from webnotes.model.doc import make_autoname
|
from webnotes.model.doc import make_autoname
|
||||||
from webnotes import msgprint, _
|
from webnotes import msgprint, _
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ class DocType:
|
|||||||
fname, fid = file_args.split(",")
|
fname, fid = file_args.split(",")
|
||||||
if self.doc.image == fname:
|
if self.doc.image == fname:
|
||||||
new_file_args = fname + "," + fid
|
new_file_args = fname + "," + fid
|
||||||
file_list = profile_wrapper.doc.file_list.split("\n")
|
file_list = cstr(profile_wrapper.doc.file_list).split("\n")
|
||||||
if new_file_args not in file_list:
|
if new_file_args not in file_list:
|
||||||
file_list += [new_file_args]
|
file_list += [new_file_args]
|
||||||
profile_wrapper.doc.file_list = "\n".join(file_list)
|
profile_wrapper.doc.file_list = "\n".join(file_list)
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
wn.require("public/app/js/utils.js");
|
wn.require("public/app/js/utils.js");
|
||||||
wn.provide("erpnext.hr");
|
wn.provide("erpnext.hr");
|
||||||
|
|
||||||
erpnext.hr.AttendanceControlPanel = erpnext.utils.Controller.extend({
|
erpnext.hr.AttendanceControlPanel = wn.ui.form.Controller.extend({
|
||||||
onload: function() {
|
onload: function() {
|
||||||
this.frm.set_value("att_fr_date", get_today());
|
this.frm.set_value("att_fr_date", get_today());
|
||||||
this.frm.set_value("att_to_date", get_today());
|
this.frm.set_value("att_to_date", get_today());
|
||||||
|
@ -6,4 +6,4 @@ def execute():
|
|||||||
webnotes.reload_doc('website', 'doctype', 'blog_post')
|
webnotes.reload_doc('website', 'doctype', 'blog_post')
|
||||||
webnotes.conn.sql('''update tabBlogger set posts=(select count(*)
|
webnotes.conn.sql('''update tabBlogger set posts=(select count(*)
|
||||||
from `tabBlog Post` where ifnull(blogger,"")=tabBlogger.name)''')
|
from `tabBlog Post` where ifnull(blogger,"")=tabBlogger.name)''')
|
||||||
webnotes.conn.sql("""update `tabBlog Post` set published_on=creation""")
|
webnotes.conn.sql("""update `tabBlog Post` set published_on=date(creation)""")
|
||||||
|
@ -18,7 +18,7 @@ wn.provide("erpnext.projects");
|
|||||||
|
|
||||||
cur_frm.add_fetch("project", "company", "company");
|
cur_frm.add_fetch("project", "company", "company");
|
||||||
|
|
||||||
erpnext.projects.Task = erpnext.utils.Controller.extend({
|
erpnext.projects.Task = wn.ui.form.Controller.extend({
|
||||||
setup: function() {
|
setup: function() {
|
||||||
this.frm.fields_dict.project.get_query = function() {
|
this.frm.fields_dict.project.get_query = function() {
|
||||||
return "select name from `tabProject` \
|
return "select name from `tabProject` \
|
||||||
@ -29,7 +29,8 @@ erpnext.projects.Task = erpnext.utils.Controller.extend({
|
|||||||
|
|
||||||
project: function() {
|
project: function() {
|
||||||
if(this.frm.doc.project) {
|
if(this.frm.doc.project) {
|
||||||
get_server_fields('get_project_details', '','', doc, cdt, cdn, 1);
|
get_server_fields('get_project_details', '','', this.frm.doc, this.frm.doc.doctype,
|
||||||
|
this.frm.doc.name, 1);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
wn.provide("erpnext.stock");
|
wn.provide("erpnext.stock");
|
||||||
|
|
||||||
erpnext.stock.StockController = erpnext.utils.Controller.extend({
|
erpnext.stock.StockController = wn.ui.form.Controller.extend({
|
||||||
show_stock_ledger: function() {
|
show_stock_ledger: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
this.frm.add_custom_button("Show Stock Ledger", function() {
|
this.frm.add_custom_button("Show Stock Ledger", function() {
|
||||||
|
@ -23,35 +23,4 @@ erpnext.get_currency = function(company) {
|
|||||||
return wn.model.get(":Company", company).default_currency || wn.boot.sysdefaults.currency;
|
return wn.model.get(":Company", company).default_currency || wn.boot.sysdefaults.currency;
|
||||||
else
|
else
|
||||||
return wn.boot.sysdefaults.currency;
|
return wn.boot.sysdefaults.currency;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
|
||||||
erpnext.utils.Controller = Class.extend({
|
|
||||||
init: function(opts) {
|
|
||||||
$.extend(this, opts);
|
|
||||||
this.setup && this.setup();
|
|
||||||
},
|
|
||||||
|
|
||||||
onload_post_render: function() {
|
|
||||||
if(this.frm.doc.__islocal) {
|
|
||||||
this.setup_defaults();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
setup_defaults: function() {
|
|
||||||
var me = this;
|
|
||||||
|
|
||||||
var defaults = {
|
|
||||||
posting_date: wn.datetime.get_today(),
|
|
||||||
posting_time: wn.datetime.now_time()
|
|
||||||
}
|
|
||||||
|
|
||||||
$.each(defaults, function(k, v) {
|
|
||||||
if(!me.frm.doc[k]) me.frm.set_value(k, v);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
refresh: function() {
|
|
||||||
erpnext.hide_naming_series();
|
|
||||||
}
|
|
||||||
});
|
|
@ -156,9 +156,13 @@ class DocType(SellingController):
|
|||||||
f = [d.item_code, d.description]
|
f = [d.item_code, d.description]
|
||||||
|
|
||||||
#check item is stock item
|
#check item is stock item
|
||||||
st_itm = sql("select is_stock_item from `tabItem` where name = '%s'"%d.item_code)
|
st_itm = sql("select is_stock_item from `tabItem` where name = %s", d.item_code)
|
||||||
|
|
||||||
if st_itm and st_itm[0][0] == 'Yes':
|
if st_itm and st_itm[0][0] == 'Yes':
|
||||||
|
if not d.reserved_warehouse:
|
||||||
|
msgprint("""Please enter Reserved Warehouse for item %s
|
||||||
|
as it is stock Item""" % d.item_code, raise_exception=1)
|
||||||
|
|
||||||
if e in check_list:
|
if e in check_list:
|
||||||
msgprint("Item %s has been entered twice." % d.item_code)
|
msgprint("Item %s has been entered twice." % d.item_code)
|
||||||
else:
|
else:
|
||||||
@ -333,10 +337,6 @@ class DocType(SellingController):
|
|||||||
def update_stock_ledger(self, update_stock, is_stopped = 0):
|
def update_stock_ledger(self, update_stock, is_stopped = 0):
|
||||||
for d in self.get_item_list(is_stopped):
|
for d in self.get_item_list(is_stopped):
|
||||||
if webnotes.conn.get_value("Item", d['item_code'], "is_stock_item") == "Yes":
|
if webnotes.conn.get_value("Item", d['item_code'], "is_stock_item") == "Yes":
|
||||||
if not d['reserved_warehouse']:
|
|
||||||
msgprint("""Please enter Reserved Warehouse for item %s
|
|
||||||
as it is stock Item""" % d['item_code'], raise_exception=1)
|
|
||||||
|
|
||||||
args = {
|
args = {
|
||||||
"item_code": d['item_code'],
|
"item_code": d['item_code'],
|
||||||
"reserved_qty": flt(update_stock) * flt(d['reserved_qty']),
|
"reserved_qty": flt(update_stock) * flt(d['reserved_qty']),
|
||||||
|
@ -98,12 +98,6 @@ wn.module_page["Setup"] = [
|
|||||||
label:wn._("Print Heading"),
|
label:wn._("Print Heading"),
|
||||||
"description":wn._("Add headers for standard print formats")
|
"description":wn._("Add headers for standard print formats")
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"route":"Form/Style Settings/Style Settings",
|
|
||||||
doctype:wn._("Style Settings"),
|
|
||||||
label:wn._("Style Settings"),
|
|
||||||
"description":wn._("Change background fonts etc")
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -156,7 +156,7 @@ class DocType(SellingController):
|
|||||||
if not self.doc.billing_status: self.doc.billing_status = 'Not Billed'
|
if not self.doc.billing_status: self.doc.billing_status = 'Not Billed'
|
||||||
if not self.doc.installation_status: self.doc.installation_status = 'Not Installed'
|
if not self.doc.installation_status: self.doc.installation_status = 'Not Installed'
|
||||||
|
|
||||||
|
|
||||||
def validate_mandatory(self):
|
def validate_mandatory(self):
|
||||||
if self.doc.amended_from and not self.doc.amendment_date:
|
if self.doc.amended_from and not self.doc.amendment_date:
|
||||||
msgprint("Please Enter Amendment Date")
|
msgprint("Please Enter Amendment Date")
|
||||||
@ -338,10 +338,10 @@ class DocType(SellingController):
|
|||||||
self.values = []
|
self.values = []
|
||||||
for d in self.get_item_list():
|
for d in self.get_item_list():
|
||||||
if webnotes.conn.get_value("Item", d['item_code'], "is_stock_item") == "Yes":
|
if webnotes.conn.get_value("Item", d['item_code'], "is_stock_item") == "Yes":
|
||||||
if not d['warehouse']:
|
# this happens when item is changed from non-stock to stock item
|
||||||
msgprint("Please enter Warehouse for item %s as it is stock item"
|
if not d["warehouse"]:
|
||||||
% d['item_code'], raise_exception=1)
|
continue
|
||||||
|
|
||||||
if d['reserved_qty'] < 0 :
|
if d['reserved_qty'] < 0 :
|
||||||
# Reduce reserved qty from reserved warehouse mentioned in so
|
# Reduce reserved qty from reserved warehouse mentioned in so
|
||||||
args = {
|
args = {
|
||||||
@ -407,6 +407,15 @@ class DocType(SellingController):
|
|||||||
webnotes.conn.set_value("Delivery Note Item", item.name, "buying_amount",
|
webnotes.conn.set_value("Delivery Note Item", item.name, "buying_amount",
|
||||||
item.buying_amount)
|
item.buying_amount)
|
||||||
|
|
||||||
|
self.validate_warehouse()
|
||||||
|
|
||||||
|
def validate_warehouse(self):
|
||||||
|
for d in self.get_item_list():
|
||||||
|
if webnotes.conn.get_value("Item", d['item_code'], "is_stock_item") == "Yes":
|
||||||
|
if not d['warehouse']:
|
||||||
|
msgprint("Please enter Warehouse for item %s as it is stock item"
|
||||||
|
% d['item_code'], raise_exception=1)
|
||||||
|
|
||||||
def make_gl_entries(self):
|
def make_gl_entries(self):
|
||||||
if not cint(webnotes.defaults.get_global_default("auto_inventory_accounting")):
|
if not cint(webnotes.defaults.get_global_default("auto_inventory_accounting")):
|
||||||
return
|
return
|
||||||
@ -440,4 +449,4 @@ class DocType(SellingController):
|
|||||||
def get_total_buying_amount(self):
|
def get_total_buying_amount(self):
|
||||||
total_buying_amount = sum([item.buying_amount for item in
|
total_buying_amount = sum([item.buying_amount for item in
|
||||||
self.doclist.get({"parentfield": "delivery_note_details"})])
|
self.doclist.get({"parentfield": "delivery_note_details"})])
|
||||||
return total_buying_amount
|
return total_buying_amount
|
||||||
|
@ -20,15 +20,12 @@ import webnotes
|
|||||||
from webnotes.utils import cstr, flt
|
from webnotes.utils import cstr, flt
|
||||||
from webnotes.model.doc import addchild
|
from webnotes.model.doc import addchild
|
||||||
from webnotes.model.bean import getlist
|
from webnotes.model.bean import getlist
|
||||||
from webnotes import msgprint
|
from webnotes import msgprint, _
|
||||||
|
|
||||||
sql = webnotes.conn.sql
|
sql = webnotes.conn.sql
|
||||||
|
|
||||||
class DocType:
|
from webnotes.model.controller import DocListController
|
||||||
def __init__(self, doc, doclist=[]):
|
class DocType(DocListController):
|
||||||
self.doc = doc
|
|
||||||
self.doclist = doclist
|
|
||||||
|
|
||||||
def get_tax_rate(self, tax_type):
|
def get_tax_rate(self, tax_type):
|
||||||
rate = sql("select tax_rate from tabAccount where name = %s", tax_type)
|
rate = sql("select tax_rate from tabAccount where name = %s", tax_type)
|
||||||
ret = {
|
ret = {
|
||||||
@ -196,6 +193,8 @@ class DocType:
|
|||||||
|
|
||||||
if self.doc.name:
|
if self.doc.name:
|
||||||
self.old_page_name = webnotes.conn.get_value('Item', self.doc.name, 'page_name')
|
self.old_page_name = webnotes.conn.get_value('Item', self.doc.name, 'page_name')
|
||||||
|
|
||||||
|
self.validate_is_stock_item()
|
||||||
|
|
||||||
def check_non_asset_warehouse(self):
|
def check_non_asset_warehouse(self):
|
||||||
if self.doc.is_asset_item == "Yes":
|
if self.doc.is_asset_item == "Yes":
|
||||||
@ -215,6 +214,15 @@ class DocType:
|
|||||||
'description' : file and file[0]['description'] or ''
|
'description' : file and file[0]['description'] or ''
|
||||||
}
|
}
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
def validate_is_stock_item(self):
|
||||||
|
if not self.doc.fields.get("__islocal"):
|
||||||
|
if webnotes.conn.get_value("Item", self.doc.name, "is_stock_item")=="Yes" and \
|
||||||
|
((not self.doc.is_stock_item) or self.doc.is_stock_item == "No"):
|
||||||
|
if self.check_if_sle_exists() == "exists":
|
||||||
|
webnotes.msgprint(self.meta.get_label("is_stock_item") + ": "
|
||||||
|
+ _("""Cannot change to Yes. Reason: Stock Ledger Entries exist for""")
|
||||||
|
+ """ "%s" """ % self.doc.name, raise_exception=True)
|
||||||
|
|
||||||
def check_if_sle_exists(self):
|
def check_if_sle_exists(self):
|
||||||
sle = sql("select name from `tabStock Ledger Entry` where item_code = %s and ifnull(is_cancelled, 'No') = 'No'", self.doc.name)
|
sle = sql("select name from `tabStock Ledger Entry` where item_code = %s and ifnull(is_cancelled, 'No') = 'No'", self.doc.name)
|
||||||
|
@ -125,7 +125,7 @@ class DocType(BuyingController):
|
|||||||
self.update_raw_materials_supplied("pr_raw_material_details")
|
self.update_raw_materials_supplied("pr_raw_material_details")
|
||||||
|
|
||||||
self.update_valuation_rate("purchase_receipt_details")
|
self.update_valuation_rate("purchase_receipt_details")
|
||||||
|
|
||||||
def on_update(self):
|
def on_update(self):
|
||||||
if self.doc.rejected_warehouse:
|
if self.doc.rejected_warehouse:
|
||||||
for d in getlist(self.doclist,'purchase_receipt_details'):
|
for d in getlist(self.doclist,'purchase_receipt_details'):
|
||||||
@ -146,6 +146,9 @@ class DocType(BuyingController):
|
|||||||
self.values = []
|
self.values = []
|
||||||
for d in getlist(self.doclist, 'purchase_receipt_details'):
|
for d in getlist(self.doclist, 'purchase_receipt_details'):
|
||||||
if webnotes.conn.get_value("Item", d.item_code, "is_stock_item") == "Yes":
|
if webnotes.conn.get_value("Item", d.item_code, "is_stock_item") == "Yes":
|
||||||
|
if not d.warehouse:
|
||||||
|
continue
|
||||||
|
|
||||||
ord_qty = 0
|
ord_qty = 0
|
||||||
pr_qty = flt(d.qty) * flt(d.conversion_factor)
|
pr_qty = flt(d.qty) * flt(d.conversion_factor)
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@ wn.provide("erpnext.stock");
|
|||||||
|
|
||||||
erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
|
erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
|
||||||
onload_post_render: function() {
|
onload_post_render: function() {
|
||||||
this._super();
|
|
||||||
if(this.frm.doc.__islocal && (this.frm.doc.production_order || this.frm.doc.bom_no)
|
if(this.frm.doc.__islocal && (this.frm.doc.production_order || this.frm.doc.bom_no)
|
||||||
&& !getchildren('Stock Entry Detail', this.frm.doc.name, 'mtn_details').length) {
|
&& !getchildren('Stock Entry Detail', this.frm.doc.name, 'mtn_details').length) {
|
||||||
// if production order / bom is mentioned, get items
|
// if production order / bom is mentioned, get items
|
||||||
@ -28,7 +27,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
refresh: function() {
|
refresh: function() {
|
||||||
this._super();
|
erpnext.hide_naming_series();
|
||||||
this.toggle_related_fields(this.frm.doc);
|
this.toggle_related_fields(this.frm.doc);
|
||||||
this.toggle_enable_bom();
|
this.toggle_enable_bom();
|
||||||
if (this.frm.doc.docstatus==1) {
|
if (this.frm.doc.docstatus==1) {
|
||||||
|
@ -29,9 +29,9 @@ import json
|
|||||||
|
|
||||||
sql = webnotes.conn.sql
|
sql = webnotes.conn.sql
|
||||||
|
|
||||||
from utilities.transaction_base import TransactionBase
|
from controllers.accounts_controller import AccountsController
|
||||||
|
|
||||||
class DocType(TransactionBase):
|
class DocType(AccountsController):
|
||||||
def __init__(self, doc, doclist=[]):
|
def __init__(self, doc, doclist=[]):
|
||||||
self.doc = doc
|
self.doc = doc
|
||||||
self.doclist = doclist
|
self.doclist = doclist
|
||||||
@ -44,12 +44,14 @@ class DocType(TransactionBase):
|
|||||||
pro_obj = self.doc.production_order and \
|
pro_obj = self.doc.production_order and \
|
||||||
get_obj('Production Order', self.doc.production_order) or None
|
get_obj('Production Order', self.doc.production_order) or None
|
||||||
|
|
||||||
|
self.validate_item()
|
||||||
self.validate_warehouse(pro_obj)
|
self.validate_warehouse(pro_obj)
|
||||||
self.validate_production_order(pro_obj)
|
self.validate_production_order(pro_obj)
|
||||||
self.get_stock_and_rate()
|
self.get_stock_and_rate()
|
||||||
self.validate_incoming_rate()
|
self.validate_incoming_rate()
|
||||||
self.validate_bom()
|
self.validate_bom()
|
||||||
self.validate_finished_goods()
|
self.validate_finished_goods()
|
||||||
|
|
||||||
self.validate_return_reference_doc()
|
self.validate_return_reference_doc()
|
||||||
|
|
||||||
self.validate_with_material_request()
|
self.validate_with_material_request()
|
||||||
@ -78,6 +80,12 @@ class DocType(TransactionBase):
|
|||||||
sl_obj.scrub_serial_nos(self)
|
sl_obj.scrub_serial_nos(self)
|
||||||
sl_obj.validate_serial_no(self, 'mtn_details')
|
sl_obj.validate_serial_no(self, 'mtn_details')
|
||||||
|
|
||||||
|
def validate_item(self):
|
||||||
|
for item in self.doclist.get({"parentfield": "mtn_details"}):
|
||||||
|
if item.item_code not in self.stock_items:
|
||||||
|
msgprint(_("""Only Stock Items are allowed for Stock Entry"""),
|
||||||
|
raise_exception=True)
|
||||||
|
|
||||||
def validate_warehouse(self, pro_obj):
|
def validate_warehouse(self, pro_obj):
|
||||||
"""perform various (sometimes conditional) validations on warehouse"""
|
"""perform various (sometimes conditional) validations on warehouse"""
|
||||||
|
|
||||||
|
@ -7,16 +7,16 @@ from website.utils import url_for_website
|
|||||||
class DocType:
|
class DocType:
|
||||||
def __init__(self, d, dl):
|
def __init__(self, d, dl):
|
||||||
self.doc, self.doclist = d, dl
|
self.doc, self.doclist = d, dl
|
||||||
|
|
||||||
def onload(self):
|
|
||||||
"""load employee"""
|
|
||||||
emp_list = []
|
|
||||||
for d in self.doclist.get({"doctype":"About Us Team Member"}):
|
|
||||||
emp = webnotes.doc("Employee", d.employee)
|
|
||||||
emp.image = url_for_website(emp.image)
|
|
||||||
emp_list.append(emp)
|
|
||||||
self.doclist += emp_list
|
|
||||||
|
|
||||||
def on_update(self):
|
def on_update(self):
|
||||||
from website.utils import clear_cache
|
from website.utils import clear_cache
|
||||||
clear_cache("about")
|
clear_cache("about")
|
||||||
|
|
||||||
|
def get_args():
|
||||||
|
obj = webnotes.get_obj("About Us Settings")
|
||||||
|
for d in obj.doclist.get({"doctype":"About Us Team Member"}):
|
||||||
|
if not "/" in d.image_link:
|
||||||
|
d.image_link = "files/" + d.image_link
|
||||||
|
return {
|
||||||
|
"obj": obj
|
||||||
|
}
|
@ -1,12 +1,13 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"creation": "2013-01-10 16:34:32",
|
"creation": "2013-03-07 15:53:15",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2013-01-22 14:12:16",
|
"modified": "2013-03-12 13:51:29",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_attach": 1,
|
||||||
"description": "Settings for the About Us Page",
|
"description": "Settings for the About Us Page",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "Master",
|
"document_type": "Master",
|
||||||
@ -31,7 +32,7 @@
|
|||||||
"parenttype": "DocType",
|
"parenttype": "DocType",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 1,
|
"report": 0,
|
||||||
"role": "Website Manager",
|
"role": "Website Manager",
|
||||||
"submit": 0,
|
"submit": 0,
|
||||||
"write": 1
|
"write": 1
|
||||||
@ -101,6 +102,15 @@
|
|||||||
"fieldtype": "Text Editor",
|
"fieldtype": "Text Editor",
|
||||||
"label": "Footer"
|
"label": "Footer"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"doctype": "DocField",
|
||||||
|
"fieldname": "file_list",
|
||||||
|
"fieldtype": "Text",
|
||||||
|
"hidden": 1,
|
||||||
|
"label": "File List",
|
||||||
|
"no_copy": 1,
|
||||||
|
"print_hide": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocPerm"
|
"doctype": "DocPerm"
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"creation": "2013-02-22 01:28:07",
|
"creation": "2013-03-07 11:55:11",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2013-03-07 07:03:18",
|
"modified": "2013-03-12 13:51:02",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
@ -14,23 +14,38 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "employee",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "Employee",
|
|
||||||
"name": "__common__",
|
"name": "__common__",
|
||||||
"options": "Employee",
|
|
||||||
"parent": "About Us Team Member",
|
"parent": "About Us Team Member",
|
||||||
"parentfield": "fields",
|
"parentfield": "fields",
|
||||||
"parenttype": "DocType",
|
"parenttype": "DocType",
|
||||||
"permlevel": 0,
|
"permlevel": 0
|
||||||
"print_width": "300px",
|
|
||||||
"width": "300px"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"name": "About Us Team Member"
|
"name": "About Us Team Member"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocField"
|
"doctype": "DocField",
|
||||||
|
"fieldname": "full_name",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"label": "Full Name",
|
||||||
|
"reqd": 1,
|
||||||
|
"width": "150px"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "DocField",
|
||||||
|
"fieldname": "image_link",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"label": "Image Link",
|
||||||
|
"options": "attach_files:",
|
||||||
|
"width": "150px"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "DocField",
|
||||||
|
"fieldname": "bio",
|
||||||
|
"fieldtype": "Small Text",
|
||||||
|
"label": "Bio",
|
||||||
|
"reqd": 1,
|
||||||
|
"width": "200px"
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"creation": "2013-03-08 11:36:53",
|
"creation": "2013-03-08 11:36:53",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2013-03-12 11:34:32",
|
"modified": "2013-03-12 13:35:14",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
@ -65,6 +65,12 @@
|
|||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"label": "Page Background"
|
"label": "Page Background"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"doctype": "DocField",
|
||||||
|
"fieldname": "page_border",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Page Border"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "page_headings",
|
"fieldname": "page_headings",
|
||||||
@ -83,16 +89,11 @@
|
|||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"label": "Page Links"
|
"label": "Page Links"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"doctype": "DocField",
|
|
||||||
"fieldname": "page_border",
|
|
||||||
"fieldtype": "Check",
|
|
||||||
"label": "Page Border"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "cb0",
|
"fieldname": "cb0",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
|
"label": "Top Bar",
|
||||||
"print_width": "50%",
|
"print_width": "50%",
|
||||||
"width": "50%"
|
"width": "50%"
|
||||||
},
|
},
|
||||||
|
@ -8,6 +8,5 @@
|
|||||||
</div>
|
</div>
|
||||||
<div style="height: 100px; overflow: hidden; font-size: 80%;">
|
<div style="height: 100px; overflow: hidden; font-size: 80%;">
|
||||||
<h4 style="margin-bottom: 2px;"><a href="{{ page_name }}">{{ item_name }}</a></h4>
|
<h4 style="margin-bottom: 2px;"><a href="{{ page_name }}">{{ item_name }}</a></h4>
|
||||||
<p class="help">Item Code: {{ name }}</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@ -7,34 +7,27 @@
|
|||||||
{{ obj.doc.company_introduction or "<h2>About Us</h2><p>Some Introduction about your company that you would like your website visitor to know. More people than you think will read your About page. People always like to know who the are doing business with. Be authentic and avoid using jargon like 'value added services' etc. Be sure to update your company history and list of key team members in Website > About Us Settings</p>" }}
|
{{ obj.doc.company_introduction or "<h2>About Us</h2><p>Some Introduction about your company that you would like your website visitor to know. More people than you think will read your About page. People always like to know who the are doing business with. Be authentic and avoid using jargon like 'value added services' etc. Be sure to update your company history and list of key team members in Website > About Us Settings</p>" }}
|
||||||
{% if obj.doclist.get({"doctype":"Company History"}) %}
|
{% if obj.doclist.get({"doctype":"Company History"}) %}
|
||||||
<h3>{{ obj.doc.company_history_heading or "Company History" }}</h3>
|
<h3>{{ obj.doc.company_history_heading or "Company History" }}</h3>
|
||||||
<table class="table table-bordered" style="width: 100%; table-layout: fixed">
|
{% for d in obj.doclist.get({"doctype":"Company History"}) %}
|
||||||
<tbody>
|
<div class="row">
|
||||||
{% for d in obj.doclist.get({"doctype":"Company History"}) %}
|
<span class="span2" style="text-align: right"><h4 style="margin:0px;">{{ d.year }}</h4></span>
|
||||||
<tr>
|
<span class="span10"><p>{{ d.highlight }}</p></span>
|
||||||
<td style="width: 30%; text-align: right"><h4>{{ d.year }}</h4></td>
|
</div>
|
||||||
<td>{{ d.highlight }}</td>
|
{% endfor %}
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if obj.doclist.get({"doctype":"Employee"}) %}
|
{% if obj.doclist.get({"doctype":"About Us Team Member"}) %}
|
||||||
<h3>{{ obj.doc.team_members_heading or "Team Members" }}</h3>
|
<h3>{{ obj.doc.team_members_heading or "Team Members" }}</h3>
|
||||||
<table class="table" style="width: 100%; table-layout: fixed">
|
{% for d in obj.doclist.get({"doctype":"About Us Team Member"}) %}
|
||||||
<tbody>
|
<div class="row" itemscope itemtype="http://schema.org/Person">
|
||||||
{% for d in obj.doclist.get({"doctype":"Employee"}) %}
|
<span class="span2">
|
||||||
<tr itemscope itemtype="http://schema.org/Person">
|
<div class="avatar avatar-large">
|
||||||
<td style="text-align:right; width: 20%;">
|
<img class="avatar" src="{{ d.image }}" style="" itemprop="image">
|
||||||
<div class="avatar avatar-x-large">
|
</div>
|
||||||
<img class="avatar" src="{{ d.image }}" style="" itemprop="image">
|
</span>
|
||||||
</div>
|
<span class="span10"><h4 itemprop="name">{{ d.full_name }}</h4>
|
||||||
</td>
|
<div itemprop="description">{{ d.bio }}</div>
|
||||||
<td><h4 itemprop="name">{{ d.employee_name }}</h4>
|
</span>
|
||||||
<div itemprop="description">{{ d.bio }}</div></td>
|
</div>
|
||||||
</tr>
|
{% endfor %}
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ obj.doc.footer or "" }}
|
{{ obj.doc.footer or "" }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -40,7 +40,7 @@ page_map = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
page_settings_map = {
|
page_settings_map = {
|
||||||
"about": "About Us Settings",
|
"about": "website.doctype.about_us_settings.about_us_settings.get_args",
|
||||||
"contact": "Contact Us Settings",
|
"contact": "Contact Us Settings",
|
||||||
"blog": "website.helpers.blog.get_blog_template_args",
|
"blog": "website.helpers.blog.get_blog_template_args",
|
||||||
"writers": "website.helpers.blog.get_writers_args"
|
"writers": "website.helpers.blog.get_writers_args"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user