[pull-mappers] no fields via custom button, started with quotation, material request, purchase order

This commit is contained in:
Rushabh Mehta
2013-07-08 15:52:24 +05:30
parent 11eda08cd5
commit 862a02b8d2
12 changed files with 123 additions and 269 deletions

View File

@@ -52,16 +52,32 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten
}
cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms);
}
if (this.frm.doc.docstatus===0) {
cur_frm.add_custom_button(wn._('From Sales Order'),
function() {
wn.model.map_current_doc({
method: "selling.doctype.sales_order.sales_order.make_material_request",
source_doctype: "Sales Order",
get_query_filters: {
docstatus: 1,
status: ["!=", "Stopped"],
per_delivered: ["<", 99.99],
company: cur_frm.doc.company
}
})
});
}
if(doc.docstatus == 1 && doc.status == 'Stopped')
cur_frm.add_custom_button('Unstop Material Request',
cur_frm.cscript['Unstop Material Request']);
if(doc.material_request_type === "Transfer") {
cur_frm.toggle_display("sales_order_no", false);
cur_frm.fields_dict.indent_details.grid.set_column_disp("sales_order_no", false);
}
},
tc_name: function() {
this.get_terms();
},
validate_company_and_party: function(party_field) {
@@ -71,14 +87,7 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten
calculate_taxes_and_totals: function() {
return;
},
pull_sales_order_details: function(doc) {
wn.model.map_current_doc({
method: "selling.doctype.sales_order.sales_order.make_material_request",
source_name: cur_frm.doc.sales_order_no,
});
},
make_purchase_order: function() {
wn.model.open_mapped_doc({
method: "stock.doctype.material_request.material_request.make_purchase_order",

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-03-07 14:48:38",
"docstatus": 0,
"modified": "2013-07-08 11:02:12",
"modified": "2013-07-08 15:40:01",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -98,44 +98,6 @@
"oldfieldtype": "Table",
"options": "Material Request Item"
},
{
"doctype": "DocField",
"fieldname": "section_break1",
"fieldtype": "Section Break"
},
{
"doctype": "DocField",
"fieldname": "column_break4",
"fieldtype": "Column Break",
"print_width": "50%",
"width": "50%"
},
{
"description": "One or multiple Sales Order no which generated this Material Request",
"doctype": "DocField",
"fieldname": "sales_order_no",
"fieldtype": "Link",
"label": "Sales Order No",
"no_copy": 1,
"oldfieldname": "sales_order_no",
"oldfieldtype": "Data",
"options": "Sales Order",
"print_width": "100px",
"width": "100px"
},
{
"doctype": "DocField",
"fieldname": "column_break5",
"fieldtype": "Column Break",
"print_width": "50%",
"width": "50%"
},
{
"doctype": "DocField",
"fieldname": "pull_sales_order_details",
"fieldtype": "Button",
"label": "Pull Sales Order Items"
},
{
"default": "Give additional details about the indent.",
"doctype": "DocField",
@@ -308,13 +270,6 @@
"print_hide": 1,
"report_hide": 1
},
{
"doctype": "DocField",
"fieldname": "get_terms",
"fieldtype": "Button",
"label": "Get Terms and Conditions",
"oldfieldtype": "Button"
},
{
"doctype": "DocField",
"fieldname": "terms",

View File

@@ -68,7 +68,10 @@ class DocType(BuyingController):
msgprint("Rejected Warehouse is necessary if there are rejections.")
raise Exception
if not flt(d.qty) and flt(d.rejected_qty):
if not flt(d.received_qty) and flt(d.qty):
d.received_qty = flt(d.qty) - flt(d.rejected_qty)
elif not flt(d.qty) and flt(d.rejected_qty):
d.qty = flt(d.received_qty) - flt(d.rejected_qty)
elif not flt(d.rejected_qty):

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 19:29:10",
"docstatus": 0,
"modified": "2013-05-31 14:26:41",
"modified": "2013-07-08 13:52:28",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -165,7 +165,7 @@
"doctype": "DocField",
"fieldname": "purchase_ref_rate",
"fieldtype": "Currency",
"label": "Ref Rate*",
"label": "Price List Rate*",
"options": "Company:company:default_currency",
"print_hide": 1,
"read_only": 0