mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-16 19:49:18 +00:00
Merge branch 'develop' of github.com:frappe/erpnext into develop
This commit is contained in:
@@ -6,5 +6,5 @@ import frappe
|
|||||||
|
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
class ModeOfPayment(Document):
|
class ModeofPayment(Document):
|
||||||
pass
|
pass
|
||||||
@@ -17,8 +17,8 @@ class Employee(Document):
|
|||||||
self.salary_structure_exists = frappe.db.get_value("Salary Structure",
|
self.salary_structure_exists = frappe.db.get_value("Salary Structure",
|
||||||
{"employee": self.name, "is_active": "Yes", "docstatus": ["!=", 2]})
|
{"employee": self.name, "is_active": "Yes", "docstatus": ["!=", 2]})
|
||||||
|
|
||||||
def as_dict(self):
|
def as_dict(self, no_nulls=False):
|
||||||
doc = super(Employee, self).as_dict()
|
doc = super(Employee, self).as_dict(no_nulls)
|
||||||
|
|
||||||
if hasattr(self, "salary_structure_exists"):
|
if hasattr(self, "salary_structure_exists"):
|
||||||
doc["salary_structure_exists"] = self.salary_structure_exists
|
doc["salary_structure_exists"] = self.salary_structure_exists
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ $.extend(cur_frm.cscript, {
|
|||||||
this.frm.add_fetch("sales_order", "delivery_date", "expected_delivery_date");
|
this.frm.add_fetch("sales_order", "delivery_date", "expected_delivery_date");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
before_submit: function() {
|
||||||
|
cur_frm.toggle_reqd(["fg_warehouse", "wip_warehouse"], true);
|
||||||
|
},
|
||||||
|
|
||||||
refresh: function(doc, dt, dn) {
|
refresh: function(doc, dt, dn) {
|
||||||
this.frm.dashboard.reset();
|
this.frm.dashboard.reset();
|
||||||
erpnext.toggle_naming_series();
|
erpnext.toggle_naming_series();
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ cur_frm.cscript.download_materials_required = function(doc, cdt, cdn) {
|
|||||||
|
|
||||||
cur_frm.fields_dict['pp_details'].grid.get_field('item_code').get_query = function(doc) {
|
cur_frm.fields_dict['pp_details'].grid.get_field('item_code').get_query = function(doc) {
|
||||||
return erpnext.queries.item({
|
return erpnext.queries.item({
|
||||||
'ifnull(tabItem.is_pro_applicable, "No")': 'Yes'
|
'is_pro_applicable': 'Yes'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,18 +28,18 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
|
|||||||
|
|
||||||
cur_frm.add_custom_button(__('Send SMS'), cur_frm.cscript.send_sms, "icon-mobile-phone");
|
cur_frm.add_custom_button(__('Send SMS'), cur_frm.cscript.send_sms, "icon-mobile-phone");
|
||||||
// delivery note
|
// delivery note
|
||||||
if(flt(doc.per_delivered, 2) < 100 && doc.order_type=='Sales')
|
if(flt(doc.per_delivered, 2) < 100 && ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1)
|
||||||
cur_frm.add_custom_button(__('Make Delivery'), this.make_delivery_note);
|
cur_frm.add_custom_button(__('Make Delivery'), this.make_delivery_note);
|
||||||
|
|
||||||
// maintenance
|
// maintenance
|
||||||
if(flt(doc.per_delivered, 2) < 100 && (doc.order_type !='Sales')) {
|
if(flt(doc.per_delivered, 2) < 100 && ["Sales", "Shopping Cart"].indexOf(doc.order_type)===-1) {
|
||||||
cur_frm.add_custom_button(__('Make Maint. Visit'), this.make_maintenance_visit);
|
cur_frm.add_custom_button(__('Make Maint. Visit'), this.make_maintenance_visit);
|
||||||
cur_frm.add_custom_button(__('Make Maint. Schedule'),
|
cur_frm.add_custom_button(__('Make Maint. Schedule'),
|
||||||
this.make_maintenance_schedule);
|
this.make_maintenance_schedule);
|
||||||
}
|
}
|
||||||
|
|
||||||
// indent
|
// indent
|
||||||
if(!doc.order_type || (doc.order_type == 'Sales'))
|
if(!doc.order_type || ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1)
|
||||||
cur_frm.add_custom_button(__('Make ') + __('Material Request'),
|
cur_frm.add_custom_button(__('Make ') + __('Material Request'),
|
||||||
this.make_material_request);
|
this.make_material_request);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,9 @@
|
|||||||
|
|
||||||
$.extend(cur_frm.cscript, {
|
$.extend(cur_frm.cscript, {
|
||||||
onload: function() {
|
onload: function() {
|
||||||
cur_frm.set_query("item_code", erpnext.queries.item);
|
cur_frm.set_query("item_code", function() {
|
||||||
|
return erpnext.queries.item({"is_stock_item": "Yes"});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
item_code: function() {
|
item_code: function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user