[issue fixes] + added fixtures for item attribute and operation
diff --git a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py
index dbfdee7..27f1249 100644
--- a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py
+++ b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py
@@ -23,7 +23,7 @@
purchase_receipt = d.purchase_receipt
elif d.po_detail:
purchase_receipt = ", ".join(frappe.db.sql_list("""select distinct parent
- from `tabPurchase Receipt Item` where docstatus=1 and prevdoc_detail_docname=%s""", d.po_detail))
+ from `tabPurchase Receipt Item` where docstatus=1 and po_detail=%s""", d.po_detail))
expense_account = d.expense_account or aii_account_map.get(d.company)
row = [d.item_code, d.item_name, d.item_group, d.parent, d.posting_date, d.supplier,
diff --git a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py
index 4907cbb..fef397f 100644
--- a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py
+++ b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py
@@ -22,7 +22,7 @@
delivery_note = d.delivery_note
elif d.so_detail:
delivery_note = ", ".join(frappe.db.sql_list("""select distinct parent
- from `tabDelivery Note Item` where docstatus=1 and prevdoc_detail_docname=%s""", d.so_detail))
+ from `tabDelivery Note Item` where docstatus=1 and so_detail=%s""", d.so_detail))
row = [d.item_code, d.item_name, d.item_group, d.parent, d.posting_date, d.customer, d.customer_name,
d.customer_group, d.debit_to, d.territory, d.project_name, d.company, d.sales_order,
diff --git a/erpnext/accounts/report/purchase_register/purchase_register.py b/erpnext/accounts/report/purchase_register/purchase_register.py
index 727a663..724b678 100644
--- a/erpnext/accounts/report/purchase_register/purchase_register.py
+++ b/erpnext/accounts/report/purchase_register/purchase_register.py
@@ -160,7 +160,7 @@
pr_list = [d.purchase_receipt]
elif d.po_detail:
pr_list = frappe.db.sql_list("""select distinct parent from `tabPurchase Receipt Item`
- where docstatus=1 and prevdoc_detail_docname=%s""", d.pr_detail)
+ where docstatus=1 and po_detail=%s""", d.pr_detail)
if pr_list:
invoice_po_pr_map.setdefault(d.parent, frappe._dict()).setdefault("purchase_receipt", pr_list)
diff --git a/erpnext/accounts/report/sales_register/sales_register.py b/erpnext/accounts/report/sales_register/sales_register.py
index bdce7bd..3bd82b6 100644
--- a/erpnext/accounts/report/sales_register/sales_register.py
+++ b/erpnext/accounts/report/sales_register/sales_register.py
@@ -160,7 +160,7 @@
delivery_note_list = [d.delivery_note]
elif d.sales_order:
delivery_note_list = frappe.db.sql_list("""select distinct parent from `tabDelivery Note Item`
- where docstatus=1 and prevdoc_detail_docname=%s""", d.so_detail)
+ where docstatus=1 and so_detail=%s""", d.so_detail)
if delivery_note_list:
invoice_so_dn_map.setdefault(d.parent, frappe._dict()).setdefault("delivery_note", delivery_note_list)
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js
index 30affb8..b1eee0e 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.js
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.js
@@ -9,13 +9,13 @@
erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend({
refresh: function(doc, cdt, cdn) {
this._super();
- this.frm.dashboard.reset();
+ // this.frm.dashboard.reset();
if(doc.docstatus == 1 && doc.status != 'Stopped'){
- cur_frm.dashboard.add_progress(cint(doc.per_received) + __("% Received"),
- doc.per_received);
- cur_frm.dashboard.add_progress(cint(doc.per_billed) + __("% Billed"),
- doc.per_billed);
+ // cur_frm.dashboard.add_progress(cint(doc.per_received) + __("% Received"),
+ // doc.per_received);
+ // cur_frm.dashboard.add_progress(cint(doc.per_billed) + __("% Billed"),
+ // doc.per_billed);
if(flt(doc.per_received, 2) < 100)
cur_frm.add_custom_button(__('Make Purchase Receipt'),
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js
index 3f4e99e..1febb74 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.js
+++ b/erpnext/manufacturing/doctype/production_order/production_order.js
@@ -59,12 +59,12 @@
var doc = frm.doc;
if (doc.docstatus === 1) {
- if (doc.material_transferred_for_qty < doc.qty) {
+ if (flt(doc.material_transferred_for_qty) < flt(doc.qty)) {
frm.add_custom_button(__('Transfer Materials for Manufacture'),
cur_frm.cscript['Transfer Raw Materials'], frappe.boot.doctype_icons["Stock Entry"]);
}
- if (doc.produced_qty < doc.material_transferred_for_qty) {
+ if (flt(doc.produced_qty) < flt(doc.material_transferred_for_qty)) {
frm.add_custom_button(__('Update Finished Goods'),
cur_frm.cscript['Update Finished Goods'], frappe.boot.doctype_icons["Stock Entry"]);
}
diff --git a/erpnext/setup/page/setup_wizard/fixtures/__init__.py b/erpnext/setup/page/setup_wizard/fixtures/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/setup/page/setup_wizard/fixtures/__init__.py
diff --git a/erpnext/setup/page/setup_wizard/fixtures/industry_type.py b/erpnext/setup/page/setup_wizard/fixtures/industry_type.py
new file mode 100644
index 0000000..af508c2
--- /dev/null
+++ b/erpnext/setup/page/setup_wizard/fixtures/industry_type.py
@@ -0,0 +1,54 @@
+from frappe import _
+
+items = [
+_('Accounting'),
+_('Advertising'),
+_('Aerospace'),
+_('Agriculture'),
+_('Airline'),
+_('Apparel & Accessories'),
+_('Automotive'),
+_('Banking'),
+_('Biotechnology'),
+_('Broadcasting'),
+_('Brokerage'),
+_('Chemical'),
+_('Computer'),
+_('Consulting'),
+_('Consumer Products'),
+_('Cosmetics'),
+_('Defense'),
+_('Department Stores'),
+_('Education'),
+_('Electronics'),
+_('Energy'),
+_('Entertainment & Leisure'),
+_('Executive Search'),
+_('Financial Services'),
+_('Food, Beverage & Tobacco'),
+_('Grocery'),
+_('Health Care'),
+_('Internet Publishing'),
+_('Investment Banking'),
+_('Legal'),
+_('Manufacturing'),
+_('Motion Picture & Video'),
+_('Music'),
+_('Newspaper Publishers'),
+_('Online Auctions'),
+_('Pension Funds'),
+_('Pharmaceuticals'),
+_('Private Equity'),
+_('Publishing'),
+_('Real Estate'),
+_('Retail & Wholesale'),
+_('Securities & Commodity Exchanges'),
+_('Service'),
+_('Soap & Detergent'),
+_('Software'),
+_('Sports'),
+_('Technology'),
+_('Telecommunications'),
+_('Television'),
+_('Transportation'),
+_('Venture Capital')]
diff --git a/erpnext/setup/page/setup_wizard/fixtures/operations.py b/erpnext/setup/page/setup_wizard/fixtures/operations.py
new file mode 100644
index 0000000..4c982c1
--- /dev/null
+++ b/erpnext/setup/page/setup_wizard/fixtures/operations.py
@@ -0,0 +1,165 @@
+# source: http://en.wikipedia.org/wiki/List_of_manufacturing_processes"
+
+from __future__ import unicode_literals
+from frappe import _
+
+items = [
+_("Centrifugal casting"),
+_("Continuous casting"),
+_("Die casting"),
+_("Evaporative-pattern casting"),
+_("Full-mold casting"),
+_("Lost-foam casting"),
+_("Investment casting"),
+_("Countergravity casting"),
+_("Permanent mold casting"),
+_("Resin casting"),
+_("Sand casting"),
+_("Shell molding"),
+_("Spray forming"),
+_("Vacuum molding"),
+_("Molding"),
+_("Compaction plus sintering"),
+_("Hot isostatic pressing"),
+_("Metal injection molding"),
+_("Injection molding"),
+_("Compression molding"),
+_("Blow molding"),
+_("Dip molding"),
+_("Rotational molding"),
+_("Thermoforming"),
+_("Laminating"),
+_("Shrink fitting"),
+_("Shrink wrapping"),
+_("End tube forming"),
+_("Tube beading"),
+_("Forging"),
+_("Rolling"),
+_("Cold rolling"),
+_("Hot rolling"),
+_("Cryorolling"),
+_("Cross-rolling"),
+_("Pressing"),
+_("Embossing"),
+_("Stretch forming"),
+_("Blanking"),
+_("Drawing"),
+_("Bulging"),
+_("Necking"),
+_("Nosing"),
+_("Deep drawing"),
+_("Bending"),
+_("Hemming"),
+_("Shearing"),
+_("Piercing"),
+_("Trimming"),
+_("Shaving"),
+_("Notching"),
+_("Perforating"),
+_("Nibbling"),
+_("Lancing"),
+_("Cutting"),
+_("Stamping"),
+_("Coining"),
+_("Straight shearing"),
+_("Slitting"),
+_("Redrawing"),
+_("Ironing"),
+_("Flattening"),
+_("Swaging"),
+_("Spinning"),
+_("Peening"),
+_("Explosive forming"),
+_("Electroforming"),
+_("Staking"),
+_("Seaming"),
+_("Flanging"),
+_("Straightening"),
+_("Decambering"),
+_("Cold sizing"),
+_("Hubbing"),
+_("Hot metal gas forming"),
+_("Curling"),
+_("Hydroforming"),
+_("Machining"),
+_("Milling"),
+_("Hammering"),
+_("Smelting"),
+_("Refining"),
+_("Annealing"),
+_("Pickling"),
+_("Coating"),
+_("Turning"),
+_("Facing"),
+_("Boring"),
+_("Knurling"),
+_("Hard turning"),
+_("Drilling"),
+_("Reaming"),
+_("Countersinking"),
+_("Tapping"),
+_("Sawing"),
+_("Filing"),
+_("Broaching"),
+_("Shaping"),
+_("Planing"),
+_("Double housing"),
+_("Abrasive jet machining"),
+_("Water jet cutting"),
+_("Photochemical machining"),
+_("Honing"),
+_("Electro-chemical grinding"),
+_("Finishing & industrial finishing"),
+_("Abrasive blasting"),
+_("Buffing"),
+_("Burnishing"),
+_("Electroplating"),
+_("Electropolishing"),
+_("Magnetic field-assisted finishing"),
+_("Etching"),
+_("Linishing"),
+_("Mass finishing"),
+_("Tumbling"),
+_("Spindle finishing"),
+_("Vibratory finishing"),
+_("Plating"),
+_("Polishing"),
+_("Superfinishing"),
+_("Wire brushing"),
+_("Routing"),
+_("Hobbing"),
+_("Ultrasonic machining"),
+_("Electron beam machining"),
+_("Electrochemical machining"),
+_("Laser cutting"),
+_("Laser drilling"),
+_("Grinding"),
+_("Gashing"),
+_("Biomachining"),
+_("Joining"),
+_("Welding"),
+_("Brazing"),
+_("Sintering"),
+_("Adhesive bonding"),
+_("Nailing"),
+_("Screwing"),
+_("Riveting"),
+_("Clinching"),
+_("Pinning"),
+_("Stitching"),
+_("Stapling"),
+_("Press fitting"),
+_("3D printing"),
+_("Direct metal laser sintering"),
+_("Fused deposition modeling"),
+_("Laminated object manufacturing"),
+_("Laser engineered net shaping"),
+_("Selective laser sintering"),
+_("Mining"),
+_("Quarrying"),
+_("Blasting"),
+_("Woodworking"),
+_("Lapping"),
+_("Morticing"),
+_("Crushing"),
+_("Packaging and labeling")]
diff --git a/erpnext/setup/page/setup_wizard/install_fixtures.py b/erpnext/setup/page/setup_wizard/install_fixtures.py
index b24eaa6..2980247f 100644
--- a/erpnext/setup/page/setup_wizard/install_fixtures.py
+++ b/erpnext/setup/page/setup_wizard/install_fixtures.py
@@ -137,64 +137,31 @@
{'doctype': 'Activity Type', 'activity_type': _('Communication')},
{'doctype': 'Activity Type', 'activity_type': 'Manufacturing'},
- # Industry Type
- {'doctype': 'Industry Type', 'industry': _('Accounting')},
- {'doctype': 'Industry Type', 'industry': _('Advertising')},
- {'doctype': 'Industry Type', 'industry': _('Aerospace')},
- {'doctype': 'Industry Type', 'industry': _('Agriculture')},
- {'doctype': 'Industry Type', 'industry': _('Airline')},
- {'doctype': 'Industry Type', 'industry': _('Apparel & Accessories')},
- {'doctype': 'Industry Type', 'industry': _('Automotive')},
- {'doctype': 'Industry Type', 'industry': _('Banking')},
- {'doctype': 'Industry Type', 'industry': _('Biotechnology')},
- {'doctype': 'Industry Type', 'industry': _('Broadcasting')},
- {'doctype': 'Industry Type', 'industry': _('Brokerage')},
- {'doctype': 'Industry Type', 'industry': _('Chemical')},
- {'doctype': 'Industry Type', 'industry': _('Computer')},
- {'doctype': 'Industry Type', 'industry': _('Consulting')},
- {'doctype': 'Industry Type', 'industry': _('Consumer Products')},
- {'doctype': 'Industry Type', 'industry': _('Cosmetics')},
- {'doctype': 'Industry Type', 'industry': _('Defense')},
- {'doctype': 'Industry Type', 'industry': _('Department Stores')},
- {'doctype': 'Industry Type', 'industry': _('Education')},
- {'doctype': 'Industry Type', 'industry': _('Electronics')},
- {'doctype': 'Industry Type', 'industry': _('Energy')},
- {'doctype': 'Industry Type', 'industry': _('Entertainment & Leisure')},
- {'doctype': 'Industry Type', 'industry': _('Executive Search')},
- {'doctype': 'Industry Type', 'industry': _('Financial Services')},
- {'doctype': 'Industry Type', 'industry': _('Food, Beverage & Tobacco')},
- {'doctype': 'Industry Type', 'industry': _('Grocery')},
- {'doctype': 'Industry Type', 'industry': _('Health Care')},
- {'doctype': 'Industry Type', 'industry': _('Internet Publishing')},
- {'doctype': 'Industry Type', 'industry': _('Investment Banking')},
- {'doctype': 'Industry Type', 'industry': _('Legal')},
- {'doctype': 'Industry Type', 'industry': _('Manufacturing')},
- {'doctype': 'Industry Type', 'industry': _('Motion Picture & Video')},
- {'doctype': 'Industry Type', 'industry': _('Music')},
- {'doctype': 'Industry Type', 'industry': _('Newspaper Publishers')},
- {'doctype': 'Industry Type', 'industry': _('Online Auctions')},
- {'doctype': 'Industry Type', 'industry': _('Pension Funds')},
- {'doctype': 'Industry Type', 'industry': _('Pharmaceuticals')},
- {'doctype': 'Industry Type', 'industry': _('Private Equity')},
- {'doctype': 'Industry Type', 'industry': _('Publishing')},
- {'doctype': 'Industry Type', 'industry': _('Real Estate')},
- {'doctype': 'Industry Type', 'industry': _('Retail & Wholesale')},
- {'doctype': 'Industry Type', 'industry': _('Securities & Commodity Exchanges')},
- {'doctype': 'Industry Type', 'industry': _('Service')},
- {'doctype': 'Industry Type', 'industry': _('Soap & Detergent')},
- {'doctype': 'Industry Type', 'industry': _('Software')},
- {'doctype': 'Industry Type', 'industry': _('Sports')},
- {'doctype': 'Industry Type', 'industry': _('Technology')},
- {'doctype': 'Industry Type', 'industry': _('Telecommunications')},
- {'doctype': 'Industry Type', 'industry': _('Television')},
- {'doctype': 'Industry Type', 'industry': _('Transportation')},
- {'doctype': 'Industry Type', 'industry': _('Venture Capital')},
+ {'doctype': "Item Attribute", "attribute_name": _("Size"), "item_attribute_values": [
+ {"attribute_value": _("Extra Small"), "abbr": "XS"},
+ {"attribute_value": _("Small"), "abbr": "S"},
+ {"attribute_value": _("Medium"), "abbr": "M"},
+ {"attribute_value": _("Large"), "abbr": "L"},
+ {"attribute_value": _("Extra Large"), "abbr": "XL"}
+ ]},
+
+ {'doctype': "Item Attribute", "attribute_name": _("Colour"), "item_attribute_values": [
+ {"attribute_value": _("Red"), "abbr": "RED"},
+ {"attribute_value": _("Green"), "abbr": "GRE"},
+ {"attribute_value": _("Blue"), "abbr": "BLU"},
+ {"attribute_value": _("Black"), "abbr": "BLA"},
+ {"attribute_value": _("White"), "abbr": "WHI"}
+ ]},
{'doctype': "Email Account", "email_id": "sales@example.com", "append_to": "Lead"},
{'doctype': "Email Account", "email_id": "support@example.com", "append_to": "Issue"},
{'doctype': "Email Account", "email_id": "jobs@example.com", "append_to": "Job Applicant"}
]
+ from erpnext.setup.page.setup_wizard.fixtures import industry_type, operations
+ records += [{"doctype":"Industry Type", "industry": d} for d in industry_type.items]
+ records += [{"doctype":"Operation", "operation": d} for d in operations.items]
+
from frappe.modules import scrub
for r in records:
doc = frappe.new_doc(r.get("doctype"))
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 98f9fae..54e7192 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -427,7 +427,7 @@
pro_doc = frappe.get_doc("Production Order", self.production_order)
_validate_production_order(pro_doc)
pro_doc.run_method("update_status")
- if self.purpose == "Manufacture":
+ if self.purpose in ("Manufacture", "Material Transfer for Manufacture"):
pro_doc.run_method("update_production_order_qty")
self.update_planned_qty(pro_doc)