fix: Test case and styling fixes

This commit is contained in:
deepeshgarg007 2019-04-22 20:24:31 +05:30
parent d249325d98
commit 555f425da1
3 changed files with 6 additions and 5 deletions

View File

@ -139,13 +139,13 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
}, __('Create'))
}
if (doc.docstatus == 1 && !doc.inter_company_order_reference) {
if (doc.docstatus === 1 && !doc.inter_company_order_reference) {
let me = this;
frappe.model.with_doc("Supplier", me.frm.doc.supplier, () => {
let supplier = frappe.model.get_doc("Supplier", me.frm.doc.supplier);
let internal = supplier.is_internal_supplier;
let disabled = supplier.disabled;
if (internal == 1 && disabled == 0) {
if (internal === 1 && disabled === 0) {
me.frm.add_custom_button("Inter Company Order", function() {
me.make_inter_company_order(me.frm);
}, __('Create'));

View File

@ -205,13 +205,13 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
}, __('Create'))
}
if (doc.docstatus == 1 && !doc.inter_company_order_reference) {
if (doc.docstatus === 1 && !doc.inter_company_order_reference) {
let me = this;
frappe.model.with_doc("Customer", me.frm.doc.customer, () => {
let customer = frappe.model.get_doc("Customer", me.frm.doc.customer);
let internal = customer.is_internal_customer;
let disabled = customer.disabled;
if (internal == 1 && disabled == 0) {
if (internal === 1 && disabled === 0) {
me.frm.add_custom_button("Inter Company Order", function() {
me.make_inter_company_order();
}, __('Create'));

View File

@ -478,7 +478,7 @@ def validate_inter_company_party(doctype, party, company, inter_company_order_re
elif frappe.db.get_value(partytype, {"name": party, internal: 1}, "name") == party:
companies = frappe.db.sql("""select company from `tabAllowed To Transact With`
where parenttype = '{0}' and parent = '{1}'""".format(partytype, party), as_list = 1)
where parenttype = '{0}' and parent = '{1}'""".format(partytype, party), as_list = 1) #nosec
companies = [d[0] for d in companies]
if not company in companies:
frappe.throw(_("{0} not allowed to transact with {1}. Please change the Company.").format(partytype, company))
@ -805,6 +805,7 @@ def make_purchase_order_for_drop_shipment(source_name, for_supplier=None, target
target.apply_discount_on = ""
target.additional_discount_percentage = 0.0
target.discount_amount = 0.0
target.inter_company_order_reference = ""
default_price_list = frappe.get_value("Supplier", supplier, "default_price_list")
if default_price_list: