From 93654a3e049400cc61cef29785c171732ec5afe4 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 20 Mar 2012 14:31:14 +0530 Subject: [PATCH] stock entry: new purpose others added --- .../Purchase Order-Purchase Receipt.txt | 2 +- .../stock/doctype/stock_entry/stock_entry.js | 19 +- .../stock/doctype/stock_entry/stock_entry.py | 76 +- .../stock/doctype/stock_entry/stock_entry.txt | 766 +++++++++--------- 4 files changed, 455 insertions(+), 408 deletions(-) diff --git a/erpnext/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt b/erpnext/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt index e3f0dc9adf..d62849590e 100644 --- a/erpnext/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt +++ b/erpnext/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:35', 'docstatus': 0, - 'modified': '2012-03-01 17:58:16', + 'modified': '2012-03-20 14:24:12', 'modified_by': u'Administrator', 'owner': u'Administrator' }, diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 1e558c9441..99eab91e82 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -22,13 +22,17 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { var cfn_set_fields = function(doc, cdt, cdn) { - lst = ['supplier','supplier_name','supplier_address','customer','customer_name','customer_address']; - if (doc.purpose == 'Production Order'){ - unhide_field(['production_order', 'process', 'Get Items']); - hide_field(['from_warehouse', 'to_warehouse','purchase_receipt_no','delivery_note_no', 'sales_invoice_no','Warehouse HTML']); - doc.from_warehouse = ''; + lst = ['supplier','supplier_name','supplier_address','customer','customer_name','customer_address']; + hide_field(lst); + + if (doc.purpose == 'Production Order' || doc.purpose == 'Others'){ + unhide_field('Get Items'); + hide_field(['from_warehouse', 'to_warehouse','purchase_receipt_no','delivery_note_no', 'sales_invoice_no','Warehouse HTML', 'transporter', 'is_excisable_goods', 'excisable_goods']); + if (doc.purpose=='Production Order') unhide_field(['production_order', 'process']); + + doc.from_warehouse = ''; doc.to_warehosue = ''; - if (doc.process == 'Backflush'){ + if (doc.process == 'Backflush' || doc.purpose == 'Others'){ unhide_field('fg_completed_qty'); } else{ @@ -39,7 +43,6 @@ var cfn_set_fields = function(doc, cdt, cdn) { else{ unhide_field(['from_warehouse', 'to_warehouse']); hide_field(['production_order', 'process', 'Get Items', 'fg_completed_qty','purchase_receipt_no','delivery_note_no', 'sales_invoice_no']); - hide_field(lst); doc.production_order = ''; doc.process = ''; doc.fg_completed_qty = 0; @@ -48,12 +51,10 @@ var cfn_set_fields = function(doc, cdt, cdn) { if(doc.purpose == 'Purchase Return'){ doc.customer=doc.customer_name = doc.customer_address=doc.delivery_note_no=doc.sales_invoice_no=''; - hide_field(lst); unhide_field(['supplier','supplier_name','supplier_address','purchase_receipt_no']); } else if(doc.purpose == 'Sales Return'){ doc.supplier=doc.supplier_name = doc.supplier_address=doc.purchase_receipt_no=''; - hide_field(lst); unhide_field(['customer','customer_name','customer_address','delivery_note_no', 'sales_invoice_no']); } else{ doc.customer=doc.customer_name=doc.customer_address=doc.delivery_note_no=doc.sales_invoice_no=doc.supplier=doc.supplier_name = doc.supplier_address=doc.purchase_receipt_no=''; diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 530c5e615e..c50a31b785 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -157,13 +157,13 @@ class DocType: - def get_raw_materials(self,pro_obj): + def get_raw_materials(self, bom_no, fg_qty, consider_sa_items_as_rm): """ get all items from flat bom except child items of sub-contracted and sub assembly items and sub assembly items itself. """ - if pro_obj.doc.consider_sa_items == 'Yes': + if consider_sa_items_as_rm == 'Yes': # Get all raw materials considering SA items as raw materials, # so no childs of SA items fl_bom_sa_items = sql(""" @@ -171,8 +171,7 @@ class DocType: from `tabBOM Material` where parent = '%s' and docstatus < 2 group by item_code - """ % ((self.doc.process == 'Backflush') and flt(self.doc.fg_completed_qty) \ - or flt(pro_obj.doc.qty), cstr(pro_obj.doc.bom_no))) + """ % (fg_qty, bom_no)) self.make_items_dict(fl_bom_sa_items) @@ -189,8 +188,7 @@ class DocType: and ifnull(it.is_sub_contracted_item, 'No') = 'No' and fb.docstatus<2 and fb.parent=%s ) a group by item_code,stock_uom - """ , ((self.doc.process == 'Backflush') and flt(self.doc.fg_completed_qty) \ - or flt(pro_obj.doc.qty), cstr(pro_obj.doc.bom_no))) + """ , (fg_qty, bom_no)) self.make_items_dict(fl_bom_sa_child_item) # Update only qty remaining to be issued for production @@ -199,17 +197,11 @@ class DocType: - def add_to_stock_entry_detail(self, pro_obj, item_dict, fg_item = 0): - sw, tw = '', '' - if self.doc.process == 'Material Transfer': - tw = cstr(pro_obj.doc.wip_warehouse) - if self.doc.process == 'Backflush': - tw = fg_item and cstr(pro_obj.doc.fg_warehouse) or '' - if not fg_item: sw = cstr(pro_obj.doc.wip_warehouse) + def add_to_stock_entry_detail(self, source_wh, target_wh, item_dict, fg_item = 0, bom_no = ''): for d in item_dict: se_child = addchild(self.doc, 'mtn_details', 'Stock Entry Detail', 0, self.doclist) - se_child.s_warehouse = sw - se_child.t_warehouse = tw + se_child.s_warehouse = source_wh + se_child.t_warehouse = target_wh se_child.fg_item = fg_item se_child.item_code = cstr(d) se_child.description = item_dict[d][1] @@ -219,24 +211,52 @@ class DocType: se_child.qty = flt(item_dict[d][0]) se_child.transfer_qty = flt(item_dict[d][0]) se_child.conversion_factor = 1.00 - if fg_item: se_child.bom_no = pro_obj.doc.bom_no + if fg_item: se_child.bom_no = bom_no + + def validate_bom_no(self): + if self.doc.bom_no: + if not self.doc.fg_completed_qty: + msgprint("Please enter FG Completed Qty", raise_exception=1) + if not self.doc.consider_sa_items_as_raw_materials: + msgprint("Please confirm whether you want to consider sub assembly item as raw materials", raise_exception=1) # get items #------------------ def get_items(self): - pro_obj = self.doc.production_order and get_obj('Production Order', self.doc.production_order) or '' - - self.validate_for_production_order(pro_obj) - self.get_raw_materials(pro_obj) - + if self.doc.purpose == 'Production Order': + pro_obj = self.doc.production_order and get_obj('Production Order', self.doc.production_order) or '' + self.validate_for_production_order(pro_obj) + + bom_no = pro_obj.doc.bom_no + fg_qty = (self.doc.process == 'Backflush') and flt(self.doc.fg_completed_qty) or flt(pro_obj.doc.qty) + consider_sa_items_as_rm = pro_obj.doc.consider_sa_items + elif self.doc.purpose == 'Others': + self.validate_bom_no() + bom_no = self.doc.bom_no + fg_qty = self.doc.fg_completed_qty + consider_sa_items_as_rm = self.doc.consider_sa_items_as_raw_materials + + self.get_raw_materials(bom_no, fg_qty, consider_sa_items_as_rm) self.doc.clear_table(self.doclist, 'mtn_details', 1) - self.add_to_stock_entry_detail(pro_obj, self.item_dict) - + sw = (self.doc.process == 'Backflush') and cstr(pro_obj.doc.wip_warehouse) or '' + tw = (self.doc.process == 'Material Transfer') and cstr(pro_obj.doc.wip_warehouse) or '' + self.add_to_stock_entry_detail(sw, tw, self.item_dict) + + fg_item_dict = {} if self.doc.process == 'Backflush': - item_dict = {cstr(pro_obj.doc.production_item) : [self.doc.fg_completed_qty, pro_obj.doc.description, pro_obj.doc.stock_uom]} - self.add_to_stock_entry_detail(pro_obj, item_dict, fg_item = 1) + sw = '' + tw = cstr(pro_obj.doc.fg_warehouse) + fg_item_dict = {cstr(pro_obj.doc.production_item) : [self.doc.fg_completed_qty, pro_obj.doc.description, pro_obj.doc.stock_uom]} + elif self.doc.purpose == 'Others' and self.doc.bom_no: + sw, tw = '', '' + item = sql("select item, description, uom from `tabBill Of Materials` where name = %s", self.doc.bom_no, as_dict=1) + fg_item_dict = {item[0]['item'] : [self.doc.fg_completed_qty, item[0]['description'], item[0]['uom']]} + + if fg_item_dict: + self.add_to_stock_entry_detail(sw, tw, fg_item_dict, fg_item = 1, bom_no = bom_no) + def validate_transfer_qty(self): @@ -289,7 +309,7 @@ class DocType: def validate_for_production_order(self, pro_obj): - if self.doc.purpose == 'Production Order' or self.doc.process or self.doc.production_order or flt(self.doc.fg_completed_qty): + if self.doc.purpose == 'Production Order' or self.doc.process or self.doc.production_order: if self.doc.purpose != 'Production Order': msgprint("Purpose should be 'Production Order'.") raise Exception @@ -394,7 +414,6 @@ class DocType: if cstr(pro_obj.doc.production_item) != cstr(d.item_code): msgprint("Item %s in Stock Entry Detail as Row No %s do not match with Item %s in Production Order %s" % (cstr(d.item_code), cstr(d.idx), cstr(pro_obj.doc.production_item), cstr(pro_obj.doc.name))) raise Exception - fg_qty = flt(fg_qty) + flt(d.transfer_qty) if cstr(d.t_warehouse) != cstr(pro_obj.doc.fg_warehouse): msgprint("As Item %s is FG Item. Target Warehouse should be same as FG Warehouse %s in Production Order %s, at Row No %s. " % ( cstr(d.item_code), cstr(pro_obj.doc.fg_warehouse), cstr(pro_obj.doc.name), cstr(d.idx))) raise Exception @@ -408,6 +427,9 @@ class DocType: if cstr(d.s_warehouse) != cstr(pro_obj.doc.wip_warehouse): msgprint("As Item %s is Raw Material. Source Warehouse should be same as WIP Warehouse %s in Production Order %s, at Row No %s. " % ( cstr(d.item_code), cstr(pro_obj.doc.wip_warehouse), cstr(pro_obj.doc.name), cstr(d.idx))) raise Exception + if d.fg_item and (self.doc.purpose == 'Others' or self.doc.process == 'Backflush'): + fg_qty = flt(fg_qty) + flt(d.transfer_qty) + d.save() if self.doc.fg_completed_qty and flt(self.doc.fg_completed_qty) != flt(fg_qty): msgprint("The Total of FG Qty %s in Stock Entry Detail do not match with FG Completed Qty %s" % (flt(fg_qty), flt(self.doc.fg_completed_qty))) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.txt b/erpnext/stock/doctype/stock_entry/stock_entry.txt index 395082f5d3..4fc2495e69 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.txt +++ b/erpnext/stock/doctype/stock_entry/stock_entry.txt @@ -5,22 +5,22 @@ { 'creation': '2010-08-08 17:09:25', 'docstatus': 0, - 'modified': '2012-01-24 19:47:47', - 'modified_by': 'Administrator', - 'owner': 'Administrator' + 'modified': '2012-03-20 14:28:17', + 'modified_by': u'Administrator', + 'owner': u'Administrator' }, # These values are common for all DocType { - '_last_update': '1325570647', + '_last_update': u'1332225743', 'allow_attach': 0, 'allow_copy': 0, 'allow_email': 0, 'allow_print': 0, 'allow_rename': 0, 'allow_trash': 0, - 'colour': 'White:FFF', - 'default_print_format': 'Standard', + 'colour': u'White:FFF', + 'default_print_format': u'Standard', 'doctype': 'DocType', 'hide_heading': 0, 'hide_toolbar': 0, @@ -29,44 +29,44 @@ 'is_transaction_doc': 0, 'issingle': 0, 'max_attachments': 0, - 'module': 'Stock', + 'module': u'Stock', 'name': '__common__', - 'print_outline': 'No', + 'print_outline': u'No', 'read_only': 0, 'read_only_onload': 0, - 'search_fields': 'transfer_date, from_warehouse, to_warehouse, purpose, remarks', - 'section_style': 'Tabbed', - 'server_code_error': ' ', + 'search_fields': u'transfer_date, from_warehouse, to_warehouse, purpose, remarks', + 'section_style': u'Tabbed', + 'server_code_error': u' ', 'show_in_menu': 0, - 'subject': '%(remarks)s', - 'tag_fields': 'purpose', + 'subject': u'%(remarks)s', + 'tag_fields': u'purpose', 'use_template': 0, - 'version': 248 + 'version': 258 }, # These values are common for all DocField { - 'doctype': 'DocField', + 'doctype': u'DocField', 'name': '__common__', - 'parent': 'Stock Entry', - 'parentfield': 'fields', - 'parenttype': 'DocType' + 'parent': u'Stock Entry', + 'parentfield': u'fields', + 'parenttype': u'DocType' }, # These values are common for all DocPerm { - 'doctype': 'DocPerm', + 'doctype': u'DocPerm', 'name': '__common__', - 'parent': 'Stock Entry', - 'parentfield': 'permissions', - 'parenttype': 'DocType', + 'parent': u'Stock Entry', + 'parentfield': u'permissions', + 'parenttype': u'DocType', 'read': 1 }, # DocType, Stock Entry { 'doctype': 'DocType', - 'name': 'Stock Entry' + 'name': u'Stock Entry' }, # DocPerm @@ -74,9 +74,9 @@ 'amend': 0, 'cancel': 0, 'create': 0, - 'doctype': 'DocPerm', + 'doctype': u'DocPerm', 'permlevel': 1, - 'role': 'Material Manager', + 'role': u'Material Manager', 'submit': 0, 'write': 0 }, @@ -86,9 +86,9 @@ 'amend': 0, 'cancel': 0, 'create': 0, - 'doctype': 'DocPerm', + 'doctype': u'DocPerm', 'permlevel': 1, - 'role': 'Material User', + 'role': u'Material User', 'submit': 0, 'write': 0 }, @@ -98,9 +98,9 @@ 'amend': 1, 'cancel': 1, 'create': 1, - 'doctype': 'DocPerm', + 'doctype': u'DocPerm', 'permlevel': 0, - 'role': 'Production User', + 'role': u'Production User', 'submit': 1, 'write': 1 }, @@ -110,9 +110,9 @@ 'amend': 0, 'cancel': 0, 'create': 0, - 'doctype': 'DocPerm', + 'doctype': u'DocPerm', 'permlevel': 1, - 'role': 'Production User', + 'role': u'Production User', 'submit': 0, 'write': 0 }, @@ -122,9 +122,9 @@ 'amend': 0, 'cancel': 0, 'create': 0, - 'doctype': 'DocPerm', + 'doctype': u'DocPerm', 'permlevel': 2, - 'role': 'Production User', + 'role': u'Production User', 'submit': 0, 'write': 1 }, @@ -134,9 +134,9 @@ 'amend': 1, 'cancel': 1, 'create': 1, - 'doctype': 'DocPerm', + 'doctype': u'DocPerm', 'permlevel': 0, - 'role': 'Production Manager', + 'role': u'Production Manager', 'submit': 1, 'write': 1 }, @@ -146,9 +146,9 @@ 'amend': 0, 'cancel': 0, 'create': 0, - 'doctype': 'DocPerm', + 'doctype': u'DocPerm', 'permlevel': 1, - 'role': 'Production Manager', + 'role': u'Production Manager', 'submit': 0, 'write': 0 }, @@ -158,45 +158,45 @@ 'amend': 0, 'cancel': 0, 'create': 0, - 'doctype': 'DocPerm', + 'doctype': u'DocPerm', 'permlevel': 2, - 'role': 'Production Manager', + 'role': u'Production Manager', 'submit': 0, 'write': 1 }, # DocField { - 'doctype': 'DocField', - 'fieldtype': 'Section Break', - 'label': 'Warehouse', - 'oldfieldtype': 'Section Break', + 'doctype': u'DocField', + 'fieldtype': u'Section Break', + 'label': u'Warehouse', + 'oldfieldtype': u'Section Break', 'permlevel': 0 }, # DocField { - 'doctype': 'DocField', - 'fieldtype': 'Column Break', - 'oldfieldtype': 'Column Break', + 'doctype': u'DocField', + 'fieldtype': u'Column Break', + 'oldfieldtype': u'Column Break', 'permlevel': 0, - 'width': '50%' + 'width': u'50%' }, # DocField { 'allow_on_submit': 0, - 'colour': 'White:FFF', - 'description': 'To manage multiple series please go to Setup > Manage Series', - 'doctype': 'DocField', - 'fieldname': 'naming_series', - 'fieldtype': 'Select', + 'colour': u'White:FFF', + 'description': u'To manage multiple series please go to Setup > Manage Series', + 'doctype': u'DocField', + 'fieldname': u'naming_series', + 'fieldtype': u'Select', 'in_filter': 0, - 'label': 'Series', + 'label': u'Series', 'no_copy': 1, - 'oldfieldname': 'naming_series', - 'oldfieldtype': 'Select', - 'options': 'STE', + 'oldfieldname': u'naming_series', + 'oldfieldtype': u'Select', + 'options': u'STE', 'permlevel': 0, 'print_hide': 1, 'report_hide': 0, @@ -207,15 +207,15 @@ # DocField { 'allow_on_submit': 0, - 'description': 'The date at which current entry is corrected in the system.', - 'doctype': 'DocField', - 'fieldname': 'amendment_date', - 'fieldtype': 'Date', + 'description': u'The date at which current entry is corrected in the system.', + 'doctype': u'DocField', + 'fieldname': u'amendment_date', + 'fieldtype': u'Date', 'in_filter': 0, - 'label': 'Amendment Date', + 'label': u'Amendment Date', 'no_copy': 1, - 'oldfieldname': 'amendment_date', - 'oldfieldtype': 'Date', + 'oldfieldname': u'amendment_date', + 'oldfieldtype': u'Date', 'permlevel': 0, 'print_hide': 1, 'report_hide': 0, @@ -225,73 +225,73 @@ # DocField { 'allow_on_submit': 0, - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldname': 'purpose', - 'fieldtype': 'Select', + 'colour': u'White:FFF', + 'doctype': u'DocField', + 'fieldname': u'purpose', + 'fieldtype': u'Select', 'in_filter': 1, - 'label': 'Purpose', + 'label': u'Purpose', 'no_copy': 0, - 'oldfieldname': 'purpose', - 'oldfieldtype': 'Select', - 'options': 'Material Issue\nMaterial Receipt\nMaterial Transfer\nSales Return\nPurchase Return\nSubcontracting\nProduction Order', + 'oldfieldname': u'purpose', + 'oldfieldtype': u'Select', + 'options': u'Material Issue\nMaterial Receipt\nMaterial Transfer\nSales Return\nPurchase Return\nSubcontracting\nProduction Order\nOthers', 'permlevel': 0, 'report_hide': 0, 'reqd': 1, 'search_index': 0, - 'trigger': 'Client' + 'trigger': u'Client' }, # DocField { 'allow_on_submit': 0, - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldname': 'delivery_note_no', - 'fieldtype': 'Link', + 'colour': u'White:FFF', + 'doctype': u'DocField', + 'fieldname': u'delivery_note_no', + 'fieldtype': u'Link', 'hidden': 1, 'in_filter': 0, - 'label': 'Delivery Note No', + 'label': u'Delivery Note No', 'no_copy': 0, - 'oldfieldname': 'delivery_note_no', - 'oldfieldtype': 'Link', - 'options': 'Delivery Note', + 'oldfieldname': u'delivery_note_no', + 'oldfieldtype': u'Link', + 'options': u'Delivery Note', 'permlevel': 0, 'print_hide': 1, 'report_hide': 0, 'search_index': 1, - 'trigger': 'Client' + 'trigger': u'Client' }, # DocField { 'allow_on_submit': 0, - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldname': 'purchase_receipt_no', - 'fieldtype': 'Link', + 'colour': u'White:FFF', + 'doctype': u'DocField', + 'fieldname': u'purchase_receipt_no', + 'fieldtype': u'Link', 'hidden': 1, 'in_filter': 0, - 'label': 'Purchase Receipt No', + 'label': u'Purchase Receipt No', 'no_copy': 0, - 'oldfieldname': 'purchase_receipt_no', - 'oldfieldtype': 'Link', - 'options': 'Purchase Receipt', + 'oldfieldname': u'purchase_receipt_no', + 'oldfieldtype': u'Link', + 'options': u'Purchase Receipt', 'permlevel': 0, 'print_hide': 1, 'report_hide': 0, 'search_index': 1, - 'trigger': 'Client' + 'trigger': u'Client' }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'sales_invoice_no', - 'fieldtype': 'Link', + 'doctype': u'DocField', + 'fieldname': u'sales_invoice_no', + 'fieldtype': u'Link', 'hidden': 1, - 'label': 'Sales Invoice No', - 'options': 'Receivable Voucher', + 'label': u'Sales Invoice No', + 'options': u'Receivable Voucher', 'permlevel': 0, 'print_hide': 1 }, @@ -299,35 +299,35 @@ # DocField { 'allow_on_submit': 0, - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldname': 'supplier', - 'fieldtype': 'Link', + 'colour': u'White:FFF', + 'doctype': u'DocField', + 'fieldname': u'supplier', + 'fieldtype': u'Link', 'hidden': 1, 'in_filter': 0, - 'label': 'Supplier', + 'label': u'Supplier', 'no_copy': 0, - 'oldfieldname': 'supplier', - 'oldfieldtype': 'Link', - 'options': 'Supplier', + 'oldfieldname': u'supplier', + 'oldfieldtype': u'Link', + 'options': u'Supplier', 'permlevel': 0, 'print_hide': 1, 'report_hide': 0, 'search_index': 0, - 'trigger': 'Client' + 'trigger': u'Client' }, # DocField { 'allow_on_submit': 0, - 'doctype': 'DocField', - 'fieldname': 'supplier_name', - 'fieldtype': 'Data', + 'doctype': u'DocField', + 'fieldname': u'supplier_name', + 'fieldtype': u'Data', 'in_filter': 0, - 'label': 'Supplier Name', + 'label': u'Supplier Name', 'no_copy': 0, - 'oldfieldname': 'supplier_name', - 'oldfieldtype': 'Data', + 'oldfieldname': u'supplier_name', + 'oldfieldtype': u'Data', 'permlevel': 1, 'report_hide': 0, 'search_index': 0 @@ -336,55 +336,55 @@ # DocField { 'allow_on_submit': 0, - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldname': 'supplier_address', - 'fieldtype': 'Small Text', + 'colour': u'White:FFF', + 'doctype': u'DocField', + 'fieldname': u'supplier_address', + 'fieldtype': u'Small Text', 'hidden': 1, 'in_filter': 0, - 'label': 'Supplier Address', + 'label': u'Supplier Address', 'no_copy': 0, - 'oldfieldname': 'supplier_address', - 'oldfieldtype': 'Small Text', + 'oldfieldname': u'supplier_address', + 'oldfieldtype': u'Small Text', 'permlevel': 0, 'report_hide': 0, 'search_index': 0, - 'trigger': 'Client' + 'trigger': u'Client' }, # DocField { 'allow_on_submit': 0, - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldname': 'customer', - 'fieldtype': 'Link', + 'colour': u'White:FFF', + 'doctype': u'DocField', + 'fieldname': u'customer', + 'fieldtype': u'Link', 'hidden': 1, 'in_filter': 0, - 'label': 'Customer', + 'label': u'Customer', 'no_copy': 0, - 'oldfieldname': 'customer', - 'oldfieldtype': 'Link', - 'options': 'Customer', + 'oldfieldname': u'customer', + 'oldfieldtype': u'Link', + 'options': u'Customer', 'permlevel': 0, 'print_hide': 1, 'report_hide': 0, 'search_index': 0, - 'trigger': 'Client' + 'trigger': u'Client' }, # DocField { 'allow_on_submit': 0, - 'doctype': 'DocField', - 'fieldname': 'customer_name', - 'fieldtype': 'Data', + 'doctype': u'DocField', + 'fieldname': u'customer_name', + 'fieldtype': u'Data', 'hidden': 1, 'in_filter': 0, - 'label': 'Customer Name', + 'label': u'Customer Name', 'no_copy': 0, - 'oldfieldname': 'customer_name', - 'oldfieldtype': 'Data', + 'oldfieldname': u'customer_name', + 'oldfieldtype': u'Data', 'permlevel': 1, 'report_hide': 0, 'search_index': 0 @@ -393,15 +393,15 @@ # DocField { 'allow_on_submit': 0, - 'doctype': 'DocField', - 'fieldname': 'customer_address', - 'fieldtype': 'Small Text', + 'doctype': u'DocField', + 'fieldname': u'customer_address', + 'fieldtype': u'Small Text', 'hidden': 1, 'in_filter': 0, - 'label': 'Customer Address', + 'label': u'Customer Address', 'no_copy': 0, - 'oldfieldname': 'customer_address', - 'oldfieldtype': 'Small Text', + 'oldfieldname': u'customer_address', + 'oldfieldtype': u'Small Text', 'permlevel': 0, 'report_hide': 0, 'search_index': 0 @@ -410,153 +410,177 @@ # DocField { 'allow_on_submit': 0, - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldname': 'process', - 'fieldtype': 'Select', + 'colour': u'White:FFF', + 'doctype': u'DocField', + 'fieldname': u'process', + 'fieldtype': u'Select', 'hidden': 1, 'in_filter': 1, - 'label': 'Process', + 'label': u'Process', 'no_copy': 0, - 'oldfieldname': 'process', - 'oldfieldtype': 'Select', - 'options': '\nMaterial Transfer\nBackflush', + 'oldfieldname': u'process', + 'oldfieldtype': u'Select', + 'options': u'\nMaterial Transfer\nBackflush', 'permlevel': 0, 'print_hide': 1, 'report_hide': 0, 'search_index': 0, - 'trigger': 'Client' + 'trigger': u'Client' }, # DocField { 'allow_on_submit': 0, - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldname': 'production_order', - 'fieldtype': 'Link', + 'colour': u'White:FFF', + 'doctype': u'DocField', + 'fieldname': u'production_order', + 'fieldtype': u'Link', 'hidden': 1, 'in_filter': 1, - 'label': 'Production Order', + 'label': u'Production Order', 'no_copy': 0, - 'oldfieldname': 'production_order', - 'oldfieldtype': 'Link', - 'options': 'Production Order', + 'oldfieldname': u'production_order', + 'oldfieldtype': u'Link', + 'options': u'Production Order', 'permlevel': 0, 'print_hide': 1, 'report_hide': 0, 'search_index': 1, - 'trigger': 'Client' + 'trigger': u'Client' }, # DocField { - 'allow_on_submit': 0, - 'doctype': 'DocField', - 'fieldname': 'fg_completed_qty', - 'fieldtype': 'Currency', - 'in_filter': 0, - 'label': 'FG Completed Qty', - 'no_copy': 0, - 'oldfieldname': 'fg_completed_qty', - 'oldfieldtype': 'Currency', - 'permlevel': 0, - 'print_hide': 1, - 'report_hide': 0, - 'search_index': 0, - 'trigger': 'Client' - }, - - # DocField - { - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldtype': 'HTML', - 'label': 'Warehouse HTML', - 'no_copy': 0, - 'oldfieldtype': 'HTML', - 'options': "
Warehouse
", - 'permlevel': 0, - 'print_hide': 1 - }, - - # DocField - { - 'allow_on_submit': 0, - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldname': 'from_warehouse', - 'fieldtype': 'Link', - 'in_filter': 0, - 'label': 'Source Warehouse', - 'no_copy': 0, - 'oldfieldname': 'from_warehouse', - 'oldfieldtype': 'Link', - 'options': 'Warehouse', - 'permlevel': 0, - 'print_hide': 1, - 'report_hide': 0, - 'reqd': 0, - 'search_index': 0, - 'trigger': 'Client' - }, - - # DocField - { - 'allow_on_submit': 0, - 'colour': 'White:FFF', - 'description': 'Notes: Either Source or Target is Mandatory', - 'doctype': 'DocField', - 'fieldname': 'to_warehouse', - 'fieldtype': 'Link', - 'in_filter': 0, - 'label': 'Target Warehouse', - 'no_copy': 0, - 'oldfieldname': 'to_warehouse', - 'oldfieldtype': 'Link', - 'options': 'Warehouse', - 'permlevel': 0, - 'print_hide': 1, - 'report_hide': 0, - 'reqd': 0, - 'search_index': 0, - 'trigger': 'Client' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'project_name', - 'fieldtype': 'Link', - 'in_filter': 1, - 'label': 'Project Name', - 'oldfieldname': 'project_name', - 'oldfieldtype': 'Link', - 'options': 'Project', + 'depends_on': u"eval:doc.purpose == 'Others'", + 'doctype': u'DocField', + 'fieldname': u'bom_no', + 'fieldtype': u'Link', + 'label': u'BOM No', + 'options': u'Bill of Materials', 'permlevel': 0 }, # DocField { - 'doctype': 'DocField', - 'fieldtype': 'Column Break', - 'oldfieldtype': 'Column Break', - 'permlevel': 0, - 'width': '50%' + 'colour': u'White:FFF', + 'depends_on': u"eval:doc.purpose == 'Others'", + 'description': u'Select "Yes" if stock is maintained and tracked for sub-assembly items. Select "No" if you want child items of sub-assembly for material transfer.', + 'doctype': u'DocField', + 'fieldname': u'consider_sa_items_as_raw_materials', + 'fieldtype': u'Select', + 'label': u'Consider SA Items as Raw Materials', + 'options': u'\nNo\nYes', + 'permlevel': 0 }, # DocField { 'allow_on_submit': 0, - 'default': 'Today', - 'doctype': 'DocField', - 'fieldname': 'transfer_date', - 'fieldtype': 'Date', + 'doctype': u'DocField', + 'fieldname': u'fg_completed_qty', + 'fieldtype': u'Currency', + 'in_filter': 0, + 'label': u'FG Completed Qty', + 'no_copy': 0, + 'oldfieldname': u'fg_completed_qty', + 'oldfieldtype': u'Currency', + 'permlevel': 0, + 'print_hide': 1, + 'report_hide': 0, + 'search_index': 0, + 'trigger': u'Client' + }, + + # DocField + { + 'colour': u'White:FFF', + 'doctype': u'DocField', + 'fieldtype': u'HTML', + 'label': u'Warehouse HTML', + 'no_copy': 0, + 'oldfieldtype': u'HTML', + 'options': u"
Warehouse
", + 'permlevel': 0, + 'print_hide': 1 + }, + + # DocField + { + 'allow_on_submit': 0, + 'colour': u'White:FFF', + 'doctype': u'DocField', + 'fieldname': u'from_warehouse', + 'fieldtype': u'Link', + 'in_filter': 0, + 'label': u'Source Warehouse', + 'no_copy': 0, + 'oldfieldname': u'from_warehouse', + 'oldfieldtype': u'Link', + 'options': u'Warehouse', + 'permlevel': 0, + 'print_hide': 1, + 'report_hide': 0, + 'reqd': 0, + 'search_index': 0, + 'trigger': u'Client' + }, + + # DocField + { + 'allow_on_submit': 0, + 'colour': u'White:FFF', + 'description': u'Notes: Either Source or Target is Mandatory', + 'doctype': u'DocField', + 'fieldname': u'to_warehouse', + 'fieldtype': u'Link', + 'in_filter': 0, + 'label': u'Target Warehouse', + 'no_copy': 0, + 'oldfieldname': u'to_warehouse', + 'oldfieldtype': u'Link', + 'options': u'Warehouse', + 'permlevel': 0, + 'print_hide': 1, + 'report_hide': 0, + 'reqd': 0, + 'search_index': 0, + 'trigger': u'Client' + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'project_name', + 'fieldtype': u'Link', 'in_filter': 1, - 'label': 'Transfer Date', + 'label': u'Project Name', + 'oldfieldname': u'project_name', + 'oldfieldtype': u'Link', + 'options': u'Project', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldtype': u'Column Break', + 'oldfieldtype': u'Column Break', + 'permlevel': 0, + 'width': u'50%' + }, + + # DocField + { + 'allow_on_submit': 0, + 'default': u'Today', + 'doctype': u'DocField', + 'fieldname': u'transfer_date', + 'fieldtype': u'Date', + 'in_filter': 1, + 'label': u'Transfer Date', 'no_copy': 1, - 'oldfieldname': 'transfer_date', - 'oldfieldtype': 'Date', + 'oldfieldname': u'transfer_date', + 'oldfieldtype': u'Date', 'permlevel': 0, 'print_hide': 0, 'report_hide': 0, @@ -567,15 +591,15 @@ # DocField { 'allow_on_submit': 0, - 'description': 'The date at which current entry will get or has actually executed.', - 'doctype': 'DocField', - 'fieldname': 'posting_date', - 'fieldtype': 'Date', + 'description': u'The date at which current entry will get or has actually executed.', + 'doctype': u'DocField', + 'fieldname': u'posting_date', + 'fieldtype': u'Date', 'in_filter': 1, - 'label': 'Posting Date', + 'label': u'Posting Date', 'no_copy': 1, - 'oldfieldname': 'posting_date', - 'oldfieldtype': 'Date', + 'oldfieldname': u'posting_date', + 'oldfieldtype': u'Date', 'permlevel': 0, 'print_hide': 1, 'report_hide': 0, @@ -586,14 +610,14 @@ # DocField { 'allow_on_submit': 0, - 'doctype': 'DocField', - 'fieldname': 'posting_time', - 'fieldtype': 'Time', + 'doctype': u'DocField', + 'fieldname': u'posting_time', + 'fieldtype': u'Time', 'in_filter': 0, - 'label': 'Posting Time', + 'label': u'Posting Time', 'no_copy': 1, - 'oldfieldname': 'posting_time', - 'oldfieldtype': 'Time', + 'oldfieldname': u'posting_time', + 'oldfieldtype': u'Time', 'permlevel': 0, 'print_hide': 1, 'report_hide': 0, @@ -604,15 +628,15 @@ # DocField { 'allow_on_submit': 0, - 'doctype': 'DocField', - 'fieldname': 'amended_from', - 'fieldtype': 'Link', + 'doctype': u'DocField', + 'fieldname': u'amended_from', + 'fieldtype': u'Link', 'in_filter': 0, - 'label': 'Amended From', + 'label': u'Amended From', 'no_copy': 1, - 'oldfieldname': 'amended_from', - 'oldfieldtype': 'Link', - 'options': 'Stock Entry', + 'oldfieldname': u'amended_from', + 'oldfieldtype': u'Link', + 'options': u'Stock Entry', 'permlevel': 1, 'print_hide': 1, 'report_hide': 0, @@ -622,14 +646,14 @@ # DocField { 'allow_on_submit': 0, - 'doctype': 'DocField', - 'fieldname': 'transporter', - 'fieldtype': 'Data', + 'doctype': u'DocField', + 'fieldname': u'transporter', + 'fieldtype': u'Data', 'in_filter': 0, - 'label': 'Transporter', + 'label': u'Transporter', 'no_copy': 0, - 'oldfieldname': 'transporter', - 'oldfieldtype': 'Data', + 'oldfieldname': u'transporter', + 'oldfieldtype': u'Data', 'permlevel': 0, 'print_hide': 1, 'report_hide': 0, @@ -639,15 +663,15 @@ # DocField { 'allow_on_submit': 0, - 'doctype': 'DocField', - 'fieldname': 'is_excisable_goods', - 'fieldtype': 'Select', + 'doctype': u'DocField', + 'fieldname': u'is_excisable_goods', + 'fieldtype': u'Select', 'in_filter': 0, - 'label': 'Is Excisable Goods', + 'label': u'Is Excisable Goods', 'no_copy': 0, - 'oldfieldname': 'is_excisable_goods', - 'oldfieldtype': 'Select', - 'options': '\nYes\nNo', + 'oldfieldname': u'is_excisable_goods', + 'oldfieldtype': u'Select', + 'options': u'\nYes\nNo', 'permlevel': 0, 'print_hide': 1, 'report_hide': 0, @@ -657,15 +681,15 @@ # DocField { 'allow_on_submit': 0, - 'doctype': 'DocField', - 'fieldname': 'excisable_goods', - 'fieldtype': 'Select', + 'doctype': u'DocField', + 'fieldname': u'excisable_goods', + 'fieldtype': u'Select', 'in_filter': 0, - 'label': 'Excisable Goods', + 'label': u'Excisable Goods', 'no_copy': 0, - 'oldfieldname': 'excisable_goods', - 'oldfieldtype': 'Select', - 'options': '\nReturnable\nNon-Returnable', + 'oldfieldname': u'excisable_goods', + 'oldfieldtype': u'Select', + 'options': u'\nReturnable\nNon-Returnable', 'permlevel': 0, 'print_hide': 1, 'report_hide': 0, @@ -675,16 +699,16 @@ # DocField { 'allow_on_submit': 0, - 'doctype': 'DocField', - 'fieldname': 'under_rule', - 'fieldtype': 'Select', + 'doctype': u'DocField', + 'fieldname': u'under_rule', + 'fieldtype': u'Select', 'hidden': 1, 'in_filter': 0, - 'label': 'Under Rule', + 'label': u'Under Rule', 'no_copy': 0, - 'oldfieldname': 'under_rule', - 'oldfieldtype': 'Select', - 'options': '\nOrdinary\n57 AC (5) a\n57 F (2) Non-Exc.', + 'oldfieldname': u'under_rule', + 'oldfieldtype': u'Select', + 'options': u'\nOrdinary\n57 AC (5) a\n57 F (2) Non-Exc.', 'permlevel': 0, 'print_hide': 1, 'report_hide': 0, @@ -694,14 +718,14 @@ # DocField { 'allow_on_submit': 0, - 'doctype': 'DocField', - 'fieldname': 'remarks', - 'fieldtype': 'Text', + 'doctype': u'DocField', + 'fieldname': u'remarks', + 'fieldtype': u'Text', 'in_filter': 0, - 'label': 'Remarks', + 'label': u'Remarks', 'no_copy': 1, - 'oldfieldname': 'remarks', - 'oldfieldtype': 'Text', + 'oldfieldname': u'remarks', + 'oldfieldtype': u'Text', 'permlevel': 0, 'print_hide': 1, 'report_hide': 0, @@ -712,15 +736,15 @@ # DocField { 'allow_on_submit': 0, - 'doctype': 'DocField', - 'fieldname': 'cancel_reason', - 'fieldtype': 'Data', + 'doctype': u'DocField', + 'fieldname': u'cancel_reason', + 'fieldtype': u'Data', 'hidden': 1, 'in_filter': 0, - 'label': 'Cancel Reason', + 'label': u'Cancel Reason', 'no_copy': 1, - 'oldfieldname': 'cancel_reason', - 'oldfieldtype': 'Data', + 'oldfieldname': u'cancel_reason', + 'oldfieldtype': u'Data', 'permlevel': 1, 'print_hide': 1, 'report_hide': 0, @@ -730,44 +754,44 @@ # DocField { - 'doctype': 'DocField', - 'fieldtype': 'Section Break', - 'label': 'Items', - 'oldfieldtype': 'Section Break', + 'doctype': u'DocField', + 'fieldtype': u'Section Break', + 'label': u'Items', + 'oldfieldtype': u'Section Break', 'permlevel': 0 }, # DocField { - 'doctype': 'DocField', - 'fieldtype': 'Button', - 'label': 'Get Stock and Rate', - 'oldfieldtype': 'Button', - 'options': 'get_stock_and_rate', + 'doctype': u'DocField', + 'fieldtype': u'Button', + 'label': u'Get Stock and Rate', + 'oldfieldtype': u'Button', + 'options': u'get_stock_and_rate', 'permlevel': 0, 'print_hide': 1 }, # DocField { - 'doctype': 'DocField', - 'fieldtype': 'Column Break', - 'oldfieldtype': 'Column Break', + 'doctype': u'DocField', + 'fieldtype': u'Column Break', + 'oldfieldtype': u'Column Break', 'permlevel': 0 }, # DocField { 'allow_on_submit': 0, - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldtype': 'Button', + 'colour': u'White:FFF', + 'doctype': u'DocField', + 'fieldtype': u'Button', 'hidden': 0, 'in_filter': 0, - 'label': 'Get Items', + 'label': u'Get Items', 'no_copy': 0, - 'oldfieldtype': 'Button', - 'options': 'get_items', + 'oldfieldtype': u'Button', + 'options': u'get_items', 'permlevel': 0, 'print_hide': 1, 'report_hide': 0, @@ -776,26 +800,26 @@ # DocField { - 'doctype': 'DocField', - 'fieldtype': 'Section Break', - 'oldfieldtype': 'Section Break', - 'options': 'Simple', + 'doctype': u'DocField', + 'fieldtype': u'Section Break', + 'oldfieldtype': u'Section Break', + 'options': u'Simple', 'permlevel': 0 }, # DocField { 'allow_on_submit': 0, - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldname': 'mtn_details', - 'fieldtype': 'Table', + 'colour': u'White:FFF', + 'doctype': u'DocField', + 'fieldname': u'mtn_details', + 'fieldtype': u'Table', 'in_filter': 0, - 'label': 'MTN Details', + 'label': u'MTN Details', 'no_copy': 0, - 'oldfieldname': 'mtn_details', - 'oldfieldtype': 'Table', - 'options': 'Stock Entry Detail', + 'oldfieldname': u'mtn_details', + 'oldfieldtype': u'Table', + 'options': u'Stock Entry Detail', 'permlevel': 0, 'print_hide': 0, 'report_hide': 0, @@ -805,14 +829,14 @@ # DocField { 'allow_on_submit': 0, - 'doctype': 'DocField', - 'fieldname': 'total_amount', - 'fieldtype': 'Currency', + 'doctype': u'DocField', + 'fieldname': u'total_amount', + 'fieldtype': u'Currency', 'in_filter': 0, - 'label': 'Total Amount', + 'label': u'Total Amount', 'no_copy': 0, - 'oldfieldname': 'total_amount', - 'oldfieldtype': 'Currency', + 'oldfieldname': u'total_amount', + 'oldfieldtype': u'Currency', 'permlevel': 1, 'print_hide': 1, 'report_hide': 0, @@ -821,25 +845,25 @@ # DocField { - 'doctype': 'DocField', - 'fieldtype': 'Section Break', - 'label': 'Other Details', - 'oldfieldtype': 'Section Break', + 'doctype': u'DocField', + 'fieldtype': u'Section Break', + 'label': u'Other Details', + 'oldfieldtype': u'Section Break', 'permlevel': 0 }, # DocField { 'allow_on_submit': 0, - 'doctype': 'DocField', - 'fieldname': 'company', - 'fieldtype': 'Link', + 'doctype': u'DocField', + 'fieldname': u'company', + 'fieldtype': u'Link', 'in_filter': 1, - 'label': 'Company', + 'label': u'Company', 'no_copy': 0, - 'oldfieldname': 'company', - 'oldfieldtype': 'Link', - 'options': 'Company', + 'oldfieldname': u'company', + 'oldfieldtype': u'Link', + 'options': u'Company', 'permlevel': 0, 'print_hide': 1, 'report_hide': 0, @@ -850,15 +874,15 @@ # DocField { 'allow_on_submit': 0, - 'doctype': 'DocField', - 'fieldname': 'fiscal_year', - 'fieldtype': 'Select', + 'doctype': u'DocField', + 'fieldname': u'fiscal_year', + 'fieldtype': u'Select', 'in_filter': 0, - 'label': 'Fiscal Year', + 'label': u'Fiscal Year', 'no_copy': 0, - 'oldfieldname': 'fiscal_year', - 'oldfieldtype': 'Select', - 'options': 'link:Fiscal Year', + 'oldfieldname': u'fiscal_year', + 'oldfieldtype': u'Select', + 'options': u'link:Fiscal Year', 'permlevel': 0, 'print_hide': 1, 'report_hide': 0, @@ -869,15 +893,15 @@ # DocField { 'allow_on_submit': 0, - 'doctype': 'DocField', - 'fieldname': 'select_print_heading', - 'fieldtype': 'Link', + 'doctype': u'DocField', + 'fieldname': u'select_print_heading', + 'fieldtype': u'Link', 'in_filter': 0, - 'label': 'Select Print Heading', + 'label': u'Select Print Heading', 'no_copy': 0, - 'oldfieldname': 'select_print_heading', - 'oldfieldtype': 'Link', - 'options': 'Print Heading', + 'oldfieldname': u'select_print_heading', + 'oldfieldtype': u'Link', + 'options': u'Print Heading', 'permlevel': 0, 'report_hide': 0, 'search_index': 0